diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a0abc47..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 # use CircleCI 2.0 - -jobs: - build: - docker: - - image: circleci/php:7.2-node-browsers - working_directory: ~/client - steps: - - checkout - - run: sudo composer self-update - - restore_cache: - keys: - - composer-v1-{{ checksum "composer.lock" }} - - composer-v1- - - run: composer install -n --prefer-dist - - save_cache: - key: composer-v1-{{ checksum "composer.lock" }} - paths: - - vendor - - run: ./vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index e5ef5af..9f1681c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,15 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar /vendor/ -build -.idea -.phpunit.result.cache \ No newline at end of file + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/LICENSE b/LICENSE index 4765950..49bbc57 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 polygon.io +Copyright (c) 2023 polygon.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index d013cb9..4ed531c 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,208 @@ -# Polygon.io php api client +# Polygon PHP Client - WebSocket & RESTful APIs -[![CircleCI](https://circleci.com/gh/polygon-io/client-php.svg?style=svg)](https://circleci.com/gh/polygon-io/client-php) +Welcome to the official PHP client library for the [Polygon](https://polygon.io/) REST and WebSocket API. To get started, please see the [Getting Started](https://polygon.io/docs/stocks/getting-started) section in our documentation, view the [API documentation](./docs/Api/) directory for code snippets, or see the [Model documentation](./docs/Model/) to learn more about the data structures. -## Installation guide +This version is an **experimental release and is under active development**. We are working to add more features and improve its stability and performance. Please be aware that this version might undergo significant changes, and some functionality may be incomplete or subject to modification. -### prerequisite +## Roadmap Features -- [composer](https://getcomposer.org/) -- php > 7.2 +* **Pagination over next_url and combine result sets**: We plan to introduce enhanced pagination capabilities that will allow users to easily navigate through API responses using the next_url provided and seamlessly combine result sets for comprehensive data analysis. +* **Adding Tracing**: To aid in debugging and enhance transparency, we aim to implement tracing features that will allow users to log detailed information about their API requests. This includes the requested URL, parameters, and full request and response headers. +* **WebSocket Support**: In our effort to provide real-time data access, we will be integrating WebSocket support into the client library. This will enable users to establish persistent connections for live data feeds with minimal latency. -### install +## Installation & Usage -``` -composer require polygon-io/api -``` +### Prerequisites -## [Rest API](https://polygon.io/docs/#getting-started) +Before installing the Polygon PHP client, ensure your environment has PHP 7.4 or higher, compatible with PHP 8.0. -The `\PolygonIO\Rest\Rest` class export 4 modules: +### Composer -- reference -- stocks -- forex -- crypto +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/polygon-io/client-php.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} ``` -forex->realTimeCurrencyConversion->get('USD', 'EUR', 10)); +### Manual Installation +Download the files and include `autoload.php`: + +```php +websockets->forex( - 'C.USD', - function($data) { - // your handler function - } -); +// Load API key from environment variable +$apiKey = getenv('POLYGON_API_KEY'); + +// Check if the API key is not empty +if (!$apiKey) { + die('API key is not set in environment variables.'); +} + +// Configure API key authorization: apiKey +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('apiKey', $apiKey); ``` -## Development +### Using the Client -### prerequisite +Request data using client methods. +```php -- [composer](https://getcomposer.org/) -- php > 7.2 +// https://polygon.io/docs/stocks/get_v2_last_trade__stocksticker +$apiInstance = new OpenAPI\Client\Api\StockslasttradeApi( + new GuzzleHttp\Client(), + $config +); -### use the tooling +$stocks_ticker = "TSLA"; -Install dependencies +try { + $result = $apiInstance->lastTrade($stocks_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockslasttradeApi->lastTrade: ', $e->getMessage(), PHP_EOL; +} ``` -composer require + +## API Endpoints + +All URIs are relative to *https://api.polygon.io* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CrpytoaggregatesApi* | [**cryptoEMA**](docs/Api/CrpytoaggregatesApi.md#cryptoema) | **GET** /v1/indicators/ema/{cryptoTicker} | Exponential Moving Average (EMA) +*CrpytoaggregatesApi* | [**cryptoRSI**](docs/Api/CrpytoaggregatesApi.md#cryptorsi) | **GET** /v1/indicators/rsi/{cryptoTicker} | Relative Strength Index (RSI) +*CrpytoaggregatesApi* | [**cryptoSMA**](docs/Api/CrpytoaggregatesApi.md#cryptosma) | **GET** /v1/indicators/sma/{cryptoTicker} | Simple Moving Average (SMA) +*CryptoaggregatesApi* | [**cryptoMACD**](docs/Api/CryptoaggregatesApi.md#cryptomacd) | **GET** /v1/indicators/macd/{cryptoTicker} | Moving Average Convergence/Divergence (MACD) +*CryptoaggregatesApi* | [**v2AggsGroupedLocaleGlobalMarketCryptoDateGet**](docs/Api/CryptoaggregatesApi.md#v2aggsgroupedlocaleglobalmarketcryptodateget) | **GET** /v2/aggs/grouped/locale/global/market/crypto/{date} | Grouped Daily (Bars) +*CryptoaggregatesApi* | [**v2AggsTickerCryptoTickerPrevGet**](docs/Api/CryptoaggregatesApi.md#v2aggstickercryptotickerprevget) | **GET** /v2/aggs/ticker/{cryptoTicker}/prev | Previous Close +*CryptoaggregatesApi* | [**v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet**](docs/Api/CryptoaggregatesApi.md#v2aggstickercryptotickerrangemultipliertimespanfromtoget) | **GET** /v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) +*CryptolasttradeApi* | [**lastTradeCrypto**](docs/Api/CryptolasttradeApi.md#lasttradecrypto) | **GET** /v1/last/crypto/{from}/{to} | Last Trade for a Crypto Pair +*CryptoopenCloseApi* | [**v1OpenCloseCryptoFromToDateGet**](docs/Api/CryptoopenCloseApi.md#v1openclosecryptofromtodateget) | **GET** /v1/open-close/crypto/{from}/{to}/{date} | Daily Open/Close +*CryptosnapshotApi* | [**v2SnapshotLocaleGlobalMarketsCryptoDirectionGet**](docs/Api/CryptosnapshotApi.md#v2snapshotlocaleglobalmarketscryptodirectionget) | **GET** /v2/snapshot/locale/global/markets/crypto/{direction} | Gainers/Losers +*CryptosnapshotApi* | [**v2SnapshotLocaleGlobalMarketsCryptoTickersGet**](docs/Api/CryptosnapshotApi.md#v2snapshotlocaleglobalmarketscryptotickersget) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers | All Tickers +*CryptosnapshotApi* | [**v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet**](docs/Api/CryptosnapshotApi.md#v2snapshotlocaleglobalmarketscryptotickerstickerbookget) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book | Ticker Full Book (L2) +*CryptosnapshotApi* | [**v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet**](docs/Api/CryptosnapshotApi.md#v2snapshotlocaleglobalmarketscryptotickerstickerget) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers/{ticker} | Ticker +*CryptotradesApi* | [**tradesCrypto**](docs/Api/CryptotradesApi.md#tradescrypto) | **GET** /v3/trades/{cryptoTicker} | Trades +*CryptotradesApi* | [**v1HistoricCryptoFromToDateGet**](docs/Api/CryptotradesApi.md#v1historiccryptofromtodateget) | **GET** /v1/historic/crypto/{from}/{to}/{date} | Historic Crypto Trades +*DefaultApi* | [**snapshotSummary**](docs/Api/DefaultApi.md#snapshotsummary) | **GET** /v1/summaries | Summaries +*DefaultApi* | [**snapshots**](docs/Api/DefaultApi.md#snapshots) | **GET** /v3/snapshot | Universal Snapshot +*FxaggregatesApi* | [**forexEMA**](docs/Api/FxaggregatesApi.md#forexema) | **GET** /v1/indicators/ema/{fxTicker} | Exponential Moving Average (EMA) +*FxaggregatesApi* | [**forexMACD**](docs/Api/FxaggregatesApi.md#forexmacd) | **GET** /v1/indicators/macd/{fxTicker} | Moving Average Convergence/Divergence (MACD) +*FxaggregatesApi* | [**forexRSI**](docs/Api/FxaggregatesApi.md#forexrsi) | **GET** /v1/indicators/rsi/{fxTicker} | Relative Strength Index (RSI) +*FxaggregatesApi* | [**forexSMA**](docs/Api/FxaggregatesApi.md#forexsma) | **GET** /v1/indicators/sma/{fxTicker} | Simple Moving Average (SMA) +*FxaggregatesApi* | [**v2AggsGroupedLocaleGlobalMarketFxDateGet**](docs/Api/FxaggregatesApi.md#v2aggsgroupedlocaleglobalmarketfxdateget) | **GET** /v2/aggs/grouped/locale/global/market/fx/{date} | Grouped Daily (Bars) +*FxaggregatesApi* | [**v2AggsTickerForexTickerPrevGet**](docs/Api/FxaggregatesApi.md#v2aggstickerforextickerprevget) | **GET** /v2/aggs/ticker/{forexTicker}/prev | Previous Close +*FxaggregatesApi* | [**v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet**](docs/Api/FxaggregatesApi.md#v2aggstickerforextickerrangemultipliertimespanfromtoget) | **GET** /v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) +*FxconversionApi* | [**realTimeCurrencyConversion**](docs/Api/FxconversionApi.md#realtimecurrencyconversion) | **GET** /v1/conversion/{from}/{to} | Real-time Currency Conversion +*FxlastquoteApi* | [**lastQuoteCurrencies**](docs/Api/FxlastquoteApi.md#lastquotecurrencies) | **GET** /v1/last_quote/currencies/{from}/{to} | Last Quote for a Currency Pair +*FxquotesApi* | [**quotesFx**](docs/Api/FxquotesApi.md#quotesfx) | **GET** /v3/quotes/{fxTicker} | Quotes (BBO) +*FxsnapshotApi* | [**v2SnapshotLocaleGlobalMarketsForexDirectionGet**](docs/Api/FxsnapshotApi.md#v2snapshotlocaleglobalmarketsforexdirectionget) | **GET** /v2/snapshot/locale/global/markets/forex/{direction} | Gainers/Losers +*FxsnapshotApi* | [**v2SnapshotLocaleGlobalMarketsForexTickersGet**](docs/Api/FxsnapshotApi.md#v2snapshotlocaleglobalmarketsforextickersget) | **GET** /v2/snapshot/locale/global/markets/forex/tickers | All Tickers +*FxsnapshotApi* | [**v2SnapshotLocaleGlobalMarketsForexTickersTickerGet**](docs/Api/FxsnapshotApi.md#v2snapshotlocaleglobalmarketsforextickerstickerget) | **GET** /v2/snapshot/locale/global/markets/forex/tickers/{ticker} | Ticker +*FxtradesApi* | [**v1HistoricForexFromToDateGet**](docs/Api/FxtradesApi.md#v1historicforexfromtodateget) | **GET** /v1/historic/forex/{from}/{to}/{date} | Historic Forex Ticks +*IndicesaggregatesApi* | [**indicesEMA**](docs/Api/IndicesaggregatesApi.md#indicesema) | **GET** /v1/indicators/ema/{indicesTicker} | Exponential Moving Average (EMA) +*IndicesaggregatesApi* | [**indicesMACD**](docs/Api/IndicesaggregatesApi.md#indicesmacd) | **GET** /v1/indicators/macd/{indicesTicker} | Moving Average Convergence/Divergence (MACD) +*IndicesaggregatesApi* | [**indicesRSI**](docs/Api/IndicesaggregatesApi.md#indicesrsi) | **GET** /v1/indicators/rsi/{indicesTicker} | Relative Strength Index (RSI) +*IndicesaggregatesApi* | [**indicesSMA**](docs/Api/IndicesaggregatesApi.md#indicessma) | **GET** /v1/indicators/sma/{indicesTicker} | Simple Moving Average (SMA) +*IndicesaggregatesApi* | [**v2AggsTickerIndicesTickerPrevGet**](docs/Api/IndicesaggregatesApi.md#v2aggstickerindicestickerprevget) | **GET** /v2/aggs/ticker/{indicesTicker}/prev | Previous Close +*IndicesaggregatesApi* | [**v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet**](docs/Api/IndicesaggregatesApi.md#v2aggstickerindicestickerrangemultipliertimespanfromtoget) | **GET** /v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) +*IndicessnapshotApi* | [**indicesSnapshot**](docs/Api/IndicessnapshotApi.md#indicessnapshot) | **GET** /v3/snapshot/indices | Indices Snapshot +*InternalApi* | [**listTickerTaxonomyClassifications**](docs/Api/InternalApi.md#listtickertaxonomyclassifications) | **GET** /vX/reference/tickers/taxonomies | Ticker Taxonomies +*OptionsaggregatesApi* | [**optionsEMA**](docs/Api/OptionsaggregatesApi.md#optionsema) | **GET** /v1/indicators/ema/{optionsTicker} | Exponential Moving Average (EMA) +*OptionsaggregatesApi* | [**optionsMACD**](docs/Api/OptionsaggregatesApi.md#optionsmacd) | **GET** /v1/indicators/macd/{optionsTicker} | Moving Average Convergence/Divergence (MACD) +*OptionsaggregatesApi* | [**optionsRSI**](docs/Api/OptionsaggregatesApi.md#optionsrsi) | **GET** /v1/indicators/rsi/{optionsTicker} | Relative Strength Index (RSI) +*OptionsaggregatesApi* | [**optionsSMA**](docs/Api/OptionsaggregatesApi.md#optionssma) | **GET** /v1/indicators/sma/{optionsTicker} | Simple Moving Average (SMA) +*OptionsaggregatesApi* | [**v2AggsTickerOptionsTickerPrevGet**](docs/Api/OptionsaggregatesApi.md#v2aggstickeroptionstickerprevget) | **GET** /v2/aggs/ticker/{optionsTicker}/prev | Previous Close +*OptionsaggregatesApi* | [**v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet**](docs/Api/OptionsaggregatesApi.md#v2aggstickeroptionstickerrangemultipliertimespanfromtoget) | **GET** /v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) +*OptionslasttradeApi* | [**lastTradeOptions**](docs/Api/OptionslasttradeApi.md#lasttradeoptions) | **GET** /v2/last/trade/{optionsTicker} | Last Trade +*OptionsopenCloseApi* | [**v1OpenCloseOptionsTickerDateGet**](docs/Api/OptionsopenCloseApi.md#v1opencloseoptionstickerdateget) | **GET** /v1/open-close/{optionsTicker}/{date} | Daily Open/Close +*OptionsquotesApi* | [**quotesOptions**](docs/Api/OptionsquotesApi.md#quotesoptions) | **GET** /v3/quotes/{optionsTicker} | Quotes +*OptionssnapshotApi* | [**optionContract**](docs/Api/OptionssnapshotApi.md#optioncontract) | **GET** /v3/snapshot/options/{underlyingAsset}/{optionContract} | Option Contract +*OptionssnapshotApi* | [**optionsChain**](docs/Api/OptionssnapshotApi.md#optionschain) | **GET** /v3/snapshot/options/{underlyingAsset} | Options Chain +*OptionstradesApi* | [**tradesOptions**](docs/Api/OptionstradesApi.md#tradesoptions) | **GET** /v3/trades/{optionsTicker} | Trades +*PublicApi* | [**listTickerTaxonomyClassifications**](docs/Api/PublicApi.md#listtickertaxonomyclassifications) | **GET** /vX/reference/tickers/taxonomies | Ticker Taxonomies +*ReferenceconditionsApi* | [**listConditions**](docs/Api/ReferenceconditionsApi.md#listconditions) | **GET** /v3/reference/conditions | Conditions +*ReferencedividendsApi* | [**listDividends**](docs/Api/ReferencedividendsApi.md#listdividends) | **GET** /v3/reference/dividends | Dividends v3 +*ReferenceexchangesApi* | [**listExchanges**](docs/Api/ReferenceexchangesApi.md#listexchanges) | **GET** /v3/reference/exchanges | Exchanges +*ReferencenewsApi* | [**listNews**](docs/Api/ReferencenewsApi.md#listnews) | **GET** /v2/reference/news | Ticker News +*ReferenceoptionscontractApi* | [**getOptionsContract**](docs/Api/ReferenceoptionscontractApi.md#getoptionscontract) | **GET** /v3/reference/options/contracts/{options_ticker} | Options Contract +*ReferenceoptionscontractslistApi* | [**listOptionsContracts**](docs/Api/ReferenceoptionscontractslistApi.md#listoptionscontracts) | **GET** /v3/reference/options/contracts | Options Contracts +*ReferencesecfilingApi* | [**getFiling**](docs/Api/ReferencesecfilingApi.md#getfiling) | **GET** /v1/reference/sec/filings/{filing_id} | SEC Filing +*ReferencesecfilingfileApi* | [**getFilingFile**](docs/Api/ReferencesecfilingfileApi.md#getfilingfile) | **GET** /v1/reference/sec/filings/{filing_id}/files/{file_id} | SEC Filing File +*ReferencesecfilingfilesApi* | [**listFilingFiles**](docs/Api/ReferencesecfilingfilesApi.md#listfilingfiles) | **GET** /v1/reference/sec/filings/{filing_id}/files | SEC Filing Files +*ReferencesecfilingsApi* | [**listFilings**](docs/Api/ReferencesecfilingsApi.md#listfilings) | **GET** /v1/reference/sec/filings | SEC Filings +*ReferencestocksApi* | [**listFinancials**](docs/Api/ReferencestocksApi.md#listfinancials) | **GET** /vX/reference/financials | Stock Financials vX +*ReferencestocksApi* | [**listStockSplits**](docs/Api/ReferencestocksApi.md#liststocksplits) | **GET** /v3/reference/splits | Stock Splits v3 +*ReferencestocksmarketApi* | [**getMarketHolidays**](docs/Api/ReferencestocksmarketApi.md#getmarketholidays) | **GET** /v1/marketstatus/upcoming | Market Holidays +*ReferencestocksmarketApi* | [**getMarketStatus**](docs/Api/ReferencestocksmarketApi.md#getmarketstatus) | **GET** /v1/marketstatus/now | Market Status +*ReferencetickersgetApi* | [**getEvents**](docs/Api/ReferencetickersgetApi.md#getevents) | **GET** /vX/reference/tickers/{id}/events | Ticker Events +*ReferencetickersgetApi* | [**getTicker**](docs/Api/ReferencetickersgetApi.md#getticker) | **GET** /v3/reference/tickers/{ticker} | Ticker Details v3 +*ReferencetickerslistApi* | [**listTickers**](docs/Api/ReferencetickerslistApi.md#listtickers) | **GET** /v3/reference/tickers | Tickers +*ReferencetickerstypesApi* | [**listTickerTypes**](docs/Api/ReferencetickerstypesApi.md#listtickertypes) | **GET** /v3/reference/tickers/types | Ticker Types +*StocksaggregatesApi* | [**eMA**](docs/Api/StocksaggregatesApi.md#ema) | **GET** /v1/indicators/ema/{stockTicker} | Exponential Moving Average (EMA) +*StocksaggregatesApi* | [**mACD**](docs/Api/StocksaggregatesApi.md#macd) | **GET** /v1/indicators/macd/{stockTicker} | Moving Average Convergence/Divergence (MACD) +*StocksaggregatesApi* | [**rSI**](docs/Api/StocksaggregatesApi.md#rsi) | **GET** /v1/indicators/rsi/{stockTicker} | Relative Strength Index (RSI) +*StocksaggregatesApi* | [**sMA**](docs/Api/StocksaggregatesApi.md#sma) | **GET** /v1/indicators/sma/{stockTicker} | Simple Moving Average (SMA) +*StocksaggregatesApi* | [**v2AggsGroupedLocaleUsMarketStocksDateGet**](docs/Api/StocksaggregatesApi.md#v2aggsgroupedlocaleusmarketstocksdateget) | **GET** /v2/aggs/grouped/locale/us/market/stocks/{date} | Grouped Daily (Bars) +*StocksaggregatesApi* | [**v2AggsTickerStocksTickerPrevGet**](docs/Api/StocksaggregatesApi.md#v2aggstickerstockstickerprevget) | **GET** /v2/aggs/ticker/{stocksTicker}/prev | Previous Close +*StocksaggregatesApi* | [**v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet**](docs/Api/StocksaggregatesApi.md#v2aggstickerstockstickerrangemultipliertimespanfromtoget) | **GET** /v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) +*StockslastquoteApi* | [**lastQuote**](docs/Api/StockslastquoteApi.md#lastquote) | **GET** /v2/last/nbbo/{stocksTicker} | Last Quote +*StockslasttradeApi* | [**lastTrade**](docs/Api/StockslasttradeApi.md#lasttrade) | **GET** /v2/last/trade/{stocksTicker} | Last Trade +*StocksopenCloseApi* | [**v1OpenCloseIndicesTickerDateGet**](docs/Api/StocksopenCloseApi.md#v1opencloseindicestickerdateget) | **GET** /v1/open-close/{indicesTicker}/{date} | Daily Open/Close +*StocksopenCloseApi* | [**v1OpenCloseStocksTickerDateGet**](docs/Api/StocksopenCloseApi.md#v1openclosestockstickerdateget) | **GET** /v1/open-close/{stocksTicker}/{date} | Daily Open/Close +*StocksquotesApi* | [**quotes**](docs/Api/StocksquotesApi.md#quotes) | **GET** /v3/quotes/{stockTicker} | Quotes (NBBO) +*StocksquotesApi* | [**v2TicksStocksNbboTickerDateGet**](docs/Api/StocksquotesApi.md#v2ticksstocksnbbotickerdateget) | **GET** /v2/ticks/stocks/nbbo/{ticker}/{date} | Quotes (NBBO) +*StockssnapshotApi* | [**v2SnapshotLocaleUsMarketsStocksDirectionGet**](docs/Api/StockssnapshotApi.md#v2snapshotlocaleusmarketsstocksdirectionget) | **GET** /v2/snapshot/locale/us/markets/stocks/{direction} | Gainers/Losers +*StockssnapshotApi* | [**v2SnapshotLocaleUsMarketsStocksTickersGet**](docs/Api/StockssnapshotApi.md#v2snapshotlocaleusmarketsstockstickersget) | **GET** /v2/snapshot/locale/us/markets/stocks/tickers | All Tickers +*StockssnapshotApi* | [**v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet**](docs/Api/StockssnapshotApi.md#v2snapshotlocaleusmarketsstockstickersstockstickerget) | **GET** /v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker} | Ticker +*StockstradesApi* | [**trades**](docs/Api/StockstradesApi.md#trades) | **GET** /v3/trades/{stockTicker} | Trades +*StockstradesApi* | [**v2TicksStocksTradesTickerDateGet**](docs/Api/StockstradesApi.md#v2ticksstockstradestickerdateget) | **GET** /v2/ticks/stocks/trades/{ticker}/{date} | Trades + +## Contributing + +If you found a bug or have an idea for a new feature, please first discuss it with us by [submitting a new issue](https://github.com/polygon-io/client-php/issues/new/choose). We are also open to volunteers willing to submit PRs for any open issues but please discuss it with us beforehand. + +## Development + +For developing new features or fixing bugs, you will need to manage dependencies using Composer. + +```shell +composer install ``` -Run the linter +To run tests, use: + ```bash -./vendor/bin/phplint . +vendor/bin/phpunit ``` -Run the tests -``` -./vendor/bin/phpunit -``` +This PHP client follows the same release cadence as our API, ensuring it remains compatible with new and deprecated features. diff --git a/composer.json b/composer.json index 56534c9..8c2adcd 100644 --- a/composer.json +++ b/composer.json @@ -1,38 +1,41 @@ { "name": "polygon-io/api", - "description": "polygon.io php client", + "description": "polygon.io php-client", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", "type": "library", "license": "MIT", "authors": [ { - "name": "Julien Prugne", - "email": "julien@webeleon.dev" - }, - { - "name": "Ersin Demirtas", - "email": "ed5@me.com" + "name": "Polygon.io, Inc.", + "homepage": "https://polygon.io/" } ], "require": { - "php":">=7.2.5", + "php": "^7.4 || ^8.0", + "ext-curl": "*", "ext-json": "*", - "guzzlehttp/guzzle": "^7.2.0", - "amphp/websocket-client": "^0.2.4", - "psr/http-client": "^1.0" + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^8", - "squizlabs/php_codesniffer": "^3.5" + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^3.5" }, "autoload": { - "psr-4": { - "PolygonIO\\": "src/" - } + "psr-4": { "OpenAPI\\Client\\" : "lib/" } }, "autoload-dev": { - "psr-4": { - "PolygonIO\\Tests\\": "tests/" - } + "psr-4": { "OpenAPI\\Client\\Test\\" : "test/" } }, "scripts": { "test": "./vendor/bin/phpunit" diff --git a/docs/Api/CrpytoaggregatesApi.md b/docs/Api/CrpytoaggregatesApi.md new file mode 100644 index 0000000..c176377 --- /dev/null +++ b/docs/Api/CrpytoaggregatesApi.md @@ -0,0 +1,262 @@ +# OpenAPI\Client\CrpytoaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**cryptoEMA()**](CrpytoaggregatesApi.md#cryptoEMA) | **GET** /v1/indicators/ema/{cryptoTicker} | Exponential Moving Average (EMA) | +| [**cryptoRSI()**](CrpytoaggregatesApi.md#cryptoRSI) | **GET** /v1/indicators/rsi/{cryptoTicker} | Relative Strength Index (RSI) | +| [**cryptoSMA()**](CrpytoaggregatesApi.md#cryptoSMA) | **GET** /v1/indicators/sma/{cryptoTicker} | Simple Moving Average (SMA) | + + +## `cryptoEMA()` + +```php +cryptoEMA($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoEMA200Response +``` + +Exponential Moving Average (EMA) + +Get the exponential moving average (EMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CrpytoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol for which to get exponential moving average (EMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$window = 50; // int | The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->cryptoEMA($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CrpytoaggregatesApi->cryptoEMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol for which to get exponential moving average (EMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **window** | **int**| The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoEMA200Response**](../Model/CryptoEMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cryptoRSI()` + +```php +cryptoRSI($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoRSI200Response +``` + +Relative Strength Index (RSI) + +Get the relative strength index (RSI) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CrpytoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol for which to get relative strength index (RSI) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$window = 14; // int | The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->cryptoRSI($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CrpytoaggregatesApi->cryptoRSI: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol for which to get relative strength index (RSI) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **window** | **int**| The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 14] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoRSI200Response**](../Model/CryptoRSI200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cryptoSMA()` + +```php +cryptoSMA($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoSMA200Response +``` + +Simple Moving Average (SMA) + +Get the simple moving average (SMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CrpytoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol for which to get simple moving average (SMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$window = 50; // int | The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->cryptoSMA($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CrpytoaggregatesApi->cryptoSMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol for which to get simple moving average (SMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **window** | **int**| The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoSMA200Response**](../Model/CryptoSMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CryptoaggregatesApi.md b/docs/Api/CryptoaggregatesApi.md new file mode 100644 index 0000000..e15606c --- /dev/null +++ b/docs/Api/CryptoaggregatesApi.md @@ -0,0 +1,303 @@ +# OpenAPI\Client\CryptoaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**cryptoMACD()**](CryptoaggregatesApi.md#cryptoMACD) | **GET** /v1/indicators/macd/{cryptoTicker} | Moving Average Convergence/Divergence (MACD) | +| [**v2AggsGroupedLocaleGlobalMarketCryptoDateGet()**](CryptoaggregatesApi.md#v2AggsGroupedLocaleGlobalMarketCryptoDateGet) | **GET** /v2/aggs/grouped/locale/global/market/crypto/{date} | Grouped Daily (Bars) | +| [**v2AggsTickerCryptoTickerPrevGet()**](CryptoaggregatesApi.md#v2AggsTickerCryptoTickerPrevGet) | **GET** /v2/aggs/ticker/{cryptoTicker}/prev | Previous Close | +| [**v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet()**](CryptoaggregatesApi.md#v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet) | **GET** /v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) | + + +## `cryptoMACD()` + +```php +cryptoMACD($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoMACD200Response +``` + +Moving Average Convergence/Divergence (MACD) + +Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol for which to get MACD data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$short_window = 12; // int | The short window size used to calculate MACD data. +$long_window = 26; // int | The long window size used to calculate MACD data. +$signal_window = 9; // int | The window size used to calculate the MACD signal line. +$series_type = close; // string | The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->cryptoMACD($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptoaggregatesApi->cryptoMACD: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol for which to get MACD data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **short_window** | **int**| The short window size used to calculate MACD data. | [optional] [default to 12] | +| **long_window** | **int**| The long window size used to calculate MACD data. | [optional] [default to 26] | +| **signal_window** | **int**| The window size used to calculate the MACD signal line. | [optional] [default to 9] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoMACD200Response**](../Model/CryptoMACD200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsGroupedLocaleGlobalMarketCryptoDateGet()` + +```php +v2AggsGroupedLocaleGlobalMarketCryptoDateGet($date, $adjusted): \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response +``` + +Grouped Daily (Bars) + +Get the daily open, high, low, and close (OHLC) for the entire cryptocurrency markets. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptoaggregatesApi( + // 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 +); +$date = 2023-01-09; // string | The beginning date for the aggregate window. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsGroupedLocaleGlobalMarketCryptoDateGet($date, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptoaggregatesApi->v2AggsGroupedLocaleGlobalMarketCryptoDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **date** | **string**| The beginning date for the aggregate window. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response**](../Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerCryptoTickerPrevGet()` + +```php +v2AggsTickerCryptoTickerPrevGet($crypto_ticker, $adjusted): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response +``` + +Previous Close + +Get the previous day's open, high, low, and close (OHLC) for the specified cryptocurrency pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol of the currency pair. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsTickerCryptoTickerPrevGet($crypto_ticker, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptoaggregatesApi->v2AggsTickerCryptoTickerPrevGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol of the currency pair. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response**](../Model/V2AggsTickerCryptoTickerPrevGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet()` + +```php +v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response +``` + +Aggregates (Bars) + +Get aggregate bars for a cryptocurrency pair over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptoaggregatesApi( + // 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 +); +$crypto_ticker = X:BTCUSD; // string | The ticker symbol of the currency pair. +$multiplier = 1; // int | The size of the timespan multiplier. +$timespan = day; // string | The size of the time window. +$from = 2023-01-09; // string | The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$to = 2023-01-09; // string | The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. +$sort = asc; // string | Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). +$limit = 120; // int | Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + +try { + $result = $apiInstance->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptoaggregatesApi->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol of the currency pair. | | +| **multiplier** | **int**| The size of the timespan multiplier. | | +| **timespan** | **string**| The size of the time window. | | +| **from** | **string**| The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **to** | **string**| The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | +| **sort** | **string**| Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). | [optional] | +| **limit** | **int**| Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CryptolasttradeApi.md b/docs/Api/CryptolasttradeApi.md new file mode 100644 index 0000000..8835db5 --- /dev/null +++ b/docs/Api/CryptolasttradeApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\CryptolasttradeApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**lastTradeCrypto()**](CryptolasttradeApi.md#lastTradeCrypto) | **GET** /v1/last/crypto/{from}/{to} | Last Trade for a Crypto Pair | + + +## `lastTradeCrypto()` + +```php +lastTradeCrypto($from, $to): \OpenAPI\Client\Model\LastTradeCrypto200Response +``` + +Last Trade for a Crypto Pair + +Get the last trade tick for a cryptocurrency pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptolasttradeApi( + // 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 +); +$from = BTC; // string | The \"from\" symbol of the pair. +$to = USD; // string | The \"to\" symbol of the pair. + +try { + $result = $apiInstance->lastTradeCrypto($from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptolasttradeApi->lastTradeCrypto: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the pair. | | +| **to** | **string**| The \"to\" symbol of the pair. | | + +### Return type + +[**\OpenAPI\Client\Model\LastTradeCrypto200Response**](../Model/LastTradeCrypto200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CryptoopenCloseApi.md b/docs/Api/CryptoopenCloseApi.md new file mode 100644 index 0000000..6cb1020 --- /dev/null +++ b/docs/Api/CryptoopenCloseApi.md @@ -0,0 +1,76 @@ +# OpenAPI\Client\CryptoopenCloseApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v1OpenCloseCryptoFromToDateGet()**](CryptoopenCloseApi.md#v1OpenCloseCryptoFromToDateGet) | **GET** /v1/open-close/crypto/{from}/{to}/{date} | Daily Open/Close | + + +## `v1OpenCloseCryptoFromToDateGet()` + +```php +v1OpenCloseCryptoFromToDateGet($from, $to, $date, $adjusted): \OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response +``` + +Daily Open/Close + +Get the open, close prices of a cryptocurrency symbol on a certain day. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptoopenCloseApi( + // 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 +); +$from = BTC; // string | The \"from\" symbol of the pair. +$to = USD; // string | The \"to\" symbol of the pair. +$date = 2023-01-09; // \DateTime | The date of the requested open/close in the format YYYY-MM-DD. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v1OpenCloseCryptoFromToDateGet($from, $to, $date, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptoopenCloseApi->v1OpenCloseCryptoFromToDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the pair. | | +| **to** | **string**| The \"to\" symbol of the pair. | | +| **date** | **\DateTime**| The date of the requested open/close in the format YYYY-MM-DD. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response**](../Model/V1OpenCloseCryptoFromToDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CryptosnapshotApi.md b/docs/Api/CryptosnapshotApi.md new file mode 100644 index 0000000..7cc0769 --- /dev/null +++ b/docs/Api/CryptosnapshotApi.md @@ -0,0 +1,259 @@ +# OpenAPI\Client\CryptosnapshotApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v2SnapshotLocaleGlobalMarketsCryptoDirectionGet()**](CryptosnapshotApi.md#v2SnapshotLocaleGlobalMarketsCryptoDirectionGet) | **GET** /v2/snapshot/locale/global/markets/crypto/{direction} | Gainers/Losers | +| [**v2SnapshotLocaleGlobalMarketsCryptoTickersGet()**](CryptosnapshotApi.md#v2SnapshotLocaleGlobalMarketsCryptoTickersGet) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers | All Tickers | +| [**v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet()**](CryptosnapshotApi.md#v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book | Ticker Full Book (L2) | +| [**v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet()**](CryptosnapshotApi.md#v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet) | **GET** /v2/snapshot/locale/global/markets/crypto/tickers/{ticker} | Ticker | + + +## `v2SnapshotLocaleGlobalMarketsCryptoDirectionGet()` + +```php +v2SnapshotLocaleGlobalMarketsCryptoDirectionGet($direction): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response +``` + +Gainers/Losers + +Get the current top 20 gainers or losers of the day in cryptocurrency markets.

Top gainers are those tickers whose price has increased by the highest percentage since the previous day's close. Top losers are those tickers whose price has decreased by the highest percentage since the previous day's close.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptosnapshotApi( + // 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 +); +$direction = gainers; // string | The direction of the snapshot results to return. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsCryptoDirectionGet($direction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptosnapshotApi->v2SnapshotLocaleGlobalMarketsCryptoDirectionGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **direction** | **string**| The direction of the snapshot results to return. | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleGlobalMarketsCryptoTickersGet()` + +```php +v2SnapshotLocaleGlobalMarketsCryptoTickersGet($tickers): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response +``` + +All Tickers + +Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for all traded cryptocurrency symbols.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptosnapshotApi( + // 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 +); +$tickers = array('tickers_example'); // string[] | A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsCryptoTickersGet($tickers); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptosnapshotApi->v2SnapshotLocaleGlobalMarketsCryptoTickersGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tickers** | [**string[]**](../Model/string.md)| A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet()` + +```php +v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet($ticker): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response +``` + +Ticker Full Book (L2) + +Get the current level 2 book of a single ticker. This is the combined book from all of the exchanges.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptosnapshotApi( + // 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 +); +$ticker = X:BTCUSD; // string | The cryptocurrency ticker. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet($ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptosnapshotApi->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| The cryptocurrency ticker. | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet()` + +```php +v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet($ticker): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response +``` + +Ticker + +Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for a single traded cryptocurrency symbol.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptosnapshotApi( + // 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 +); +$ticker = X:BTCUSD; // string | Ticker of the snapshot + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet($ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptosnapshotApi->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Ticker of the snapshot | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CryptotradesApi.md b/docs/Api/CryptotradesApi.md new file mode 100644 index 0000000..071b6f2 --- /dev/null +++ b/docs/Api/CryptotradesApi.md @@ -0,0 +1,157 @@ +# OpenAPI\Client\CryptotradesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**tradesCrypto()**](CryptotradesApi.md#tradesCrypto) | **GET** /v3/trades/{cryptoTicker} | Trades | +| [**v1HistoricCryptoFromToDateGet()**](CryptotradesApi.md#v1HistoricCryptoFromToDateGet) | **GET** /v1/historic/crypto/{from}/{to}/{date} | Historic Crypto Trades | + + +## `tradesCrypto()` + +```php +tradesCrypto($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\TradesCrypto200Response +``` + +Trades + +Get trades for a crypto ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptotradesApi( + // 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 +); +$crypto_ticker = X:BTC-USD; // string | The ticker symbol to get trades for. +$timestamp = 'timestamp_example'; // string | Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->tradesCrypto($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptotradesApi->tradesCrypto: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **crypto_ticker** | **string**| The ticker symbol to get trades for. | | +| **timestamp** | **string**| Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\TradesCrypto200Response**](../Model/TradesCrypto200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v1HistoricCryptoFromToDateGet()` + +```php +v1HistoricCryptoFromToDateGet($from, $to, $date, $offset, $limit): \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response +``` + +Historic Crypto Trades + +Get historic trade ticks for a cryptocurrency pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\CryptotradesApi( + // 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 +); +$from = BTC; // string | The \"from\" symbol of the crypto pair. +$to = USD; // string | The \"to\" symbol of the crypto pair. +$date = 2020-10-14; // \DateTime | The date/day of the historic ticks to retrieve. +$offset = 56; // int | The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. +$limit = 100; // int | Limit the size of the response, max 10000. + +try { + $result = $apiInstance->v1HistoricCryptoFromToDateGet($from, $to, $date, $offset, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CryptotradesApi->v1HistoricCryptoFromToDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the crypto pair. | | +| **to** | **string**| The \"to\" symbol of the crypto pair. | | +| **date** | **\DateTime**| The date/day of the historic ticks to retrieve. | | +| **offset** | **int**| The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. | [optional] | +| **limit** | **int**| Limit the size of the response, max 10000. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response**](../Model/V1HistoricCryptoFromToDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md new file mode 100644 index 0000000..6e4c040 --- /dev/null +++ b/docs/Api/DefaultApi.md @@ -0,0 +1,151 @@ +# OpenAPI\Client\DefaultApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**snapshotSummary()**](DefaultApi.md#snapshotSummary) | **GET** /v1/summaries | Summaries | +| [**snapshots()**](DefaultApi.md#snapshots) | **GET** /v3/snapshot | Universal Snapshot | + + +## `snapshotSummary()` + +```php +snapshotSummary($ticker_any_of): \OpenAPI\Client\Model\SnapshotSummary200Response +``` + +Summaries + +Get everything needed to visualize the tick-by-tick movement of a list of tickers. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\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 +); +$ticker_any_of = NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD; // string | Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See the tickers endpoint for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. + +try { + $result = $apiInstance->snapshotSummary($ticker_any_of); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->snapshotSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker_any_of** | **string**| Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\SnapshotSummary200Response**](../Model/SnapshotSummary200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `snapshots()` + +```php +snapshots($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort): \OpenAPI\Client\Model\Snapshots200Response +``` + +Universal Snapshot + +Get snapshots for assets of all types + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\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 +); +$ticker = 'ticker_example'; // string +$type = 'type_example'; // string | Query by the type of asset. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$ticker_any_of = NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX; // string | Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 250. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->snapshots($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->snapshots: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| | [optional] | +| **type** | **string**| Query by the type of asset. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **ticker_any_of** | **string**| Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 250. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\Snapshots200Response**](../Model/Snapshots200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/FxaggregatesApi.md b/docs/Api/FxaggregatesApi.md new file mode 100644 index 0000000..4fee721 --- /dev/null +++ b/docs/Api/FxaggregatesApi.md @@ -0,0 +1,566 @@ +# OpenAPI\Client\FxaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**forexEMA()**](FxaggregatesApi.md#forexEMA) | **GET** /v1/indicators/ema/{fxTicker} | Exponential Moving Average (EMA) | +| [**forexMACD()**](FxaggregatesApi.md#forexMACD) | **GET** /v1/indicators/macd/{fxTicker} | Moving Average Convergence/Divergence (MACD) | +| [**forexRSI()**](FxaggregatesApi.md#forexRSI) | **GET** /v1/indicators/rsi/{fxTicker} | Relative Strength Index (RSI) | +| [**forexSMA()**](FxaggregatesApi.md#forexSMA) | **GET** /v1/indicators/sma/{fxTicker} | Simple Moving Average (SMA) | +| [**v2AggsGroupedLocaleGlobalMarketFxDateGet()**](FxaggregatesApi.md#v2AggsGroupedLocaleGlobalMarketFxDateGet) | **GET** /v2/aggs/grouped/locale/global/market/fx/{date} | Grouped Daily (Bars) | +| [**v2AggsTickerForexTickerPrevGet()**](FxaggregatesApi.md#v2AggsTickerForexTickerPrevGet) | **GET** /v2/aggs/ticker/{forexTicker}/prev | Previous Close | +| [**v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet()**](FxaggregatesApi.md#v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet) | **GET** /v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) | + + +## `forexEMA()` + +```php +forexEMA($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoEMA200Response +``` + +Exponential Moving Average (EMA) + +Get the exponential moving average (EMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$fx_ticker = C:EURUSD; // string | The ticker symbol for which to get exponential moving average (EMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->forexEMA($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->forexEMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fx_ticker** | **string**| The ticker symbol for which to get exponential moving average (EMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoEMA200Response**](../Model/CryptoEMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `forexMACD()` + +```php +forexMACD($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoMACD200Response +``` + +Moving Average Convergence/Divergence (MACD) + +Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$fx_ticker = C:EURUSD; // string | The ticker symbol for which to get MACD data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$short_window = 12; // int | The short window size used to calculate MACD data. +$long_window = 26; // int | The long window size used to calculate MACD data. +$signal_window = 9; // int | The window size used to calculate the MACD signal line. +$series_type = close; // string | The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->forexMACD($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->forexMACD: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fx_ticker** | **string**| The ticker symbol for which to get MACD data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **short_window** | **int**| The short window size used to calculate MACD data. | [optional] [default to 12] | +| **long_window** | **int**| The long window size used to calculate MACD data. | [optional] [default to 26] | +| **signal_window** | **int**| The window size used to calculate the MACD signal line. | [optional] [default to 9] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoMACD200Response**](../Model/CryptoMACD200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `forexRSI()` + +```php +forexRSI($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoRSI200Response +``` + +Relative Strength Index (RSI) + +Get the relative strength index (RSI) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$fx_ticker = C:EURUSD; // string | The ticker symbol for which to get relative strength index (RSI) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 14; // int | The window size used to calculate the relative strength index (RSI). +$series_type = close; // string | The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->forexRSI($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->forexRSI: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fx_ticker** | **string**| The ticker symbol for which to get relative strength index (RSI) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the relative strength index (RSI). | [optional] [default to 14] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoRSI200Response**](../Model/CryptoRSI200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `forexSMA()` + +```php +forexSMA($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoSMA200Response +``` + +Simple Moving Average (SMA) + +Get the simple moving average (SMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$fx_ticker = C:EURUSD; // string | The ticker symbol for which to get simple moving average (SMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->forexSMA($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->forexSMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fx_ticker** | **string**| The ticker symbol for which to get simple moving average (SMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoSMA200Response**](../Model/CryptoSMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsGroupedLocaleGlobalMarketFxDateGet()` + +```php +v2AggsGroupedLocaleGlobalMarketFxDateGet($date, $adjusted): \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response +``` + +Grouped Daily (Bars) + +Get the daily open, high, low, and close (OHLC) for the entire forex markets. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$date = 2023-01-09; // string | The beginning date for the aggregate window. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsGroupedLocaleGlobalMarketFxDateGet($date, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->v2AggsGroupedLocaleGlobalMarketFxDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **date** | **string**| The beginning date for the aggregate window. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response**](../Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerForexTickerPrevGet()` + +```php +v2AggsTickerForexTickerPrevGet($forex_ticker, $adjusted): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response +``` + +Previous Close + +Get the previous day's open, high, low, and close (OHLC) for the specified forex pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$forex_ticker = C:EURUSD; // string | The ticker symbol of the currency pair. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsTickerForexTickerPrevGet($forex_ticker, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->v2AggsTickerForexTickerPrevGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forex_ticker** | **string**| The ticker symbol of the currency pair. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response**](../Model/V2AggsTickerCryptoTickerPrevGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet()` + +```php +v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response +``` + +Aggregates (Bars) + +Get aggregate bars for a forex pair over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxaggregatesApi( + // 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 +); +$forex_ticker = C:EURUSD; // string | The ticker symbol of the currency pair. +$multiplier = 1; // int | The size of the timespan multiplier. +$timespan = day; // string | The size of the time window. +$from = 2023-01-09; // string | The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$to = 2023-01-09; // string | The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. +$sort = asc; // string | Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). +$limit = 120; // int | Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + +try { + $result = $apiInstance->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxaggregatesApi->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forex_ticker** | **string**| The ticker symbol of the currency pair. | | +| **multiplier** | **int**| The size of the timespan multiplier. | | +| **timespan** | **string**| The size of the time window. | | +| **from** | **string**| The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **to** | **string**| The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | +| **sort** | **string**| Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). | [optional] | +| **limit** | **int**| Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FxconversionApi.md b/docs/Api/FxconversionApi.md new file mode 100644 index 0000000..daf521d --- /dev/null +++ b/docs/Api/FxconversionApi.md @@ -0,0 +1,76 @@ +# OpenAPI\Client\FxconversionApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**realTimeCurrencyConversion()**](FxconversionApi.md#realTimeCurrencyConversion) | **GET** /v1/conversion/{from}/{to} | Real-time Currency Conversion | + + +## `realTimeCurrencyConversion()` + +```php +realTimeCurrencyConversion($from, $to, $amount, $precision): \OpenAPI\Client\Model\RealTimeCurrencyConversion200Response +``` + +Real-time Currency Conversion + +Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxconversionApi( + // 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 +); +$from = AUD; // string | The \"from\" symbol of the pair. +$to = USD; // string | The \"to\" symbol of the pair. +$amount = 100; // float | The amount to convert, with a decimal. +$precision = 2; // int | The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. + +try { + $result = $apiInstance->realTimeCurrencyConversion($from, $to, $amount, $precision); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxconversionApi->realTimeCurrencyConversion: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the pair. | | +| **to** | **string**| The \"to\" symbol of the pair. | | +| **amount** | **float**| The amount to convert, with a decimal. | [optional] [default to 1] | +| **precision** | **int**| The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. | [optional] [default to 2] | + +### Return type + +[**\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response**](../Model/RealTimeCurrencyConversion200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FxlastquoteApi.md b/docs/Api/FxlastquoteApi.md new file mode 100644 index 0000000..90ba0b6 --- /dev/null +++ b/docs/Api/FxlastquoteApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\FxlastquoteApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**lastQuoteCurrencies()**](FxlastquoteApi.md#lastQuoteCurrencies) | **GET** /v1/last_quote/currencies/{from}/{to} | Last Quote for a Currency Pair | + + +## `lastQuoteCurrencies()` + +```php +lastQuoteCurrencies($from, $to): \OpenAPI\Client\Model\LastQuoteCurrencies200Response +``` + +Last Quote for a Currency Pair + +Get the last quote tick for a forex currency pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxlastquoteApi( + // 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 +); +$from = AUD; // string | The \"from\" symbol of the pair. +$to = USD; // string | The \"to\" symbol of the pair. + +try { + $result = $apiInstance->lastQuoteCurrencies($from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxlastquoteApi->lastQuoteCurrencies: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the pair. | | +| **to** | **string**| The \"to\" symbol of the pair. | | + +### Return type + +[**\OpenAPI\Client\Model\LastQuoteCurrencies200Response**](../Model/LastQuoteCurrencies200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FxquotesApi.md b/docs/Api/FxquotesApi.md new file mode 100644 index 0000000..f5aef5a --- /dev/null +++ b/docs/Api/FxquotesApi.md @@ -0,0 +1,86 @@ +# OpenAPI\Client\FxquotesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**quotesFx()**](FxquotesApi.md#quotesFx) | **GET** /v3/quotes/{fxTicker} | Quotes (BBO) | + + +## `quotesFx()` + +```php +quotesFx($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\QuotesFx200Response +``` + +Quotes (BBO) + +Get BBO quotes for a ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxquotesApi( + // 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 +); +$fx_ticker = C:EUR-USD; // string | The ticker symbol to get quotes for. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->quotesFx($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxquotesApi->quotesFx: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fx_ticker** | **string**| The ticker symbol to get quotes for. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\QuotesFx200Response**](../Model/QuotesFx200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FxsnapshotApi.md b/docs/Api/FxsnapshotApi.md new file mode 100644 index 0000000..cf8d390 --- /dev/null +++ b/docs/Api/FxsnapshotApi.md @@ -0,0 +1,196 @@ +# OpenAPI\Client\FxsnapshotApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v2SnapshotLocaleGlobalMarketsForexDirectionGet()**](FxsnapshotApi.md#v2SnapshotLocaleGlobalMarketsForexDirectionGet) | **GET** /v2/snapshot/locale/global/markets/forex/{direction} | Gainers/Losers | +| [**v2SnapshotLocaleGlobalMarketsForexTickersGet()**](FxsnapshotApi.md#v2SnapshotLocaleGlobalMarketsForexTickersGet) | **GET** /v2/snapshot/locale/global/markets/forex/tickers | All Tickers | +| [**v2SnapshotLocaleGlobalMarketsForexTickersTickerGet()**](FxsnapshotApi.md#v2SnapshotLocaleGlobalMarketsForexTickersTickerGet) | **GET** /v2/snapshot/locale/global/markets/forex/tickers/{ticker} | Ticker | + + +## `v2SnapshotLocaleGlobalMarketsForexDirectionGet()` + +```php +v2SnapshotLocaleGlobalMarketsForexDirectionGet($direction): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response +``` + +Gainers/Losers + +Get the current top 20 gainers or losers of the day in forex markets.

Top gainers are those tickers whose price has increased by the highest percentage since the previous day's close. Top losers are those tickers whose price has decreased by the highest percentage since the previous day's close.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxsnapshotApi( + // 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 +); +$direction = gainers; // string | The direction of the snapshot results to return. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsForexDirectionGet($direction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxsnapshotApi->v2SnapshotLocaleGlobalMarketsForexDirectionGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **direction** | **string**| The direction of the snapshot results to return. | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleGlobalMarketsForexTickersGet()` + +```php +v2SnapshotLocaleGlobalMarketsForexTickersGet($tickers): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response +``` + +All Tickers + +Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for all traded forex symbols.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxsnapshotApi( + // 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 +); +$tickers = array('tickers_example'); // string[] | A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsForexTickersGet($tickers); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxsnapshotApi->v2SnapshotLocaleGlobalMarketsForexTickersGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tickers** | [**string[]**](../Model/string.md)| A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleGlobalMarketsForexTickersTickerGet()` + +```php +v2SnapshotLocaleGlobalMarketsForexTickersTickerGet($ticker): \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response +``` + +Ticker + +Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for a single traded currency symbol.

Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxsnapshotApi( + // 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 +); +$ticker = C:EURUSD; // string | The forex ticker. + +try { + $result = $apiInstance->v2SnapshotLocaleGlobalMarketsForexTickersTickerGet($ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxsnapshotApi->v2SnapshotLocaleGlobalMarketsForexTickersTickerGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| The forex ticker. | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response**](../Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FxtradesApi.md b/docs/Api/FxtradesApi.md new file mode 100644 index 0000000..f1d85df --- /dev/null +++ b/docs/Api/FxtradesApi.md @@ -0,0 +1,78 @@ +# OpenAPI\Client\FxtradesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v1HistoricForexFromToDateGet()**](FxtradesApi.md#v1HistoricForexFromToDateGet) | **GET** /v1/historic/forex/{from}/{to}/{date} | Historic Forex Ticks | + + +## `v1HistoricForexFromToDateGet()` + +```php +v1HistoricForexFromToDateGet($from, $to, $date, $offset, $limit): \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response +``` + +Historic Forex Ticks + +Get historic ticks for a forex currency pair. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\FxtradesApi( + // 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 +); +$from = AUD; // string | The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. +$to = USD; // string | The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. +$date = 2020-10-14; // \DateTime | The date/day of the historic ticks to retrieve. +$offset = 56; // int | The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. +$limit = 100; // int | Limit the size of the response, max 10000. + +try { + $result = $apiInstance->v1HistoricForexFromToDateGet($from, $to, $date, $offset, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FxtradesApi->v1HistoricForexFromToDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | **string**| The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. | | +| **to** | **string**| The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. | | +| **date** | **\DateTime**| The date/day of the historic ticks to retrieve. | | +| **offset** | **int**| The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. | [optional] | +| **limit** | **int**| Limit the size of the response, max 10000. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response**](../Model/V1HistoricForexFromToDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/IndicesaggregatesApi.md b/docs/Api/IndicesaggregatesApi.md new file mode 100644 index 0000000..5e8a785 --- /dev/null +++ b/docs/Api/IndicesaggregatesApi.md @@ -0,0 +1,497 @@ +# OpenAPI\Client\IndicesaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**indicesEMA()**](IndicesaggregatesApi.md#indicesEMA) | **GET** /v1/indicators/ema/{indicesTicker} | Exponential Moving Average (EMA) | +| [**indicesMACD()**](IndicesaggregatesApi.md#indicesMACD) | **GET** /v1/indicators/macd/{indicesTicker} | Moving Average Convergence/Divergence (MACD) | +| [**indicesRSI()**](IndicesaggregatesApi.md#indicesRSI) | **GET** /v1/indicators/rsi/{indicesTicker} | Relative Strength Index (RSI) | +| [**indicesSMA()**](IndicesaggregatesApi.md#indicesSMA) | **GET** /v1/indicators/sma/{indicesTicker} | Simple Moving Average (SMA) | +| [**v2AggsTickerIndicesTickerPrevGet()**](IndicesaggregatesApi.md#v2AggsTickerIndicesTickerPrevGet) | **GET** /v2/aggs/ticker/{indicesTicker}/prev | Previous Close | +| [**v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet()**](IndicesaggregatesApi.md#v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet) | **GET** /v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) | + + +## `indicesEMA()` + +```php +indicesEMA($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoEMA200Response +``` + +Exponential Moving Average (EMA) + +Get the exponential moving average (EMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol for which to get exponential moving average (EMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->indicesEMA($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->indicesEMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol for which to get exponential moving average (EMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoEMA200Response**](../Model/CryptoEMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `indicesMACD()` + +```php +indicesMACD($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoMACD200Response +``` + +Moving Average Convergence/Divergence (MACD) + +Get moving average convergence/divergence (MACD) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol for which to get MACD data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$short_window = 12; // int | The short window size used to calculate MACD data. +$long_window = 26; // int | The long window size used to calculate MACD data. +$signal_window = 9; // int | The window size used to calculate the MACD signal line. +$series_type = close; // string | The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->indicesMACD($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->indicesMACD: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol for which to get MACD data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **short_window** | **int**| The short window size used to calculate MACD data. | [optional] [default to 12] | +| **long_window** | **int**| The long window size used to calculate MACD data. | [optional] [default to 26] | +| **signal_window** | **int**| The window size used to calculate the MACD signal line. | [optional] [default to 9] | +| **series_type** | **string**| The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoMACD200Response**](../Model/CryptoMACD200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `indicesRSI()` + +```php +indicesRSI($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoRSI200Response +``` + +Relative Strength Index (RSI) + +Get the relative strength index (RSI) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol for which to get relative strength index (RSI) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 14; // int | The window size used to calculate the relative strength index (RSI). +$series_type = close; // string | The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->indicesRSI($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->indicesRSI: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol for which to get relative strength index (RSI) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the relative strength index (RSI). | [optional] [default to 14] | +| **series_type** | **string**| The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoRSI200Response**](../Model/CryptoRSI200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `indicesSMA()` + +```php +indicesSMA($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoSMA200Response +``` + +Simple Moving Average (SMA) + +Get the simple moving average (SMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol for which to get simple moving average (SMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->indicesSMA($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->indicesSMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol for which to get simple moving average (SMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoSMA200Response**](../Model/CryptoSMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `v2AggsTickerIndicesTickerPrevGet()` + +```php +v2AggsTickerIndicesTickerPrevGet($indices_ticker): \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response +``` + +Previous Close + +Get the previous day's open, high, low, and close (OHLC) for the specified index. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol of Index. + +try { + $result = $apiInstance->v2AggsTickerIndicesTickerPrevGet($indices_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->v2AggsTickerIndicesTickerPrevGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol of Index. | | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response**](../Model/V2AggsTickerIndicesTickerPrevGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet()` + +```php +v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit): \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response +``` + +Aggregates (Bars) + +Get aggregate bars for an index over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicesaggregatesApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol of Index. +$multiplier = 1; // int | The size of the timespan multiplier. +$timespan = day; // string | The size of the time window. +$from = 2023-03-10; // string | The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$to = 2023-03-10; // string | The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$sort = asc; // string | Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). +$limit = 120; // int | Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + +try { + $result = $apiInstance->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicesaggregatesApi->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol of Index. | | +| **multiplier** | **int**| The size of the timespan multiplier. | | +| **timespan** | **string**| The size of the time window. | | +| **from** | **string**| The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **to** | **string**| The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **sort** | **string**| Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). | [optional] | +| **limit** | **int**| Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response**](../Model/V2AggsTickerIndicesTickerPrevGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/IndicessnapshotApi.md b/docs/Api/IndicessnapshotApi.md new file mode 100644 index 0000000..046baa8 --- /dev/null +++ b/docs/Api/IndicessnapshotApi.md @@ -0,0 +1,86 @@ +# OpenAPI\Client\IndicessnapshotApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**indicesSnapshot()**](IndicessnapshotApi.md#indicesSnapshot) | **GET** /v3/snapshot/indices | Indices Snapshot | + + +## `indicesSnapshot()` + +```php +indicesSnapshot($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort): \OpenAPI\Client\Model\IndicesSnapshot200Response +``` + +Indices Snapshot + +Get a Snapshot of indices data for said tickers + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\IndicessnapshotApi( + // 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 +); +$ticker_any_of = I:DJI; // string | Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. +$ticker = 'ticker_example'; // string | Search a range of tickers lexicographically. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 250. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->indicesSnapshot($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IndicessnapshotApi->indicesSnapshot: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker_any_of** | **string**| Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. | [optional] | +| **ticker** | **string**| Search a range of tickers lexicographically. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 250. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\IndicesSnapshot200Response**](../Model/IndicesSnapshot200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/InternalApi.md b/docs/Api/InternalApi.md new file mode 100644 index 0000000..540cd09 --- /dev/null +++ b/docs/Api/InternalApi.md @@ -0,0 +1,90 @@ +# OpenAPI\Client\InternalApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listTickerTaxonomyClassifications()**](InternalApi.md#listTickerTaxonomyClassifications) | **GET** /vX/reference/tickers/taxonomies | Ticker Taxonomies | + + +## `listTickerTaxonomyClassifications()` + +```php +listTickerTaxonomyClassifications($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort): \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response +``` + +Ticker Taxonomies + +Retrieve taxonomy classifications for one or more tickers. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\InternalApi( + // 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 +); +$ticker = 'ticker_example'; // string +$category = 'category_example'; // string | Filter by taxonomy category. +$tag = 'tag_example'; // string | Filter by taxonomy tag. Each category has a set of associated tags. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$ticker_any_of = NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX; // string | Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 250. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listTickerTaxonomyClassifications($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InternalApi->listTickerTaxonomyClassifications: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| | [optional] | +| **category** | **string**| Filter by taxonomy category. | [optional] | +| **tag** | **string**| Filter by taxonomy tag. Each category has a set of associated tags. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **ticker_any_of** | **string**| Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 250. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response**](../Model/ListTickerTaxonomyClassifications200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/OptionsaggregatesApi.md b/docs/Api/OptionsaggregatesApi.md new file mode 100644 index 0000000..c301991 --- /dev/null +++ b/docs/Api/OptionsaggregatesApi.md @@ -0,0 +1,501 @@ +# OpenAPI\Client\OptionsaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**optionsEMA()**](OptionsaggregatesApi.md#optionsEMA) | **GET** /v1/indicators/ema/{optionsTicker} | Exponential Moving Average (EMA) | +| [**optionsMACD()**](OptionsaggregatesApi.md#optionsMACD) | **GET** /v1/indicators/macd/{optionsTicker} | Moving Average Convergence/Divergence (MACD) | +| [**optionsRSI()**](OptionsaggregatesApi.md#optionsRSI) | **GET** /v1/indicators/rsi/{optionsTicker} | Relative Strength Index (RSI) | +| [**optionsSMA()**](OptionsaggregatesApi.md#optionsSMA) | **GET** /v1/indicators/sma/{optionsTicker} | Simple Moving Average (SMA) | +| [**v2AggsTickerOptionsTickerPrevGet()**](OptionsaggregatesApi.md#v2AggsTickerOptionsTickerPrevGet) | **GET** /v2/aggs/ticker/{optionsTicker}/prev | Previous Close | +| [**v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet()**](OptionsaggregatesApi.md#v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet) | **GET** /v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) | + + +## `optionsEMA()` + +```php +optionsEMA($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoEMA200Response +``` + +Exponential Moving Average (EMA) + +Get the exponential moving average (EMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY241220P00720000; // string | The ticker symbol for which to get exponential moving average (EMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->optionsEMA($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->optionsEMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol for which to get exponential moving average (EMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoEMA200Response**](../Model/CryptoEMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `optionsMACD()` + +```php +optionsMACD($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoMACD200Response +``` + +Moving Average Convergence/Divergence (MACD) + +Get moving average convergence/divergence (MACD) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY241220P00720000; // string | The ticker symbol for which to get MACD data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$short_window = 12; // int | The short window size used to calculate MACD data. +$long_window = 26; // int | The long window size used to calculate MACD data. +$signal_window = 9; // int | The window size used to calculate the MACD signal line. +$series_type = close; // string | The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->optionsMACD($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->optionsMACD: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol for which to get MACD data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **short_window** | **int**| The short window size used to calculate MACD data. | [optional] [default to 12] | +| **long_window** | **int**| The long window size used to calculate MACD data. | [optional] [default to 26] | +| **signal_window** | **int**| The window size used to calculate the MACD signal line. | [optional] [default to 9] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoMACD200Response**](../Model/CryptoMACD200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `optionsRSI()` + +```php +optionsRSI($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoRSI200Response +``` + +Relative Strength Index (RSI) + +Get the relative strength index (RSI) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY241220P00720000; // string | The ticker symbol for which to get relative strength index (RSI) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 14; // int | The window size used to calculate the relative strength index (RSI). +$series_type = close; // string | The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->optionsRSI($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->optionsRSI: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol for which to get relative strength index (RSI) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the relative strength index (RSI). | [optional] [default to 14] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoRSI200Response**](../Model/CryptoRSI200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `optionsSMA()` + +```php +optionsSMA($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoSMA200Response +``` + +Simple Moving Average (SMA) + +Get the simple moving average (SMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY241220P00720000; // string | The ticker symbol for which to get simple moving average (SMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->optionsSMA($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->optionsSMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol for which to get simple moving average (SMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoSMA200Response**](../Model/CryptoSMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerOptionsTickerPrevGet()` + +```php +v2AggsTickerOptionsTickerPrevGet($options_ticker, $adjusted): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response +``` + +Previous Close + +Get the previous day's open, high, low, and close (OHLC) for the specified option contract. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY251219C00650000; // string | The ticker symbol of the options contract. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsTickerOptionsTickerPrevGet($options_ticker, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->v2AggsTickerOptionsTickerPrevGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol of the options contract. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet()` + +```php +v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response +``` + +Aggregates (Bars) + +Get aggregate bars for an option contract over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsaggregatesApi( + // 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 +); +$options_ticker = O:SPY251219C00650000; // string | The ticker symbol of the options contract. +$multiplier = 1; // int | The size of the timespan multiplier. +$timespan = day; // string | The size of the time window. +$from = 2023-01-09; // string | The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$to = 2023-01-09; // string | The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. +$sort = asc; // string | Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). +$limit = 120; // int | Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + +try { + $result = $apiInstance->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsaggregatesApi->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol of the options contract. | | +| **multiplier** | **int**| The size of the timespan multiplier. | | +| **timespan** | **string**| The size of the time window. | | +| **from** | **string**| The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **to** | **string**| The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | +| **sort** | **string**| Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). | [optional] | +| **limit** | **int**| Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OptionslasttradeApi.md b/docs/Api/OptionslasttradeApi.md new file mode 100644 index 0000000..b4d0191 --- /dev/null +++ b/docs/Api/OptionslasttradeApi.md @@ -0,0 +1,70 @@ +# OpenAPI\Client\OptionslasttradeApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**lastTradeOptions()**](OptionslasttradeApi.md#lastTradeOptions) | **GET** /v2/last/trade/{optionsTicker} | Last Trade | + + +## `lastTradeOptions()` + +```php +lastTradeOptions($options_ticker): \OpenAPI\Client\Model\LastTradeOptions200Response +``` + +Last Trade + +Get the most recent trade for a given options contract. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionslasttradeApi( + // 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 +); +$options_ticker = O:TSLA210903C00700000; // string | The ticker symbol of the options contract. + +try { + $result = $apiInstance->lastTradeOptions($options_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionslasttradeApi->lastTradeOptions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol of the options contract. | | + +### Return type + +[**\OpenAPI\Client\Model\LastTradeOptions200Response**](../Model/LastTradeOptions200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OptionsopenCloseApi.md b/docs/Api/OptionsopenCloseApi.md new file mode 100644 index 0000000..7d80693 --- /dev/null +++ b/docs/Api/OptionsopenCloseApi.md @@ -0,0 +1,74 @@ +# OpenAPI\Client\OptionsopenCloseApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v1OpenCloseOptionsTickerDateGet()**](OptionsopenCloseApi.md#v1OpenCloseOptionsTickerDateGet) | **GET** /v1/open-close/{optionsTicker}/{date} | Daily Open/Close | + + +## `v1OpenCloseOptionsTickerDateGet()` + +```php +v1OpenCloseOptionsTickerDateGet($options_ticker, $date, $adjusted): \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response +``` + +Daily Open/Close + +Get the open, close and afterhours prices of an options contract on a certain date. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsopenCloseApi( + // 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 +); +$options_ticker = O:SPY251219C00650000; // string | The ticker symbol of the options contract. +$date = 2023-01-09; // \DateTime | The date of the requested open/close in the format YYYY-MM-DD. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v1OpenCloseOptionsTickerDateGet($options_ticker, $date, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsopenCloseApi->v1OpenCloseOptionsTickerDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol of the options contract. | | +| **date** | **\DateTime**| The date of the requested open/close in the format YYYY-MM-DD. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response**](../Model/V1OpenCloseOptionsTickerDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OptionsquotesApi.md b/docs/Api/OptionsquotesApi.md new file mode 100644 index 0000000..0946839 --- /dev/null +++ b/docs/Api/OptionsquotesApi.md @@ -0,0 +1,86 @@ +# OpenAPI\Client\OptionsquotesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**quotesOptions()**](OptionsquotesApi.md#quotesOptions) | **GET** /v3/quotes/{optionsTicker} | Quotes | + + +## `quotesOptions()` + +```php +quotesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\QuotesOptions200Response +``` + +Quotes + +Get quotes for an options ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionsquotesApi( + // 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 +); +$options_ticker = O:SPY241220P00720000; // string | The ticker symbol to get quotes for. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->quotesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionsquotesApi->quotesOptions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The ticker symbol to get quotes for. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\QuotesOptions200Response**](../Model/QuotesOptions200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OptionssnapshotApi.md b/docs/Api/OptionssnapshotApi.md new file mode 100644 index 0000000..444937b --- /dev/null +++ b/docs/Api/OptionssnapshotApi.md @@ -0,0 +1,163 @@ +# OpenAPI\Client\OptionssnapshotApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**optionContract()**](OptionssnapshotApi.md#optionContract) | **GET** /v3/snapshot/options/{underlyingAsset}/{optionContract} | Option Contract | +| [**optionsChain()**](OptionssnapshotApi.md#optionsChain) | **GET** /v3/snapshot/options/{underlyingAsset} | Options Chain | + + +## `optionContract()` + +```php +optionContract($underlying_asset, $option_contract): \OpenAPI\Client\Model\OptionContract200Response +``` + +Option Contract + +Get the snapshot of an option contract for a stock equity. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionssnapshotApi( + // 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 +); +$underlying_asset = EVRI; // string | The underlying ticker symbol of the option contract. +$option_contract = O:EVRI240119C00002500; // string | The option contract identifier. + +try { + $result = $apiInstance->optionContract($underlying_asset, $option_contract); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionssnapshotApi->optionContract: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **underlying_asset** | **string**| The underlying ticker symbol of the option contract. | | +| **option_contract** | **string**| The option contract identifier. | | + +### Return type + +[**\OpenAPI\Client\Model\OptionContract200Response**](../Model/OptionContract200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `optionsChain()` + +```php +optionsChain($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort): \OpenAPI\Client\Model\OptionsChain200Response +``` + +Options Chain + +Get the snapshot of all options contracts for an underlying ticker. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionssnapshotApi( + // 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 +); +$underlying_asset = EVRI; // string | The underlying ticker symbol of the option contract. +$strike_price = 3.4; // float | Query by strike price of a contract. +$expiration_date = 'expiration_date_example'; // string | Query by contract expiration with date format YYYY-MM-DD. +$contract_type = 'contract_type_example'; // string | Query by the type of contract. +$strike_price_gte = 3.4; // float | Range by strike_price. +$strike_price_gt = 3.4; // float | Range by strike_price. +$strike_price_lte = 3.4; // float | Range by strike_price. +$strike_price_lt = 3.4; // float | Range by strike_price. +$expiration_date_gte = 'expiration_date_gte_example'; // string | Range by expiration_date. +$expiration_date_gt = 'expiration_date_gt_example'; // string | Range by expiration_date. +$expiration_date_lte = 'expiration_date_lte_example'; // string | Range by expiration_date. +$expiration_date_lt = 'expiration_date_lt_example'; // string | Range by expiration_date. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 250. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->optionsChain($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionssnapshotApi->optionsChain: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **underlying_asset** | **string**| The underlying ticker symbol of the option contract. | | +| **strike_price** | **float**| Query by strike price of a contract. | [optional] | +| **expiration_date** | **string**| Query by contract expiration with date format YYYY-MM-DD. | [optional] | +| **contract_type** | **string**| Query by the type of contract. | [optional] | +| **strike_price_gte** | **float**| Range by strike_price. | [optional] | +| **strike_price_gt** | **float**| Range by strike_price. | [optional] | +| **strike_price_lte** | **float**| Range by strike_price. | [optional] | +| **strike_price_lt** | **float**| Range by strike_price. | [optional] | +| **expiration_date_gte** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_gt** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_lte** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_lt** | **string**| Range by expiration_date. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 250. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\OptionsChain200Response**](../Model/OptionsChain200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/OptionstradesApi.md b/docs/Api/OptionstradesApi.md new file mode 100644 index 0000000..6573a3c --- /dev/null +++ b/docs/Api/OptionstradesApi.md @@ -0,0 +1,86 @@ +# OpenAPI\Client\OptionstradesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**tradesOptions()**](OptionstradesApi.md#tradesOptions) | **GET** /v3/trades/{optionsTicker} | Trades | + + +## `tradesOptions()` + +```php +tradesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\TradesOptions200Response +``` + +Trades + +Get trades for an options ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\OptionstradesApi( + // 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 +); +$options_ticker = O:TSLA210903C00700000; // string | The options ticker symbol to get trades for. +$timestamp = 'timestamp_example'; // string | Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->tradesOptions($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OptionstradesApi->tradesOptions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| The options ticker symbol to get trades for. | | +| **timestamp** | **string**| Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\TradesOptions200Response**](../Model/TradesOptions200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PublicApi.md b/docs/Api/PublicApi.md new file mode 100644 index 0000000..c520f4a --- /dev/null +++ b/docs/Api/PublicApi.md @@ -0,0 +1,90 @@ +# OpenAPI\Client\PublicApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listTickerTaxonomyClassifications()**](PublicApi.md#listTickerTaxonomyClassifications) | **GET** /vX/reference/tickers/taxonomies | Ticker Taxonomies | + + +## `listTickerTaxonomyClassifications()` + +```php +listTickerTaxonomyClassifications($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort): \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response +``` + +Ticker Taxonomies + +Retrieve taxonomy classifications for one or more tickers. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\PublicApi( + // 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 +); +$ticker = 'ticker_example'; // string +$category = 'category_example'; // string | Filter by taxonomy category. +$tag = 'tag_example'; // string | Filter by taxonomy tag. Each category has a set of associated tags. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$ticker_any_of = NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX; // string | Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 250. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listTickerTaxonomyClassifications($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PublicApi->listTickerTaxonomyClassifications: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| | [optional] | +| **category** | **string**| Filter by taxonomy category. | [optional] | +| **tag** | **string**| Filter by taxonomy tag. Each category has a set of associated tags. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **ticker_any_of** | **string**| Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 250. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response**](../Model/ListTickerTaxonomyClassifications200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferenceconditionsApi.md b/docs/Api/ReferenceconditionsApi.md new file mode 100644 index 0000000..75f757f --- /dev/null +++ b/docs/Api/ReferenceconditionsApi.md @@ -0,0 +1,82 @@ +# OpenAPI\Client\ReferenceconditionsApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listConditions()**](ReferenceconditionsApi.md#listConditions) | **GET** /v3/reference/conditions | Conditions | + + +## `listConditions()` + +```php +listConditions($asset_class, $data_type, $id, $sip, $order, $limit, $sort): \OpenAPI\Client\Model\ListConditions200Response +``` + +Conditions + +List all conditions that Polygon.io uses. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferenceconditionsApi( + // 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 +); +$asset_class = stocks; // string | Filter for conditions within a given asset class. +$data_type = trade; // string | Filter by data type. +$id = 1; // int | Filter for conditions with a given ID. +$sip = CTA; // string | Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = asset_class; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listConditions($asset_class, $data_type, $id, $sip, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferenceconditionsApi->listConditions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **asset_class** | **string**| Filter for conditions within a given asset class. | [optional] | +| **data_type** | **string**| Filter by data type. | [optional] | +| **id** | **int**| Filter for conditions with a given ID. | [optional] | +| **sip** | **string**| Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'asset_class'] | + +### Return type + +[**\OpenAPI\Client\Model\ListConditions200Response**](../Model/ListConditions200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencedividendsApi.md b/docs/Api/ReferencedividendsApi.md new file mode 100644 index 0000000..4e7ed87 --- /dev/null +++ b/docs/Api/ReferencedividendsApi.md @@ -0,0 +1,138 @@ +# OpenAPI\Client\ReferencedividendsApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listDividends()**](ReferencedividendsApi.md#listDividends) | **GET** /v3/reference/dividends | Dividends v3 | + + +## `listDividends()` + +```php +listDividends($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListDividends200Response +``` + +Dividends v3 + +Get a list of historical cash dividends, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencedividendsApi( + // 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 +); +$ticker = 'ticker_example'; // string | Return the dividends that contain this ticker. +$ex_dividend_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by ex-dividend date with the format YYYY-MM-DD. +$record_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by record date with the format YYYY-MM-DD. +$declaration_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by declaration date with the format YYYY-MM-DD. +$pay_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by pay date with the format YYYY-MM-DD. +$frequency = 56; // int | Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). +$cash_amount = 3.4; // float | Query by the cash amount of the dividend. +$dividend_type = 'dividend_type_example'; // string | Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$ex_dividend_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by ex_dividend_date. +$ex_dividend_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by ex_dividend_date. +$ex_dividend_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by ex_dividend_date. +$ex_dividend_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by ex_dividend_date. +$record_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by record_date. +$record_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by record_date. +$record_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by record_date. +$record_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by record_date. +$declaration_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by declaration_date. +$declaration_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by declaration_date. +$declaration_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by declaration_date. +$declaration_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by declaration_date. +$pay_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by pay_date. +$pay_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by pay_date. +$pay_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by pay_date. +$pay_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Range by pay_date. +$cash_amount_gte = 3.4; // float | Range by cash_amount. +$cash_amount_gt = 3.4; // float | Range by cash_amount. +$cash_amount_lte = 3.4; // float | Range by cash_amount. +$cash_amount_lt = 3.4; // float | Range by cash_amount. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = ex_dividend_date; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listDividends($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencedividendsApi->listDividends: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Return the dividends that contain this ticker. | [optional] | +| **ex_dividend_date** | **\DateTime**| Query by ex-dividend date with the format YYYY-MM-DD. | [optional] | +| **record_date** | **\DateTime**| Query by record date with the format YYYY-MM-DD. | [optional] | +| **declaration_date** | **\DateTime**| Query by declaration date with the format YYYY-MM-DD. | [optional] | +| **pay_date** | **\DateTime**| Query by pay date with the format YYYY-MM-DD. | [optional] | +| **frequency** | **int**| Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). | [optional] | +| **cash_amount** | **float**| Query by the cash amount of the dividend. | [optional] | +| **dividend_type** | **string**| Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **ex_dividend_date_gte** | **\DateTime**| Range by ex_dividend_date. | [optional] | +| **ex_dividend_date_gt** | **\DateTime**| Range by ex_dividend_date. | [optional] | +| **ex_dividend_date_lte** | **\DateTime**| Range by ex_dividend_date. | [optional] | +| **ex_dividend_date_lt** | **\DateTime**| Range by ex_dividend_date. | [optional] | +| **record_date_gte** | **\DateTime**| Range by record_date. | [optional] | +| **record_date_gt** | **\DateTime**| Range by record_date. | [optional] | +| **record_date_lte** | **\DateTime**| Range by record_date. | [optional] | +| **record_date_lt** | **\DateTime**| Range by record_date. | [optional] | +| **declaration_date_gte** | **\DateTime**| Range by declaration_date. | [optional] | +| **declaration_date_gt** | **\DateTime**| Range by declaration_date. | [optional] | +| **declaration_date_lte** | **\DateTime**| Range by declaration_date. | [optional] | +| **declaration_date_lt** | **\DateTime**| Range by declaration_date. | [optional] | +| **pay_date_gte** | **\DateTime**| Range by pay_date. | [optional] | +| **pay_date_gt** | **\DateTime**| Range by pay_date. | [optional] | +| **pay_date_lte** | **\DateTime**| Range by pay_date. | [optional] | +| **pay_date_lt** | **\DateTime**| Range by pay_date. | [optional] | +| **cash_amount_gte** | **float**| Range by cash_amount. | [optional] | +| **cash_amount_gt** | **float**| Range by cash_amount. | [optional] | +| **cash_amount_lte** | **float**| Range by cash_amount. | [optional] | +| **cash_amount_lt** | **float**| Range by cash_amount. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ex_dividend_date'] | + +### Return type + +[**\OpenAPI\Client\Model\ListDividends200Response**](../Model/ListDividends200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferenceexchangesApi.md b/docs/Api/ReferenceexchangesApi.md new file mode 100644 index 0000000..bf8035a --- /dev/null +++ b/docs/Api/ReferenceexchangesApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\ReferenceexchangesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listExchanges()**](ReferenceexchangesApi.md#listExchanges) | **GET** /v3/reference/exchanges | Exchanges | + + +## `listExchanges()` + +```php +listExchanges($asset_class, $locale): \OpenAPI\Client\Model\ListExchanges200Response +``` + +Exchanges + +List all exchanges that Polygon.io knows about. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferenceexchangesApi( + // 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 +); +$asset_class = stocks; // string | Filter by asset class. +$locale = us; // string | Filter by locale. + +try { + $result = $apiInstance->listExchanges($asset_class, $locale); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferenceexchangesApi->listExchanges: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **asset_class** | **string**| Filter by asset class. | [optional] | +| **locale** | **string**| Filter by locale. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\ListExchanges200Response**](../Model/ListExchanges200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencenewsApi.md b/docs/Api/ReferencenewsApi.md new file mode 100644 index 0000000..bc46173 --- /dev/null +++ b/docs/Api/ReferencenewsApi.md @@ -0,0 +1,94 @@ +# OpenAPI\Client\ReferencenewsApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listNews()**](ReferencenewsApi.md#listNews) | **GET** /v2/reference/news | Ticker News | + + +## `listNews()` + +```php +listNews($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListNews200Response +``` + +Ticker News + +Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencenewsApi( + // 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 +); +$ticker = 'ticker_example'; // string | Return results that contain this ticker. +$published_utc = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Return results published on, before, or after this date. +$ticker_gte = 'ticker_gte_example'; // string | Search by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Search by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Search by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Search by ticker. +$published_utc_gte = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc. +$published_utc_gt = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc. +$published_utc_lte = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc. +$published_utc_lt = new \OpenAPI\Client\Model\ListNewsPublishedUtcParameter(); // ListNewsPublishedUtcParameter | Search by published_utc. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = published_utc; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listNews($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencenewsApi->listNews: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Return results that contain this ticker. | [optional] | +| **published_utc** | [**ListNewsPublishedUtcParameter**](../Model/.md)| Return results published on, before, or after this date. | [optional] | +| **ticker_gte** | **string**| Search by ticker. | [optional] | +| **ticker_gt** | **string**| Search by ticker. | [optional] | +| **ticker_lte** | **string**| Search by ticker. | [optional] | +| **ticker_lt** | **string**| Search by ticker. | [optional] | +| **published_utc_gte** | [**ListNewsPublishedUtcParameter**](../Model/.md)| Search by published_utc. | [optional] | +| **published_utc_gt** | [**ListNewsPublishedUtcParameter**](../Model/.md)| Search by published_utc. | [optional] | +| **published_utc_lte** | [**ListNewsPublishedUtcParameter**](../Model/.md)| Search by published_utc. | [optional] | +| **published_utc_lt** | [**ListNewsPublishedUtcParameter**](../Model/.md)| Search by published_utc. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'published_utc'] | + +### Return type + +[**\OpenAPI\Client\Model\ListNews200Response**](../Model/ListNews200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferenceoptionscontractApi.md b/docs/Api/ReferenceoptionscontractApi.md new file mode 100644 index 0000000..dccbef2 --- /dev/null +++ b/docs/Api/ReferenceoptionscontractApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\ReferenceoptionscontractApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getOptionsContract()**](ReferenceoptionscontractApi.md#getOptionsContract) | **GET** /v3/reference/options/contracts/{options_ticker} | Options Contract | + + +## `getOptionsContract()` + +```php +getOptionsContract($options_ticker, $as_of): \OpenAPI\Client\Model\GetOptionsContract200Response +``` + +Options Contract + +Get an options contract + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferenceoptionscontractApi( + // 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 +); +$options_ticker = O:EVRI240119C00002500; // string | Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). +$as_of = 'as_of_example'; // string | Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. + +try { + $result = $apiInstance->getOptionsContract($options_ticker, $as_of); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferenceoptionscontractApi->getOptionsContract: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **options_ticker** | **string**| Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). | | +| **as_of** | **string**| Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\GetOptionsContract200Response**](../Model/GetOptionsContract200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferenceoptionscontractslistApi.md b/docs/Api/ReferenceoptionscontractslistApi.md new file mode 100644 index 0000000..0ded143 --- /dev/null +++ b/docs/Api/ReferenceoptionscontractslistApi.md @@ -0,0 +1,112 @@ +# OpenAPI\Client\ReferenceoptionscontractslistApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listOptionsContracts()**](ReferenceoptionscontractslistApi.md#listOptionsContracts) | **GET** /v3/reference/options/contracts | Options Contracts | + + +## `listOptionsContracts()` + +```php +listOptionsContracts($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListOptionsContracts200Response +``` + +Options Contracts + +Query for historical options contracts. This provides both active and expired options contracts. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferenceoptionscontractslistApi( + // 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 +); +$ticker = 'ticker_example'; // string | This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). +$underlying_ticker = 'underlying_ticker_example'; // string | Query for contracts relating to an underlying stock ticker. +$contract_type = 'contract_type_example'; // string | Query by the type of contract. +$expiration_date = 'expiration_date_example'; // string | Query by contract expiration with date format YYYY-MM-DD. +$as_of = 'as_of_example'; // string | Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. +$strike_price = 3.4; // float | Query by strike price of a contract. +$expired = True; // bool | Query for expired contracts. Default is false. +$underlying_ticker_gte = 'underlying_ticker_gte_example'; // string | Range by underlying_ticker. +$underlying_ticker_gt = 'underlying_ticker_gt_example'; // string | Range by underlying_ticker. +$underlying_ticker_lte = 'underlying_ticker_lte_example'; // string | Range by underlying_ticker. +$underlying_ticker_lt = 'underlying_ticker_lt_example'; // string | Range by underlying_ticker. +$expiration_date_gte = 'expiration_date_gte_example'; // string | Range by expiration_date. +$expiration_date_gt = 'expiration_date_gt_example'; // string | Range by expiration_date. +$expiration_date_lte = 'expiration_date_lte_example'; // string | Range by expiration_date. +$expiration_date_lt = 'expiration_date_lt_example'; // string | Range by expiration_date. +$strike_price_gte = 3.4; // float | Range by strike_price. +$strike_price_gt = 3.4; // float | Range by strike_price. +$strike_price_lte = 3.4; // float | Range by strike_price. +$strike_price_lt = 3.4; // float | Range by strike_price. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listOptionsContracts($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferenceoptionscontractslistApi->listOptionsContracts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). | [optional] | +| **underlying_ticker** | **string**| Query for contracts relating to an underlying stock ticker. | [optional] | +| **contract_type** | **string**| Query by the type of contract. | [optional] | +| **expiration_date** | **string**| Query by contract expiration with date format YYYY-MM-DD. | [optional] | +| **as_of** | **string**| Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. | [optional] | +| **strike_price** | **float**| Query by strike price of a contract. | [optional] | +| **expired** | **bool**| Query for expired contracts. Default is false. | [optional] | +| **underlying_ticker_gte** | **string**| Range by underlying_ticker. | [optional] | +| **underlying_ticker_gt** | **string**| Range by underlying_ticker. | [optional] | +| **underlying_ticker_lte** | **string**| Range by underlying_ticker. | [optional] | +| **underlying_ticker_lt** | **string**| Range by underlying_ticker. | [optional] | +| **expiration_date_gte** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_gt** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_lte** | **string**| Range by expiration_date. | [optional] | +| **expiration_date_lt** | **string**| Range by expiration_date. | [optional] | +| **strike_price_gte** | **float**| Range by strike_price. | [optional] | +| **strike_price_gt** | **float**| Range by strike_price. | [optional] | +| **strike_price_lte** | **float**| Range by strike_price. | [optional] | +| **strike_price_lt** | **float**| Range by strike_price. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\ListOptionsContracts200Response**](../Model/ListOptionsContracts200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencesecfilingApi.md b/docs/Api/ReferencesecfilingApi.md new file mode 100644 index 0000000..f1db09c --- /dev/null +++ b/docs/Api/ReferencesecfilingApi.md @@ -0,0 +1,70 @@ +# OpenAPI\Client\ReferencesecfilingApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getFiling()**](ReferencesecfilingApi.md#getFiling) | **GET** /v1/reference/sec/filings/{filing_id} | SEC Filing | + + +## `getFiling()` + +```php +getFiling($filing_id): \OpenAPI\Client\Model\ListFilings200ResponseResultsInner +``` + +SEC Filing + +Get filing + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencesecfilingApi( + // 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 +); +$filing_id = 'filing_id_example'; // string | Select by filing id. + +try { + $result = $apiInstance->getFiling($filing_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencesecfilingApi->getFiling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **filing_id** | **string**| Select by filing id. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\ListFilings200ResponseResultsInner**](../Model/ListFilings200ResponseResultsInner.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferencesecfilingfileApi.md b/docs/Api/ReferencesecfilingfileApi.md new file mode 100644 index 0000000..40d010c --- /dev/null +++ b/docs/Api/ReferencesecfilingfileApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\ReferencesecfilingfileApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getFilingFile()**](ReferencesecfilingfileApi.md#getFilingFile) | **GET** /v1/reference/sec/filings/{filing_id}/files/{file_id} | SEC Filing File | + + +## `getFilingFile()` + +```php +getFilingFile($filing_id, $file_id): \OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner +``` + +SEC Filing File + +Get filing file + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencesecfilingfileApi( + // 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 +); +$filing_id = 'filing_id_example'; // string | Select by filing id. +$file_id = 1; // string | Select by file id. + +try { + $result = $apiInstance->getFilingFile($filing_id, $file_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencesecfilingfileApi->getFilingFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **filing_id** | **string**| Select by filing id. | [optional] | +| **file_id** | **string**| Select by file id. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner**](../Model/ListFilingFiles200ResponseResultsInner.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferencesecfilingfilesApi.md b/docs/Api/ReferencesecfilingfilesApi.md new file mode 100644 index 0000000..70562ec --- /dev/null +++ b/docs/Api/ReferencesecfilingfilesApi.md @@ -0,0 +1,96 @@ +# OpenAPI\Client\ReferencesecfilingfilesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listFilingFiles()**](ReferencesecfilingfilesApi.md#listFilingFiles) | **GET** /v1/reference/sec/filings/{filing_id}/files | SEC Filing Files | + + +## `listFilingFiles()` + +```php +listFilingFiles($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListFilingFiles200Response +``` + +SEC Filing Files + +List filing files + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencesecfilingfilesApi( + // 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 +); +$filing_id = 'filing_id_example'; // string | Select by filing id. +$sequence = 56; // int | Query by file sequence number. +$filename = 'filename_example'; // string | Query by file name. +$sequence_gte = 56; // int | Search by sequence. +$sequence_gt = 56; // int | Search by sequence. +$sequence_lte = 56; // int | Search by sequence. +$sequence_lt = 56; // int | Search by sequence. +$filename_gte = 'filename_gte_example'; // string | Search by filename. +$filename_gt = 'filename_gt_example'; // string | Search by filename. +$filename_lte = 'filename_lte_example'; // string | Search by filename. +$filename_lt = 'filename_lt_example'; // string | Search by filename. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = sequence; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listFilingFiles($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencesecfilingfilesApi->listFilingFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **filing_id** | **string**| Select by filing id. | [optional] | +| **sequence** | **int**| Query by file sequence number. | [optional] | +| **filename** | **string**| Query by file name. | [optional] | +| **sequence_gte** | **int**| Search by sequence. | [optional] | +| **sequence_gt** | **int**| Search by sequence. | [optional] | +| **sequence_lte** | **int**| Search by sequence. | [optional] | +| **sequence_lt** | **int**| Search by sequence. | [optional] | +| **filename_gte** | **string**| Search by filename. | [optional] | +| **filename_gt** | **string**| Search by filename. | [optional] | +| **filename_lte** | **string**| Search by filename. | [optional] | +| **filename_lt** | **string**| Search by filename. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'sequence'] | + +### Return type + +[**\OpenAPI\Client\Model\ListFilingFiles200Response**](../Model/ListFilingFiles200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferencesecfilingsApi.md b/docs/Api/ReferencesecfilingsApi.md new file mode 100644 index 0000000..67d9fd7 --- /dev/null +++ b/docs/Api/ReferencesecfilingsApi.md @@ -0,0 +1,108 @@ +# OpenAPI\Client\ReferencesecfilingsApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listFilings()**](ReferencesecfilingsApi.md#listFilings) | **GET** /v1/reference/sec/filings | SEC Filings | + + +## `listFilings()` + +```php +listFilings($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort): \OpenAPI\Client\Model\ListFilings200Response +``` + +SEC Filings + +List filings + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencesecfilingsApi( + // 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 +); +$type = 'type_example'; // string | Query by filing type. +$filing_date = 20210101; // string | Query by filing date. +$period_of_report_date = 20210101; // string | Query by period of report. +$has_xbrl = True; // bool | If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. +$entities_company_data_name = Facebook Inc; // string | Query by entity company name. +$entities_company_data_cik = 'entities_company_data_cik_example'; // string | Query by entity company CIK. +$entities_company_data_ticker = 'entities_company_data_ticker_example'; // string | Query by entity company ticker. +$entities_company_data_sic = 'entities_company_data_sic_example'; // string | Query by entity company SIC. +$filing_date_gte = 20210101; // string | Search by filing_date. +$filing_date_gt = 20210101; // string | Search by filing_date. +$filing_date_lte = 20210101; // string | Search by filing_date. +$filing_date_lt = 20210101; // string | Search by filing_date. +$period_of_report_date_gte = 20210101; // string | Search by period_of_report_date. +$period_of_report_date_gt = 20210101; // string | Search by period_of_report_date. +$period_of_report_date_lte = 20210101; // string | Search by period_of_report_date. +$period_of_report_date_lt = 20210101; // string | Search by period_of_report_date. +$entities_company_data_name_search = 'entities_company_data_name_search_example'; // string | Search by entities.company_data.name. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = filing_date; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listFilings($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencesecfilingsApi->listFilings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **type** | **string**| Query by filing type. | [optional] | +| **filing_date** | **string**| Query by filing date. | [optional] | +| **period_of_report_date** | **string**| Query by period of report. | [optional] | +| **has_xbrl** | **bool**| If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. | [optional] | +| **entities_company_data_name** | **string**| Query by entity company name. | [optional] | +| **entities_company_data_cik** | **string**| Query by entity company CIK. | [optional] | +| **entities_company_data_ticker** | **string**| Query by entity company ticker. | [optional] | +| **entities_company_data_sic** | **string**| Query by entity company SIC. | [optional] | +| **filing_date_gte** | **string**| Search by filing_date. | [optional] | +| **filing_date_gt** | **string**| Search by filing_date. | [optional] | +| **filing_date_lte** | **string**| Search by filing_date. | [optional] | +| **filing_date_lt** | **string**| Search by filing_date. | [optional] | +| **period_of_report_date_gte** | **string**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_gt** | **string**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_lte** | **string**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_lt** | **string**| Search by period_of_report_date. | [optional] | +| **entities_company_data_name_search** | **string**| Search by entities.company_data.name. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'filing_date'] | + +### Return type + +[**\OpenAPI\Client\Model\ListFilings200Response**](../Model/ListFilings200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferencestocksApi.md b/docs/Api/ReferencestocksApi.md new file mode 100644 index 0000000..3efbc35 --- /dev/null +++ b/docs/Api/ReferencestocksApi.md @@ -0,0 +1,197 @@ +# OpenAPI\Client\ReferencestocksApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listFinancials()**](ReferencestocksApi.md#listFinancials) | **GET** /vX/reference/financials | Stock Financials vX | +| [**listStockSplits()**](ReferencestocksApi.md#listStockSplits) | **GET** /v3/reference/splits | Stock Splits v3 | + + +## `listFinancials()` + +```php +listFinancials($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListFinancials200Response +``` + +Stock Financials vX + +Get historical financial data for a stock ticker. The financials data is extracted from XBRL from company SEC filings using the methodology outlined here. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencestocksApi( + // 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 +); +$ticker = 'ticker_example'; // string | Query by company ticker. +$cik = 'cik_example'; // string | Query by central index key (CIK) Number +$company_name = 'company_name_example'; // string | Query by company name. +$sic = 'sic_example'; // string | Query by standard industrial classification (SIC) +$filing_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 +$period_of_report_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The period of report for the filing with financials data in YYYY-MM-DD format. +$timeframe = 'timeframe_example'; // string | Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 +$include_sources = false; // bool | Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. +$company_name_search = 'company_name_search_example'; // string | Search by company_name. +$filing_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by filing_date. +$filing_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by filing_date. +$filing_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by filing_date. +$filing_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by filing_date. +$period_of_report_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by period_of_report_date. +$period_of_report_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by period_of_report_date. +$period_of_report_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by period_of_report_date. +$period_of_report_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by period_of_report_date. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 100. +$sort = filing_date; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listFinancials($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencestocksApi->listFinancials: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Query by company ticker. | [optional] | +| **cik** | **string**| Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number | [optional] | +| **company_name** | **string**| Query by company name. | [optional] | +| **sic** | **string**| Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) | [optional] | +| **filing_date** | **\DateTime**| Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 | [optional] | +| **period_of_report_date** | **\DateTime**| The period of report for the filing with financials data in YYYY-MM-DD format. | [optional] | +| **timeframe** | **string**| Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 | [optional] | +| **include_sources** | **bool**| Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. | [optional] [default to false] | +| **company_name_search** | **string**| Search by company_name. | [optional] | +| **filing_date_gte** | **\DateTime**| Search by filing_date. | [optional] | +| **filing_date_gt** | **\DateTime**| Search by filing_date. | [optional] | +| **filing_date_lte** | **\DateTime**| Search by filing_date. | [optional] | +| **filing_date_lt** | **\DateTime**| Search by filing_date. | [optional] | +| **period_of_report_date_gte** | **\DateTime**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_gt** | **\DateTime**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_lte** | **\DateTime**| Search by period_of_report_date. | [optional] | +| **period_of_report_date_lt** | **\DateTime**| Search by period_of_report_date. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 100. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'period_of_report_date'] | + +### Return type + +[**\OpenAPI\Client\Model\ListFinancials200Response**](../Model/ListFinancials200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `listStockSplits()` + +```php +listStockSplits($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListStockSplits200Response +``` + +Stock Splits v3 + +Get a list of historical stock splits, including the ticker symbol, the execution date, and the factors of the split ratio. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencestocksApi( + // 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 +); +$ticker = 'ticker_example'; // string | Return the stock splits that contain this ticker. +$execution_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Query by execution date with the format YYYY-MM-DD. +$reverse_split = True; // bool | Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. +$ticker_gte = 'ticker_gte_example'; // string | Search by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Search by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Search by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Search by ticker. +$execution_date_gte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by execution_date. +$execution_date_gt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by execution_date. +$execution_date_lte = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by execution_date. +$execution_date_lt = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Search by execution_date. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 1000. +$sort = execution_date; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listStockSplits($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencestocksApi->listStockSplits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Return the stock splits that contain this ticker. | [optional] | +| **execution_date** | **\DateTime**| Query by execution date with the format YYYY-MM-DD. | [optional] | +| **reverse_split** | **bool**| Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. | [optional] | +| **ticker_gte** | **string**| Search by ticker. | [optional] | +| **ticker_gt** | **string**| Search by ticker. | [optional] | +| **ticker_lte** | **string**| Search by ticker. | [optional] | +| **ticker_lt** | **string**| Search by ticker. | [optional] | +| **execution_date_gte** | **\DateTime**| Search by execution_date. | [optional] | +| **execution_date_gt** | **\DateTime**| Search by execution_date. | [optional] | +| **execution_date_lte** | **\DateTime**| Search by execution_date. | [optional] | +| **execution_date_lt** | **\DateTime**| Search by execution_date. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 1000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'execution_date'] | + +### Return type + +[**\OpenAPI\Client\Model\ListStockSplits200Response**](../Model/ListStockSplits200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencestocksmarketApi.md b/docs/Api/ReferencestocksmarketApi.md new file mode 100644 index 0000000..2339541 --- /dev/null +++ b/docs/Api/ReferencestocksmarketApi.md @@ -0,0 +1,127 @@ +# OpenAPI\Client\ReferencestocksmarketApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getMarketHolidays()**](ReferencestocksmarketApi.md#getMarketHolidays) | **GET** /v1/marketstatus/upcoming | Market Holidays | +| [**getMarketStatus()**](ReferencestocksmarketApi.md#getMarketStatus) | **GET** /v1/marketstatus/now | Market Status | + + +## `getMarketHolidays()` + +```php +getMarketHolidays(): \OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[] +``` + +Market Holidays + +Get upcoming market holidays and their open/close times. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencestocksmarketApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getMarketHolidays(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencestocksmarketApi->getMarketHolidays: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]**](../Model/GetMarketHolidays200ResponseInner.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `getMarketStatus()` + +```php +getMarketStatus(): \OpenAPI\Client\Model\GetMarketStatus200Response +``` + +Market Status + +Get the current trading status of the exchanges and overall financial markets. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencestocksmarketApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getMarketStatus(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencestocksmarketApi->getMarketStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OpenAPI\Client\Model\GetMarketStatus200Response**](../Model/GetMarketStatus200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/ReferencetickersgetApi.md b/docs/Api/ReferencetickersgetApi.md new file mode 100644 index 0000000..4855a4e --- /dev/null +++ b/docs/Api/ReferencetickersgetApi.md @@ -0,0 +1,137 @@ +# OpenAPI\Client\ReferencetickersgetApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getEvents()**](ReferencetickersgetApi.md#getEvents) | **GET** /vX/reference/tickers/{id}/events | Ticker Events | +| [**getTicker()**](ReferencetickersgetApi.md#getTicker) | **GET** /v3/reference/tickers/{ticker} | Ticker Details v3 | + + +## `getEvents()` + +```php +getEvents($id, $types): \OpenAPI\Client\Model\GetEvents200Response +``` + +Ticker Events + +Get a timeline of events for the entity associated with the given ticker, CUSIP, or Composite FIGI. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencetickersgetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = META; // string | Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) +$types = 'types_example'; // string | A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. + +try { + $result = $apiInstance->getEvents($id, $types); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencetickersgetApi->getEvents: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) | | +| **types** | **string**| A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\GetEvents200Response**](../Model/GetEvents200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) + +## `getTicker()` + +```php +getTicker($ticker, $date): \OpenAPI\Client\Model\GetTicker200Response +``` + +Ticker Details v3 + +Get a single ticker supported by Polygon.io. This response will have detailed information about the ticker and the company behind it. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencetickersgetApi( + // 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 +); +$ticker = AAPL; // string | The ticker symbol of the asset. +$date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. + +try { + $result = $apiInstance->getTicker($ticker, $date); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencetickersgetApi->getTicker: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| The ticker symbol of the asset. | | +| **date** | **\DateTime**| Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\GetTicker200Response**](../Model/GetTicker200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencetickerslistApi.md b/docs/Api/ReferencetickerslistApi.md new file mode 100644 index 0000000..9126470 --- /dev/null +++ b/docs/Api/ReferencetickerslistApi.md @@ -0,0 +1,100 @@ +# OpenAPI\Client\ReferencetickerslistApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listTickers()**](ReferencetickerslistApi.md#listTickers) | **GET** /v3/reference/tickers | Tickers | + + +## `listTickers()` + +```php +listTickers($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort): \OpenAPI\Client\Model\ListTickers200Response +``` + +Tickers + +Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Indices, Forex, and Crypto. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencetickerslistApi( + // 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 +); +$ticker = 'ticker_example'; // string | Specify a ticker symbol. Defaults to empty string which queries all tickers. +$type = 'type_example'; // string | Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. +$market = 'market_example'; // string | Filter by market type. By default all markets are included. +$exchange = 'exchange_example'; // string | Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. +$cusip = 'cusip_example'; // string | Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. +$cik = 'cik_example'; // string | Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. +$date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. +$search = 'search_example'; // string | Search for terms within the ticker and/or company name. +$active = true; // bool | Specify if the tickers returned should be actively traded on the queried date. Default is true. +$ticker_gte = 'ticker_gte_example'; // string | Range by ticker. +$ticker_gt = 'ticker_gt_example'; // string | Range by ticker. +$ticker_lte = 'ticker_lte_example'; // string | Range by ticker. +$ticker_lt = 'ticker_lt_example'; // string | Range by ticker. +$order = asc; // string | Order results based on the `sort` field. +$limit = 100; // int | Limit the number of results returned, default is 100 and max is 1000. +$sort = ticker; // string | Sort field used for ordering. + +try { + $result = $apiInstance->listTickers($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencetickerslistApi->listTickers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| Specify a ticker symbol. Defaults to empty string which queries all tickers. | [optional] | +| **type** | **string**| Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. | [optional] | +| **market** | **string**| Filter by market type. By default all markets are included. | [optional] | +| **exchange** | **string**| Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. | [optional] | +| **cusip** | **string**| Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. | [optional] | +| **cik** | **string**| Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. | [optional] | +| **date** | **\DateTime**| Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. | [optional] | +| **search** | **string**| Search for terms within the ticker and/or company name. | [optional] | +| **active** | **bool**| Specify if the tickers returned should be actively traded on the queried date. Default is true. | [optional] | +| **ticker_gte** | **string**| Range by ticker. | [optional] | +| **ticker_gt** | **string**| Range by ticker. | [optional] | +| **ticker_lte** | **string**| Range by ticker. | [optional] | +| **ticker_lt** | **string**| Range by ticker. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] | +| **limit** | **int**| Limit the number of results returned, default is 100 and max is 1000. | [optional] [default to 100] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'ticker'] | + +### Return type + +[**\OpenAPI\Client\Model\ListTickers200Response**](../Model/ListTickers200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReferencetickerstypesApi.md b/docs/Api/ReferencetickerstypesApi.md new file mode 100644 index 0000000..e457ab1 --- /dev/null +++ b/docs/Api/ReferencetickerstypesApi.md @@ -0,0 +1,72 @@ +# OpenAPI\Client\ReferencetickerstypesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**listTickerTypes()**](ReferencetickerstypesApi.md#listTickerTypes) | **GET** /v3/reference/tickers/types | Ticker Types | + + +## `listTickerTypes()` + +```php +listTickerTypes($asset_class, $locale): \OpenAPI\Client\Model\ListTickerTypes200Response +``` + +Ticker Types + +List all ticker types that Polygon.io has. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\ReferencetickerstypesApi( + // 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 +); +$asset_class = stocks; // string | Filter by asset class. +$locale = us; // string | Filter by locale. + +try { + $result = $apiInstance->listTickerTypes($asset_class, $locale); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReferencetickerstypesApi->listTickerTypes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **asset_class** | **string**| Filter by asset class. | [optional] | +| **locale** | **string**| Filter by locale. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\ListTickerTypes200Response**](../Model/ListTickerTypes200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StocksaggregatesApi.md b/docs/Api/StocksaggregatesApi.md new file mode 100644 index 0000000..a24e3ca --- /dev/null +++ b/docs/Api/StocksaggregatesApi.md @@ -0,0 +1,568 @@ +# OpenAPI\Client\StocksaggregatesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**eMA()**](StocksaggregatesApi.md#eMA) | **GET** /v1/indicators/ema/{stockTicker} | Exponential Moving Average (EMA) | +| [**mACD()**](StocksaggregatesApi.md#mACD) | **GET** /v1/indicators/macd/{stockTicker} | Moving Average Convergence/Divergence (MACD) | +| [**rSI()**](StocksaggregatesApi.md#rSI) | **GET** /v1/indicators/rsi/{stockTicker} | Relative Strength Index (RSI) | +| [**sMA()**](StocksaggregatesApi.md#sMA) | **GET** /v1/indicators/sma/{stockTicker} | Simple Moving Average (SMA) | +| [**v2AggsGroupedLocaleUsMarketStocksDateGet()**](StocksaggregatesApi.md#v2AggsGroupedLocaleUsMarketStocksDateGet) | **GET** /v2/aggs/grouped/locale/us/market/stocks/{date} | Grouped Daily (Bars) | +| [**v2AggsTickerStocksTickerPrevGet()**](StocksaggregatesApi.md#v2AggsTickerStocksTickerPrevGet) | **GET** /v2/aggs/ticker/{stocksTicker}/prev | Previous Close | +| [**v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet()**](StocksaggregatesApi.md#v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet) | **GET** /v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to} | Aggregates (Bars) | + + +## `eMA()` + +```php +eMA($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoEMA200Response +``` + +Exponential Moving Average (EMA) + +Get the exponential moving average (EMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol for which to get exponential moving average (EMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->eMA($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->eMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol for which to get exponential moving average (EMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoEMA200Response**](../Model/CryptoEMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `mACD()` + +```php +mACD($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoMACD200Response +``` + +Moving Average Convergence/Divergence (MACD) + +Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol for which to get MACD data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$short_window = 12; // int | The short window size used to calculate MACD data. +$long_window = 26; // int | The long window size used to calculate MACD data. +$signal_window = 9; // int | The window size used to calculate the MACD signal line. +$series_type = close; // string | The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->mACD($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->mACD: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol for which to get MACD data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **short_window** | **int**| The short window size used to calculate MACD data. | [optional] [default to 12] | +| **long_window** | **int**| The long window size used to calculate MACD data. | [optional] [default to 26] | +| **signal_window** | **int**| The window size used to calculate the MACD signal line. | [optional] [default to 9] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoMACD200Response**](../Model/CryptoMACD200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `rSI()` + +```php +rSI($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoRSI200Response +``` + +Relative Strength Index (RSI) + +Get the relative strength index (RSI) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol for which to get relative strength index (RSI) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 14; // int | The window size used to calculate the relative strength index (RSI). +$series_type = close; // string | The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->rSI($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->rSI: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol for which to get relative strength index (RSI) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the relative strength index (RSI). | [optional] [default to 14] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoRSI200Response**](../Model/CryptoRSI200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `sMA()` + +```php +sMA($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt): \OpenAPI\Client\Model\CryptoSMA200Response +``` + +Simple Moving Average (SMA) + +Get the simple moving average (SMA) for a ticker symbol over a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol for which to get simple moving average (SMA) data. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$timespan = day; // string | The size of the aggregate time window. +$adjusted = true; // bool | Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. +$window = 50; // int | The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. +$series_type = close; // string | The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). +$expand_underlying = false; // bool | Whether or not to include the aggregates used to calculate this indicator in the response. +$order = desc; // string | The order in which to return the results, ordered by timestamp. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 5000 +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. + +try { + $result = $apiInstance->sMA($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->sMA: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol for which to get simple moving average (SMA) data. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | [optional] | +| **timespan** | **string**| The size of the aggregate time window. | [optional] [default to 'day'] | +| **adjusted** | **bool**| Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] [default to true] | +| **window** | **int**| The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. | [optional] [default to 50] | +| **series_type** | **string**| The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). | [optional] [default to 'close'] | +| **expand_underlying** | **bool**| Whether or not to include the aggregates used to calculate this indicator in the response. | [optional] [default to false] | +| **order** | **string**| The order in which to return the results, ordered by timestamp. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 5000 | [optional] [default to 10] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\CryptoSMA200Response**](../Model/CryptoSMA200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsGroupedLocaleUsMarketStocksDateGet()` + +```php +v2AggsGroupedLocaleUsMarketStocksDateGet($date, $adjusted, $include_otc): \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response +``` + +Grouped Daily (Bars) + +Get the daily open, high, low, and close (OHLC) for the entire stocks/equities markets. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$date = 2023-01-09; // string | The beginning date for the aggregate window. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. +$include_otc = True; // bool | Include OTC securities in the response. Default is false (don't include OTC securities). + +try { + $result = $apiInstance->v2AggsGroupedLocaleUsMarketStocksDateGet($date, $adjusted, $include_otc); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->v2AggsGroupedLocaleUsMarketStocksDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **date** | **string**| The beginning date for the aggregate window. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | +| **include_otc** | **bool**| Include OTC securities in the response. Default is false (don't include OTC securities). | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response**](../Model/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerStocksTickerPrevGet()` + +```php +v2AggsTickerStocksTickerPrevGet($stocks_ticker, $adjusted): \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response +``` + +Previous Close + +Get the previous day's open, high, low, and close (OHLC) for the specified stock ticker. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stocks_ticker = AAPL; // string | Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v2AggsTickerStocksTickerPrevGet($stocks_ticker, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->v2AggsTickerStocksTickerPrevGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet()` + +```php +v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit): \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response +``` + +Aggregates (Bars) + +Get aggregate bars for a stock over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksaggregatesApi( + // 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 +); +$stocks_ticker = AAPL; // string | Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. +$multiplier = 1; // int | The size of the timespan multiplier. +$timespan = day; // string | The size of the time window. +$from = 2023-01-09; // string | The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$to = 2023-01-09; // string | The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. +$sort = asc; // string | Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). +$limit = 120; // int | Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + +try { + $result = $apiInstance->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksaggregatesApi->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. | | +| **multiplier** | **int**| The size of the timespan multiplier. | | +| **timespan** | **string**| The size of the time window. | | +| **from** | **string**| The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **to** | **string**| The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | +| **sort** | **string**| Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). | [optional] | +| **limit** | **int**| Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response**](../Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StockslastquoteApi.md b/docs/Api/StockslastquoteApi.md new file mode 100644 index 0000000..195a82a --- /dev/null +++ b/docs/Api/StockslastquoteApi.md @@ -0,0 +1,70 @@ +# OpenAPI\Client\StockslastquoteApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**lastQuote()**](StockslastquoteApi.md#lastQuote) | **GET** /v2/last/nbbo/{stocksTicker} | Last Quote | + + +## `lastQuote()` + +```php +lastQuote($stocks_ticker): \OpenAPI\Client\Model\LastQuote200Response +``` + +Last Quote + +Get the most recent NBBO (Quote) tick for a given stock. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockslastquoteApi( + // 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 +); +$stocks_ticker = AAPL; // string | The ticker symbol of the stock/equity. + +try { + $result = $apiInstance->lastQuote($stocks_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockslastquoteApi->lastQuote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| The ticker symbol of the stock/equity. | | + +### Return type + +[**\OpenAPI\Client\Model\LastQuote200Response**](../Model/LastQuote200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StockslasttradeApi.md b/docs/Api/StockslasttradeApi.md new file mode 100644 index 0000000..161757c --- /dev/null +++ b/docs/Api/StockslasttradeApi.md @@ -0,0 +1,70 @@ +# OpenAPI\Client\StockslasttradeApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**lastTrade()**](StockslasttradeApi.md#lastTrade) | **GET** /v2/last/trade/{stocksTicker} | Last Trade | + + +## `lastTrade()` + +```php +lastTrade($stocks_ticker): \OpenAPI\Client\Model\LastTradeOptions200Response +``` + +Last Trade + +Get the most recent trade for a given stock. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockslasttradeApi( + // 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 +); +$stocks_ticker = AAPL; // string | The ticker symbol of the stock/equity. + +try { + $result = $apiInstance->lastTrade($stocks_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockslasttradeApi->lastTrade: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| The ticker symbol of the stock/equity. | | + +### Return type + +[**\OpenAPI\Client\Model\LastTradeOptions200Response**](../Model/LastTradeOptions200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StocksopenCloseApi.md b/docs/Api/StocksopenCloseApi.md new file mode 100644 index 0000000..fe61119 --- /dev/null +++ b/docs/Api/StocksopenCloseApi.md @@ -0,0 +1,139 @@ +# OpenAPI\Client\StocksopenCloseApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v1OpenCloseIndicesTickerDateGet()**](StocksopenCloseApi.md#v1OpenCloseIndicesTickerDateGet) | **GET** /v1/open-close/{indicesTicker}/{date} | Daily Open/Close | +| [**v1OpenCloseStocksTickerDateGet()**](StocksopenCloseApi.md#v1OpenCloseStocksTickerDateGet) | **GET** /v1/open-close/{stocksTicker}/{date} | Daily Open/Close | + + +## `v1OpenCloseIndicesTickerDateGet()` + +```php +v1OpenCloseIndicesTickerDateGet($indices_ticker, $date): \OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response +``` + +Daily Open/Close + +Get the open, close and afterhours values of a index symbol on a certain date. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksopenCloseApi( + // 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 +); +$indices_ticker = I:NDX; // string | The ticker symbol of Index. +$date = 2023-03-10; // string | The date of the requested open/close in the format YYYY-MM-DD. + +try { + $result = $apiInstance->v1OpenCloseIndicesTickerDateGet($indices_ticker, $date); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksopenCloseApi->v1OpenCloseIndicesTickerDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **indices_ticker** | **string**| The ticker symbol of Index. | | +| **date** | **string**| The date of the requested open/close in the format YYYY-MM-DD. | | + +### Return type + +[**\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response**](../Model/V1OpenCloseIndicesTickerDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v1OpenCloseStocksTickerDateGet()` + +```php +v1OpenCloseStocksTickerDateGet($stocks_ticker, $date, $adjusted): \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response +``` + +Daily Open/Close + +Get the open, close and afterhours prices of a stock symbol on a certain date. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksopenCloseApi( + // 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 +); +$stocks_ticker = AAPL; // string | Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. +$date = 2023-01-09; // \DateTime | The date of the requested open/close in the format YYYY-MM-DD. +$adjusted = true; // bool | Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + +try { + $result = $apiInstance->v1OpenCloseStocksTickerDateGet($stocks_ticker, $date, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksopenCloseApi->v1OpenCloseStocksTickerDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. | | +| **date** | **\DateTime**| The date of the requested open/close in the format YYYY-MM-DD. | | +| **adjusted** | **bool**| Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response**](../Model/V1OpenCloseOptionsTickerDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StocksquotesApi.md b/docs/Api/StocksquotesApi.md new file mode 100644 index 0000000..2d20d55 --- /dev/null +++ b/docs/Api/StocksquotesApi.md @@ -0,0 +1,159 @@ +# OpenAPI\Client\StocksquotesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**quotes()**](StocksquotesApi.md#quotes) | **GET** /v3/quotes/{stockTicker} | Quotes (NBBO) | +| [**v2TicksStocksNbboTickerDateGet()**](StocksquotesApi.md#v2TicksStocksNbboTickerDateGet) | **GET** /v2/ticks/stocks/nbbo/{ticker}/{date} | Quotes (NBBO) | + + +## `quotes()` + +```php +quotes($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\Quotes200Response +``` + +Quotes (NBBO) + +Get NBBO quotes for a ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksquotesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol to get quotes for. +$timestamp = 'timestamp_example'; // string | Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->quotes($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksquotesApi->quotes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol to get quotes for. | | +| **timestamp** | **string**| Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\Quotes200Response**](../Model/Quotes200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2TicksStocksNbboTickerDateGet()` + +```php +v2TicksStocksNbboTickerDateGet($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit): \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response +``` + +Quotes (NBBO) + +Get NBBO quotes for a given ticker symbol on a specified date. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StocksquotesApi( + // 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 +); +$ticker = AAPL; // string | The ticker symbol we want quotes for. +$date = 2020-10-14; // \DateTime | The date/day of the quotes to retrieve in the format YYYY-MM-DD. +$timestamp = 56; // int | The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. +$timestamp_limit = 56; // int | The maximum timestamp allowed in the results. +$reverse = true; // bool | Reverse the order of the results. +$limit = 10; // int | Limit the size of the response, max 50000 and default 5000. + +try { + $result = $apiInstance->v2TicksStocksNbboTickerDateGet($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StocksquotesApi->v2TicksStocksNbboTickerDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| The ticker symbol we want quotes for. | | +| **date** | **\DateTime**| The date/day of the quotes to retrieve in the format YYYY-MM-DD. | | +| **timestamp** | **int**| The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. | [optional] | +| **timestamp_limit** | **int**| The maximum timestamp allowed in the results. | [optional] | +| **reverse** | **bool**| Reverse the order of the results. | [optional] | +| **limit** | **int**| Limit the size of the response, max 50000 and default 5000. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response**](../Model/V2TicksStocksNbboTickerDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Api/StockssnapshotApi.md b/docs/Api/StockssnapshotApi.md new file mode 100644 index 0000000..f9c910b --- /dev/null +++ b/docs/Api/StockssnapshotApi.md @@ -0,0 +1,200 @@ +# OpenAPI\Client\StockssnapshotApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**v2SnapshotLocaleUsMarketsStocksDirectionGet()**](StockssnapshotApi.md#v2SnapshotLocaleUsMarketsStocksDirectionGet) | **GET** /v2/snapshot/locale/us/markets/stocks/{direction} | Gainers/Losers | +| [**v2SnapshotLocaleUsMarketsStocksTickersGet()**](StockssnapshotApi.md#v2SnapshotLocaleUsMarketsStocksTickersGet) | **GET** /v2/snapshot/locale/us/markets/stocks/tickers | All Tickers | +| [**v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet()**](StockssnapshotApi.md#v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet) | **GET** /v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker} | Ticker | + + +## `v2SnapshotLocaleUsMarketsStocksDirectionGet()` + +```php +v2SnapshotLocaleUsMarketsStocksDirectionGet($direction, $include_otc): \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response +``` + +Gainers/Losers + +Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.

Top gainers are those tickers whose price has increased by the highest percentage since the previous day's close. Top losers are those tickers whose price has decreased by the highest percentage since the previous day's close.

Note: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockssnapshotApi( + // 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 +); +$direction = gainers; // string | The direction of the snapshot results to return. +$include_otc = True; // bool | Include OTC securities in the response. Default is false (don't include OTC securities). + +try { + $result = $apiInstance->v2SnapshotLocaleUsMarketsStocksDirectionGet($direction, $include_otc); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockssnapshotApi->v2SnapshotLocaleUsMarketsStocksDirectionGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **direction** | **string**| The direction of the snapshot results to return. | | +| **include_otc** | **bool**| Include OTC securities in the response. Default is false (don't include OTC securities). | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response**](../Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleUsMarketsStocksTickersGet()` + +```php +v2SnapshotLocaleUsMarketsStocksTickersGet($tickers, $include_otc): \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response +``` + +All Tickers + +Get the most up-to-date market data for all traded stock symbols.

Note: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockssnapshotApi( + // 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 +); +$tickers = array('tickers_example'); // string[] | A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. +$include_otc = True; // bool | Include OTC securities in the response. Default is false (don't include OTC securities). + +try { + $result = $apiInstance->v2SnapshotLocaleUsMarketsStocksTickersGet($tickers, $include_otc); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockssnapshotApi->v2SnapshotLocaleUsMarketsStocksTickersGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tickers** | [**string[]**](../Model/string.md)| A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. | [optional] | +| **include_otc** | **bool**| Include OTC securities in the response. Default is false (don't include OTC securities). | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response**](../Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet()` + +```php +v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet($stocks_ticker): \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response +``` + +Ticker + +Get the most up-to-date market data for a single traded stock ticker.

Note: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockssnapshotApi( + // 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 +); +$stocks_ticker = AAPL; // string | Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. + +try { + $result = $apiInstance->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet($stocks_ticker); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockssnapshotApi->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stocks_ticker** | **string**| Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. | | + +### Return type + +[**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response**](../Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StockstradesApi.md b/docs/Api/StockstradesApi.md new file mode 100644 index 0000000..5cfcf0e --- /dev/null +++ b/docs/Api/StockstradesApi.md @@ -0,0 +1,159 @@ +# OpenAPI\Client\StockstradesApi + +All URIs are relative to https://api.polygon.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**trades()**](StockstradesApi.md#trades) | **GET** /v3/trades/{stockTicker} | Trades | +| [**v2TicksStocksTradesTickerDateGet()**](StockstradesApi.md#v2TicksStocksTradesTickerDateGet) | **GET** /v2/ticks/stocks/trades/{ticker}/{date} | Trades | + + +## `trades()` + +```php +trades($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort): \OpenAPI\Client\Model\Trades200Response +``` + +Trades + +Get trades for a ticker symbol in a given time range. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockstradesApi( + // 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 +); +$stock_ticker = AAPL; // string | The ticker symbol to get trades for. +$timestamp = 'timestamp_example'; // string | Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. +$timestamp_gte = 'timestamp_gte_example'; // string | Range by timestamp. +$timestamp_gt = 'timestamp_gt_example'; // string | Range by timestamp. +$timestamp_lte = 'timestamp_lte_example'; // string | Range by timestamp. +$timestamp_lt = 'timestamp_lt_example'; // string | Range by timestamp. +$order = asc; // string | Order results based on the `sort` field. +$limit = 10; // int | Limit the number of results returned, default is 10 and max is 50000. +$sort = timestamp; // string | Sort field used for ordering. + +try { + $result = $apiInstance->trades($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockstradesApi->trades: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stock_ticker** | **string**| The ticker symbol to get trades for. | | +| **timestamp** | **string**| Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. | [optional] | +| **timestamp_gte** | **string**| Range by timestamp. | [optional] | +| **timestamp_gt** | **string**| Range by timestamp. | [optional] | +| **timestamp_lte** | **string**| Range by timestamp. | [optional] | +| **timestamp_lt** | **string**| Range by timestamp. | [optional] | +| **order** | **string**| Order results based on the `sort` field. | [optional] [default to 'desc'] | +| **limit** | **int**| Limit the number of results returned, default is 10 and max is 50000. | [optional] [default to 10] | +| **sort** | **string**| Sort field used for ordering. | [optional] [default to 'timestamp'] | + +### Return type + +[**\OpenAPI\Client\Model\Trades200Response**](../Model/Trades200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `v2TicksStocksTradesTickerDateGet()` + +```php +v2TicksStocksTradesTickerDateGet($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit): \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response +``` + +Trades + +Get trades for a given ticker symbol on a specified date. + +### Example + +```php +setApiKey('apiKey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer'); + + +$apiInstance = new OpenAPI\Client\Api\StockstradesApi( + // 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 +); +$ticker = AAPL; // string | The ticker symbol we want trades for. +$date = 2020-10-14; // \DateTime | The date/day of the trades to retrieve in the format YYYY-MM-DD. +$timestamp = 56; // int | The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. +$timestamp_limit = 56; // int | The maximum timestamp allowed in the results. +$reverse = true; // bool | Reverse the order of the results. +$limit = 10; // int | Limit the size of the response, max 50000 and default 5000. + +try { + $result = $apiInstance->v2TicksStocksTradesTickerDateGet($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StockstradesApi->v2TicksStocksTradesTickerDateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ticker** | **string**| The ticker symbol we want trades for. | | +| **date** | **\DateTime**| The date/day of the trades to retrieve in the format YYYY-MM-DD. | | +| **timestamp** | **int**| The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. | [optional] | +| **timestamp_limit** | **int**| The maximum timestamp allowed in the results. | [optional] | +| **reverse** | **bool**| Reverse the order of the results. | [optional] | +| **limit** | **int**| Limit the size of the response, max 50000 and default 5000. | [optional] | + +### Return type + +[**\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response**](../Model/V2TicksStocksTradesTickerDateGet200Response.md) + +### Authorization + +[apiKey](../../README.md#apiKey) + +### 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) diff --git a/docs/Model/AskExchangeId.md b/docs/Model/AskExchangeId.md new file mode 100644 index 0000000..471a176 --- /dev/null +++ b/docs/Model/AskExchangeId.md @@ -0,0 +1,8 @@ +# # AskExchangeId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BidExchangeId.md b/docs/Model/BidExchangeId.md new file mode 100644 index 0000000..96cbbbd --- /dev/null +++ b/docs/Model/BidExchangeId.md @@ -0,0 +1,8 @@ +# # BidExchangeId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Company.md b/docs/Model/Company.md new file mode 100644 index 0000000..4eb8346 --- /dev/null +++ b/docs/Model/Company.md @@ -0,0 +1,36 @@ +# # Company + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Indicates if the security is actively listed. If false, this means the company is no longer listed and cannot be traded. | [optional] +**bloomberg** | **string** | The Bloomberg guid for the symbol. | [optional] +**ceo** | **string** | The name of the company's current CEO. | [optional] +**cik** | **string** | The official CIK guid used for SEC database/filings. | [optional] +**country** | **string** | The country in which the company is registered. | [optional] +**description** | **string** | A description of the company and what they do/offer. | [optional] +**employees** | **int** | The approximate number of employees for the company. | [optional] +**exchange** | **string** | The symbol's primary exchange. | [optional] +**exchange_symbol** | **string** | The exchange code (id) of the symbol's primary exchange. | [optional] +**figi** | **string** | The OpenFigi project guid for the symbol. (<a rel=\"nofollow\" target=\"_blank\" href=\"https://openfigi.com/\">https://openfigi.com/</a>) | [optional] +**hq_address** | **string** | The street address for the company's headquarters. | [optional] +**hq_country** | **string** | The country in which the company's headquarters is located. | [optional] +**hq_state** | **string** | The state in which the company's headquarters is located. | [optional] +**industry** | **string** | The industry in which the company operates. | [optional] +**lei** | **string** | The Legal Entity Identifier (LEI) guid for the symbol. (<a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Legal_Entity_Identifier\">https://en.wikipedia.org/wiki/Legal_Entity_Identifier</a>) | [optional] +**listdate** | **\DateTime** | The date that the symbol was listed on the exchange. | [optional] +**logo** | **string** | The URL of the entity's logo. | [optional] +**marketcap** | **int** | The current market cap for the company. | [optional] +**name** | **string** | The name of the company/entity. | [optional] +**phone** | **string** | The phone number for the company. This is usually a corporate contact number. | [optional] +**sector** | **string** | The sector of the indsutry in which the symbol operates. | [optional] +**sic** | **int** | Standard Industrial Classification (SIC) id for the symbol. (<a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Standard_Industrial_Classification\">https://en.wikipedia.org/wiki/Legal_Entity_Identifier</a>) | [optional] +**similar** | **string[]** | A list of ticker symbols for similar companies. | [optional] +**symbol** | **string** | The exchange symbol that this item is traded under. | [optional] +**tags** | **string[]** | | [optional] +**type** | **string** | The type or class of the security. (<a alt=\"Full List of Ticker Types\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers_types\">Full List of Ticker Types</a>) | [optional] +**updated** | **\DateTime** | The last time this company record was updated. | [optional] +**url** | **string** | The URL of the company's website | [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/ConditionTypeMap.md b/docs/Model/ConditionTypeMap.md new file mode 100644 index 0000000..c44295f --- /dev/null +++ b/docs/Model/ConditionTypeMap.md @@ -0,0 +1,9 @@ +# # ConditionTypeMap + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**condition** | **string** | Polygon.io's mapping for condition codes. For more information, see our <a href=\"https://polygon.io/glossary/us/stocks/trade-conditions\" alt=\"Trade Conditions Glossary\" target=\"_blank\">Trade Conditions Glossary</a>. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoEMA200Response.md b/docs/Model/CryptoEMA200Response.md new file mode 100644 index 0000000..8aabab8 --- /dev/null +++ b/docs/Model/CryptoEMA200Response.md @@ -0,0 +1,12 @@ +# # CryptoEMA200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResults**](CryptoEMA200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/CryptoEMA200ResponseResults.md b/docs/Model/CryptoEMA200ResponseResults.md new file mode 100644 index 0000000..c1ccfb5 --- /dev/null +++ b/docs/Model/CryptoEMA200ResponseResults.md @@ -0,0 +1,10 @@ +# # CryptoEMA200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying**](CryptoEMA200ResponseResultsUnderlying.md) | | [optional] +**values** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]**](CryptoEMA200ResponseResultsValuesInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoEMA200ResponseResultsUnderlying.md b/docs/Model/CryptoEMA200ResponseResultsUnderlying.md new file mode 100644 index 0000000..d7404c3 --- /dev/null +++ b/docs/Model/CryptoEMA200ResponseResultsUnderlying.md @@ -0,0 +1,10 @@ +# # CryptoEMA200ResponseResultsUnderlying + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aggregates** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlyingAggregatesInner[]**](CryptoEMA200ResponseResultsUnderlyingAggregatesInner.md) | | [optional] +**url** | **string** | The URL which can be used to request the underlying aggregates used in this request. | [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/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.md b/docs/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.md new file mode 100644 index 0000000..4baab7e --- /dev/null +++ b/docs/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.md @@ -0,0 +1,17 @@ +# # CryptoEMA200ResponseResultsUnderlyingAggregatesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**t** | **float** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoEMA200ResponseResultsValuesInner.md b/docs/Model/CryptoEMA200ResponseResultsValuesInner.md new file mode 100644 index 0000000..13204d6 --- /dev/null +++ b/docs/Model/CryptoEMA200ResponseResultsValuesInner.md @@ -0,0 +1,10 @@ +# # CryptoEMA200ResponseResultsValuesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | The Unix Msec timestamp from the last aggregate used in this calculation. | [optional] +**value** | **float** | The indicator value for this 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/CryptoExchangeInner.md b/docs/Model/CryptoExchangeInner.md new file mode 100644 index 0000000..507e2d6 --- /dev/null +++ b/docs/Model/CryptoExchangeInner.md @@ -0,0 +1,13 @@ +# # CryptoExchangeInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**market** | **string** | Market data type this exchange contains ( crypto only currently ) | +**name** | **string** | Name of the exchange | +**type** | **string** | Type of exchange feed | +**url** | **string** | URL of this exchange | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoGroupedResults.md b/docs/Model/CryptoGroupedResults.md new file mode 100644 index 0000000..dd02e25 --- /dev/null +++ b/docs/Model/CryptoGroupedResults.md @@ -0,0 +1,9 @@ +# # CryptoGroupedResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoHistoricTrades.md b/docs/Model/CryptoHistoricTrades.md new file mode 100644 index 0000000..c1fd551 --- /dev/null +++ b/docs/Model/CryptoHistoricTrades.md @@ -0,0 +1,13 @@ +# # CryptoHistoricTrades + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **\DateTime** | The date that was evaluated from the request. | +**map** | **object** | A map for shortened result keys. | +**ms_latency** | **int** | The milliseconds of latency for the query results. | +**symbol** | **string** | The symbol pair that was evaluated from the request. | +**ticks** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoLastTrade.md b/docs/Model/CryptoLastTrade.md new file mode 100644 index 0000000..3f3de05 --- /dev/null +++ b/docs/Model/CryptoLastTrade.md @@ -0,0 +1,10 @@ +# # CryptoLastTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last** | [**\OpenAPI\Client\Model\CryptoLastTradeLast**](CryptoLastTradeLast.md) | | [optional] +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoLastTradeLast.md b/docs/Model/CryptoLastTradeLast.md new file mode 100644 index 0000000..4f09197 --- /dev/null +++ b/docs/Model/CryptoLastTradeLast.md @@ -0,0 +1,13 @@ +# # CryptoLastTradeLast + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | +**exchange** | **int** | The exchange that this crypto trade happened on. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**size** | **float** | The size of a trade (also known as volume). | +**timestamp** | **int** | The Unix Msec timestamp for the start of the aggregate window. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoMACD200Response.md b/docs/Model/CryptoMACD200Response.md new file mode 100644 index 0000000..2771625 --- /dev/null +++ b/docs/Model/CryptoMACD200Response.md @@ -0,0 +1,12 @@ +# # CryptoMACD200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\CryptoMACD200ResponseResults**](CryptoMACD200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/CryptoMACD200ResponseResults.md b/docs/Model/CryptoMACD200ResponseResults.md new file mode 100644 index 0000000..d3b8c29 --- /dev/null +++ b/docs/Model/CryptoMACD200ResponseResults.md @@ -0,0 +1,10 @@ +# # CryptoMACD200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying**](CryptoEMA200ResponseResultsUnderlying.md) | | [optional] +**values** | [**\OpenAPI\Client\Model\CryptoMACD200ResponseResultsValuesInner[]**](CryptoMACD200ResponseResultsValuesInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoMACD200ResponseResultsValuesInner.md b/docs/Model/CryptoMACD200ResponseResultsValuesInner.md new file mode 100644 index 0000000..9bdb6b9 --- /dev/null +++ b/docs/Model/CryptoMACD200ResponseResultsValuesInner.md @@ -0,0 +1,12 @@ +# # CryptoMACD200ResponseResultsValuesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**histogram** | **float** | The indicator value for this period. | [optional] +**signal** | **float** | The indicator value for this period. | [optional] +**timestamp** | **int** | The Unix Msec timestamp from the last aggregate used in this calculation. | [optional] +**value** | **float** | The indicator value for this 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/CryptoOpenClose.md b/docs/Model/CryptoOpenClose.md new file mode 100644 index 0000000..fcc0247 --- /dev/null +++ b/docs/Model/CryptoOpenClose.md @@ -0,0 +1,15 @@ +# # CryptoOpenClose + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**close** | **float** | The close price for the symbol in the given time period. | +**closing_trades** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | +**day** | **\DateTime** | The date requested. | +**is_utc** | **bool** | Whether or not the timestamps are in UTC timezone. | +**open** | **float** | The open price for the symbol in the given time period. | +**open_trades** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoRSI200Response.md b/docs/Model/CryptoRSI200Response.md new file mode 100644 index 0000000..3d22385 --- /dev/null +++ b/docs/Model/CryptoRSI200Response.md @@ -0,0 +1,12 @@ +# # CryptoRSI200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\CryptoRSI200ResponseResults**](CryptoRSI200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/CryptoRSI200ResponseResults.md b/docs/Model/CryptoRSI200ResponseResults.md new file mode 100644 index 0000000..d265ccd --- /dev/null +++ b/docs/Model/CryptoRSI200ResponseResults.md @@ -0,0 +1,10 @@ +# # CryptoRSI200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying**](CryptoEMA200ResponseResultsUnderlying.md) | | [optional] +**values** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]**](CryptoEMA200ResponseResultsValuesInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSMA200Response.md b/docs/Model/CryptoSMA200Response.md new file mode 100644 index 0000000..a2c7cc4 --- /dev/null +++ b/docs/Model/CryptoSMA200Response.md @@ -0,0 +1,12 @@ +# # CryptoSMA200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\CryptoSMA200ResponseResults**](CryptoSMA200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/CryptoSMA200ResponseResults.md b/docs/Model/CryptoSMA200ResponseResults.md new file mode 100644 index 0000000..2ab7a83 --- /dev/null +++ b/docs/Model/CryptoSMA200ResponseResults.md @@ -0,0 +1,10 @@ +# # CryptoSMA200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying**](CryptoEMA200ResponseResultsUnderlying.md) | | [optional] +**values** | [**\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]**](CryptoEMA200ResponseResultsValuesInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSnapshotMinute.md b/docs/Model/CryptoSnapshotMinute.md new file mode 100644 index 0000000..4c6628d --- /dev/null +++ b/docs/Model/CryptoSnapshotMinute.md @@ -0,0 +1,16 @@ +# # CryptoSnapshotMinute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSnapshotTicker.md b/docs/Model/CryptoSnapshotTicker.md new file mode 100644 index 0000000..965ba80 --- /dev/null +++ b/docs/Model/CryptoSnapshotTicker.md @@ -0,0 +1,9 @@ +# # CryptoSnapshotTicker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSnapshotTickerFullBook.md b/docs/Model/CryptoSnapshotTickerFullBook.md new file mode 100644 index 0000000..9d4364e --- /dev/null +++ b/docs/Model/CryptoSnapshotTickerFullBook.md @@ -0,0 +1,9 @@ +# # CryptoSnapshotTickerFullBook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData**](V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSnapshotTickers.md b/docs/Model/CryptoSnapshotTickers.md new file mode 100644 index 0000000..85a1961 --- /dev/null +++ b/docs/Model/CryptoSnapshotTickers.md @@ -0,0 +1,9 @@ +# # CryptoSnapshotTickers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoTick.md b/docs/Model/CryptoTick.md new file mode 100644 index 0000000..d915222 --- /dev/null +++ b/docs/Model/CryptoTick.md @@ -0,0 +1,14 @@ +# # CryptoTick + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **int[]** | A list of condition codes. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**s** | **float** | The size of a trade (also known as volume). | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**x** | **int** | The exchange that this crypto trade happened on. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Date.md b/docs/Model/Date.md new file mode 100644 index 0000000..9804cb7 --- /dev/null +++ b/docs/Model/Date.md @@ -0,0 +1,8 @@ +# # Date + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExchangeInner.md b/docs/Model/ExchangeInner.md new file mode 100644 index 0000000..507b783 --- /dev/null +++ b/docs/Model/ExchangeInner.md @@ -0,0 +1,15 @@ +# # ExchangeInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | A unique identifier for the exchange internal to Polygon.io. This is not an industry code or ISO standard. | [optional] +**id** | **float** | The ID of the exchange. | [optional] +**market** | **string** | The market data type that this exchange contains. | [optional] +**mic** | **string** | The Market Identification Code or MIC as defined in ISO 10383 (<a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Market_Identifier_Code\">https://en.wikipedia.org/wiki/Market_Identifier_Code</a>). | [optional] +**name** | **string** | The name of the exchange. | [optional] +**tape** | **string** | The tape id of the exchange. | [optional] +**type** | **string** | The type of exchange. - TRF = Trade Reporting Facility - exchange = Reporting exchange on the tape | [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/Financial.md b/docs/Model/Financial.md new file mode 100644 index 0000000..a2476b2 --- /dev/null +++ b/docs/Model/Financial.md @@ -0,0 +1,30 @@ +# # Financial + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cash_change** | **int** | | [optional] +**cash_flow** | **int** | | [optional] +**cost_of_revenue** | **int** | | [optional] +**current_assets** | **int** | | [optional] +**current_cash** | **int** | | [optional] +**current_debt** | **int** | | [optional] +**gross_profit** | **int** | | [optional] +**net_income** | **int** | | [optional] +**operating_expense** | **int** | | [optional] +**operating_gains_losses** | **float** | | [optional] +**operating_income** | **int** | | [optional] +**operating_revenue** | **int** | | [optional] +**report_date** | **\DateTime** | Report Date | +**report_date_str** | **string** | Report date as non date format | +**research_and_development** | **int** | | [optional] +**shareholder_equity** | **int** | | [optional] +**symbol** | **string** | Stock Symbol | +**total_assets** | **int** | | [optional] +**total_cash** | **int** | | [optional] +**total_debt** | **int** | | [optional] +**total_liabilities** | **int** | | [optional] +**total_revenue** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Financials.md b/docs/Model/Financials.md new file mode 100644 index 0000000..8631fa8 --- /dev/null +++ b/docs/Model/Financials.md @@ -0,0 +1,118 @@ +# # Financials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ebitda_margin** | **float** | | [optional] +**accumulated_other_comprehensive_income** | **int** | | [optional] +**accumulated_retained_earnings_deficit** | **int** | | [optional] +**asset_turnover** | **int** | | [optional] +**assets** | **int** | | [optional] +**assets_average** | **int** | | [optional] +**assets_current** | **int** | | [optional] +**assets_non_current** | **int** | | [optional] +**average_equity** | **int** | | [optional] +**book_value_per_share** | **float** | | [optional] +**calendar_date** | **\DateTime** | | [optional] +**capital_expenditure** | **int** | | [optional] +**cash_and_equivalents** | **int** | | [optional] +**cash_and_equivalents_usd** | **int** | | [optional] +**consolidated_income** | **int** | | [optional] +**cost_of_revenue** | **int** | | [optional] +**current_liabilities** | **int** | | [optional] +**current_ratio** | **float** | | [optional] +**debt** | **int** | | [optional] +**debt_current** | **int** | | [optional] +**debt_non_current** | **int** | | [optional] +**debt_to_equity_ratio** | **float** | | [optional] +**debt_usd** | **int** | | [optional] +**deferred_revenue** | **int** | | [optional] +**deposits** | **int** | | [optional] +**depreciation_amortization_and_accretion** | **int** | | [optional] +**dividend_yield** | **int** | | [optional] +**dividends_per_basic_common_share** | **int** | | [optional] +**earning_before_interest_taxes** | **int** | | [optional] +**earning_before_interest_taxes_usd** | **int** | | [optional] +**earnings_before_interest_taxes_depreciation_amortization** | **int** | | [optional] +**earnings_before_interest_taxes_depreciation_amortization_usd** | **int** | | [optional] +**earnings_before_tax** | **int** | | [optional] +**earnings_per_basic_share** | **float** | | [optional] +**earnings_per_basic_share_usd** | **float** | | [optional] +**earnings_per_diluted_share** | **float** | | [optional] +**effect_of_exchange_rate_changes_on_cash** | **int** | | [optional] +**enterprise_value** | **int** | | [optional] +**enterprise_value_over_ebit** | **int** | | [optional] +**enterprise_value_over_ebitda** | **float** | | [optional] +**foreign_currency_usd_exchange_rate** | **int** | | [optional] +**free_cash_flow** | **int** | | [optional] +**free_cash_flow_per_share** | **float** | | [optional] +**goodwill_and_intangible_assets** | **int** | | [optional] +**gross_margin** | **float** | | [optional] +**gross_profit** | **int** | | [optional] +**income_tax_expense** | **int** | | [optional] +**interest_expense** | **int** | | [optional] +**inventory** | **int** | | [optional] +**invested_capital** | **int** | | [optional] +**invested_capital_average** | **int** | | [optional] +**investments** | **int** | | [optional] +**investments_current** | **int** | | [optional] +**investments_non_current** | **int** | | [optional] +**issuance_debt_securities** | **int** | | [optional] +**issuance_equity_shares** | **int** | | [optional] +**liabilities_non_current** | **int** | | [optional] +**market_capitalization** | **int** | | [optional] +**net_cash_flow** | **int** | | [optional] +**net_cash_flow_business_acquisitions_disposals** | **int** | | [optional] +**net_cash_flow_from_financing** | **int** | | [optional] +**net_cash_flow_from_investing** | **int** | | [optional] +**net_cash_flow_from_operations** | **int** | | [optional] +**net_cash_flow_investment_acquisitions_disposals** | **int** | | [optional] +**net_income** | **int** | | [optional] +**net_income_common_stock** | **int** | | [optional] +**net_income_common_stock_usd** | **int** | | [optional] +**net_income_to_non_controlling_interests** | **int** | | [optional] +**net_loss_income_from_discontinued_operations** | **int** | | [optional] +**operating_expenses** | **int** | | [optional] +**operating_income** | **int** | | [optional] +**payment_dividends_other_cash_distributions** | **int** | | [optional] +**payout_ratio** | **int** | | [optional] +**period** | **string** | Reporting period. | [optional] +**preferred_dividends_income_statement_impact** | **int** | | [optional] +**price_earnings** | **float** | | [optional] +**price_sales** | **float** | | [optional] +**price_to_book_value** | **float** | | [optional] +**price_to_earnings_ratio** | **float** | | [optional] +**price_to_sales_ratio** | **float** | | [optional] +**profit_margin** | **float** | | [optional] +**property_plant_equipment_net** | **int** | | [optional] +**report_period** | **\DateTime** | | [optional] +**research_and_development_expense** | **int** | | [optional] +**return_on_average_assets** | **int** | | [optional] +**return_on_average_equity** | **int** | | [optional] +**return_on_invested_capital** | **int** | | [optional] +**return_on_sales** | **float** | | [optional] +**revenues** | **int** | | [optional] +**revenues_usd** | **int** | | [optional] +**sales_per_share** | **float** | | [optional] +**selling_general_and_administrative_expense** | **int** | | [optional] +**share_based_compensation** | **int** | | [optional] +**share_factor** | **int** | | [optional] +**share_price_adjusted_close** | **float** | | [optional] +**shareholders_equity** | **int** | | [optional] +**shareholders_equity_usd** | **int** | | [optional] +**shares** | **int** | | [optional] +**tangible_asset_value** | **int** | | [optional] +**tangible_assets_book_value_per_share** | **float** | | [optional] +**tax_assets** | **int** | | [optional] +**tax_liabilities** | **int** | | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | +**total_liabilities** | **int** | | [optional] +**trade_and_non_trade_payables** | **int** | | [optional] +**trade_and_non_trade_receivables** | **int** | | [optional] +**updated** | **\DateTime** | | [optional] +**weighted_average_shares** | **int** | | [optional] +**weighted_average_shares_diluted** | **int** | | [optional] +**working_capital** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexConversion.md b/docs/Model/ForexConversion.md new file mode 100644 index 0000000..33c4bc7 --- /dev/null +++ b/docs/Model/ForexConversion.md @@ -0,0 +1,13 @@ +# # ForexConversion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**converted** | **float** | The result of the conversion. | +**from** | **string** | The \"from\" currency symbol. | +**initial_amount** | **float** | The amount to convert. | +**last** | [**\OpenAPI\Client\Model\ForexConversionLast**](ForexConversionLast.md) | | [optional] +**to** | **string** | The \"to\" currency symbol. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexConversionLast.md b/docs/Model/ForexConversionLast.md new file mode 100644 index 0000000..7f3e6cc --- /dev/null +++ b/docs/Model/ForexConversionLast.md @@ -0,0 +1,12 @@ +# # ForexConversionLast + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask** | **float** | The ask price. | +**bid** | **float** | The bid price. | +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**timestamp** | **int** | The Unix Msec timestamp for the start of the aggregate window. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexGroupedResults.md b/docs/Model/ForexGroupedResults.md new file mode 100644 index 0000000..727cd66 --- /dev/null +++ b/docs/Model/ForexGroupedResults.md @@ -0,0 +1,9 @@ +# # ForexGroupedResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexHistoricTrades.md b/docs/Model/ForexHistoricTrades.md new file mode 100644 index 0000000..9b273f0 --- /dev/null +++ b/docs/Model/ForexHistoricTrades.md @@ -0,0 +1,13 @@ +# # ForexHistoricTrades + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **\DateTime** | The date that was evaluated from the request. | +**map** | **object** | A map for shortened result keys. | +**ms_latency** | **int** | The milliseconds of latency for the query results. | +**pair** | **string** | The currency pair that was evaluated from the request. | +**ticks** | [**\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexPairLastQuote.md b/docs/Model/ForexPairLastQuote.md new file mode 100644 index 0000000..b1eac2d --- /dev/null +++ b/docs/Model/ForexPairLastQuote.md @@ -0,0 +1,10 @@ +# # ForexPairLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last** | [**\OpenAPI\Client\Model\ForexConversionLast**](ForexConversionLast.md) | | [optional] +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexPreviousClose.md b/docs/Model/ForexPreviousClose.md new file mode 100644 index 0000000..ada6a60 --- /dev/null +++ b/docs/Model/ForexPreviousClose.md @@ -0,0 +1,9 @@ +# # ForexPreviousClose + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexSnapshotLastQuote.md b/docs/Model/ForexSnapshotLastQuote.md new file mode 100644 index 0000000..78c1712 --- /dev/null +++ b/docs/Model/ForexSnapshotLastQuote.md @@ -0,0 +1,12 @@ +# # ForexSnapshotLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a** | **float** | The ask price. | +**b** | **float** | The bid price. | +**t** | **int** | The millisecond accuracy timestamp of the quote. | +**x** | **int** | The exchange ID on which this quote happened. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexSnapshotPrevDay.md b/docs/Model/ForexSnapshotPrevDay.md new file mode 100644 index 0000000..3257408 --- /dev/null +++ b/docs/Model/ForexSnapshotPrevDay.md @@ -0,0 +1,14 @@ +# # ForexSnapshotPrevDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexSnapshotTicker.md b/docs/Model/ForexSnapshotTicker.md new file mode 100644 index 0000000..45e7cd4 --- /dev/null +++ b/docs/Model/ForexSnapshotTicker.md @@ -0,0 +1,9 @@ +# # ForexSnapshotTicker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexSnapshotTickers.md b/docs/Model/ForexSnapshotTickers.md new file mode 100644 index 0000000..eb8add5 --- /dev/null +++ b/docs/Model/ForexSnapshotTickers.md @@ -0,0 +1,9 @@ +# # ForexSnapshotTickers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexTickerResults.md b/docs/Model/ForexTickerResults.md new file mode 100644 index 0000000..58bcf6f --- /dev/null +++ b/docs/Model/ForexTickerResults.md @@ -0,0 +1,9 @@ +# # ForexTickerResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]**](V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEvents200Response.md b/docs/Model/GetEvents200Response.md new file mode 100644 index 0000000..a1aae72 --- /dev/null +++ b/docs/Model/GetEvents200Response.md @@ -0,0 +1,11 @@ +# # GetEvents200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\GetEvents200ResponseResults**](GetEvents200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/GetEvents200ResponseResults.md b/docs/Model/GetEvents200ResponseResults.md new file mode 100644 index 0000000..0b2b8af --- /dev/null +++ b/docs/Model/GetEvents200ResponseResults.md @@ -0,0 +1,10 @@ +# # GetEvents200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInner[]**](GetEvents200ResponseResultsEventsInner.md) | | [optional] +**name** | **string** | | [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/GetEvents200ResponseResultsEventsInner.md b/docs/Model/GetEvents200ResponseResultsEventsInner.md new file mode 100644 index 0000000..ba196b2 --- /dev/null +++ b/docs/Model/GetEvents200ResponseResultsEventsInner.md @@ -0,0 +1,11 @@ +# # GetEvents200ResponseResultsEventsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | The date the event took place | +**event_type** | **string** | The type of historical event for the asset | +**ticker_change** | [**\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange**](GetEvents200ResponseResultsEventsInnerOneOfTickerChange.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEvents200ResponseResultsEventsInnerOneOf.md b/docs/Model/GetEvents200ResponseResultsEventsInnerOneOf.md new file mode 100644 index 0000000..480d5bc --- /dev/null +++ b/docs/Model/GetEvents200ResponseResultsEventsInnerOneOf.md @@ -0,0 +1,11 @@ +# # GetEvents200ResponseResultsEventsInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | The date the event took place | +**event_type** | **string** | The type of historical event for the asset | +**ticker_change** | [**\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange**](GetEvents200ResponseResultsEventsInnerOneOfTickerChange.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.md b/docs/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.md new file mode 100644 index 0000000..fd82cb3 --- /dev/null +++ b/docs/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.md @@ -0,0 +1,9 @@ +# # GetEvents200ResponseResultsEventsInnerOneOfTickerChange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | | [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/GetMarketHolidays200ResponseInner.md b/docs/Model/GetMarketHolidays200ResponseInner.md new file mode 100644 index 0000000..fbab7a1 --- /dev/null +++ b/docs/Model/GetMarketHolidays200ResponseInner.md @@ -0,0 +1,14 @@ +# # GetMarketHolidays200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**close** | **string** | The market close time on the holiday (if it's not closed). | [optional] +**date** | **string** | The date of the holiday. | [optional] +**exchange** | **string** | Which market the record is for. | [optional] +**name** | **string** | The name of the holiday. | [optional] +**open** | **string** | The market open time on the holiday (if it's not closed). | [optional] +**status** | **string** | The status of the market on the holiday. | [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/GetMarketStatus200Response.md b/docs/Model/GetMarketStatus200Response.md new file mode 100644 index 0000000..dc304aa --- /dev/null +++ b/docs/Model/GetMarketStatus200Response.md @@ -0,0 +1,15 @@ +# # GetMarketStatus200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **bool** | Whether or not the market is in post-market hours. | [optional] +**currencies** | [**\OpenAPI\Client\Model\GetMarketStatus200ResponseCurrencies**](GetMarketStatus200ResponseCurrencies.md) | | [optional] +**early_hours** | **bool** | Whether or not the market is in pre-market hours. | [optional] +**exchanges** | [**\OpenAPI\Client\Model\GetMarketStatus200ResponseExchanges**](GetMarketStatus200ResponseExchanges.md) | | [optional] +**indices_groups** | [**\OpenAPI\Client\Model\GetMarketStatus200ResponseIndicesGroups**](GetMarketStatus200ResponseIndicesGroups.md) | | [optional] +**market** | **string** | The status of the market as a whole. | [optional] +**server_time** | **string** | The current time of the server, returned as a date-time in RFC3339 format. | [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/GetMarketStatus200ResponseCurrencies.md b/docs/Model/GetMarketStatus200ResponseCurrencies.md new file mode 100644 index 0000000..3d6507d --- /dev/null +++ b/docs/Model/GetMarketStatus200ResponseCurrencies.md @@ -0,0 +1,10 @@ +# # GetMarketStatus200ResponseCurrencies + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crypto** | **string** | The status of the crypto market. | [optional] +**fx** | **string** | The status of the forex market. | [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/GetMarketStatus200ResponseExchanges.md b/docs/Model/GetMarketStatus200ResponseExchanges.md new file mode 100644 index 0000000..910cf9c --- /dev/null +++ b/docs/Model/GetMarketStatus200ResponseExchanges.md @@ -0,0 +1,11 @@ +# # GetMarketStatus200ResponseExchanges + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nasdaq** | **string** | The status of the Nasdaq market. | [optional] +**nyse** | **string** | The status of the NYSE market. | [optional] +**otc** | **string** | The status of the OTC market. | [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/GetMarketStatus200ResponseIndicesGroups.md b/docs/Model/GetMarketStatus200ResponseIndicesGroups.md new file mode 100644 index 0000000..b4dfa33 --- /dev/null +++ b/docs/Model/GetMarketStatus200ResponseIndicesGroups.md @@ -0,0 +1,17 @@ +# # GetMarketStatus200ResponseIndicesGroups + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cccy** | **string** | The status of Cboe Streaming Market Indices Cryptocurrency (\"CCCY\") indices trading hours. | [optional] +**dow_jones** | **string** | The status of Dow Jones indices trading hours | [optional] +**ftse_russell** | **string** | The status of Financial Times Stock Exchange Group (\"FTSE\") Russell indices trading hours. | [optional] +**msci** | **string** | The status of Morgan Stanley Capital International (\"MSCI\") indices trading hours. | [optional] +**mstar** | **string** | The status of Morningstar (\"MSTAR\") indices trading hours. | [optional] +**mstarc** | **mixed** | The status of Morningstar Customer (\"MSTARC\") indices trading hours. | [optional] +**nasdaq** | **string** | The status of National Association of Securities Dealers Automated Quotations (\"Nasdaq\") indices trading hours. | [optional] +**s_and_p** | **string** | The status of Standard & Poors's (\"S&P\") indices trading hours. | [optional] +**societe_generale** | **string** | The status of Societe Generale indices trading hours. | [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/GetOptionsContract200Response.md b/docs/Model/GetOptionsContract200Response.md new file mode 100644 index 0000000..5bf3088 --- /dev/null +++ b/docs/Model/GetOptionsContract200Response.md @@ -0,0 +1,11 @@ +# # GetOptionsContract200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | | [optional] +**results** | [**\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner**](ListOptionsContracts200ResponseResultsInner.md) | | [optional] +**status** | **string** | | [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/GetTicker200Response.md b/docs/Model/GetTicker200Response.md new file mode 100644 index 0000000..28ac23b --- /dev/null +++ b/docs/Model/GetTicker200Response.md @@ -0,0 +1,12 @@ +# # GetTicker200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\GetTicker200ResponseResults**](GetTicker200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/GetTicker200ResponseResults.md b/docs/Model/GetTicker200ResponseResults.md new file mode 100644 index 0000000..77b0fe8 --- /dev/null +++ b/docs/Model/GetTicker200ResponseResults.md @@ -0,0 +1,35 @@ +# # GetTicker200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Whether or not the asset is actively traded. False means the asset has been delisted. | +**address** | [**\OpenAPI\Client\Model\GetTicker200ResponseResultsAddress**](GetTicker200ResponseResultsAddress.md) | | [optional] +**branding** | [**\OpenAPI\Client\Model\GetTicker200ResponseResultsBranding**](GetTicker200ResponseResultsBranding.md) | | [optional] +**cik** | **string** | The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key). | [optional] +**composite_figi** | **string** | The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) | [optional] +**currency_name** | **string** | The name of the currency that this asset is traded with. | +**delisted_utc** | **\DateTime** | The last date that the asset was traded. | [optional] +**description** | **string** | A description of the company and what they do/offer. | [optional] +**homepage_url** | **string** | The URL of the company's website homepage. | [optional] +**list_date** | **string** | The date that the symbol was first publicly listed in the format YYYY-MM-DD. | [optional] +**locale** | **string** | The locale of the asset. | +**market** | **string** | The market type of the asset. | +**market_cap** | **float** | The most recent close price of the ticker multiplied by weighted outstanding shares. | [optional] +**name** | **string** | The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair. | +**phone_number** | **string** | The phone number for the company behind this ticker. | [optional] +**primary_exchange** | **string** | The ISO code of the primary listing exchange for this asset. | [optional] +**round_lot** | **float** | Round lot size of this security. | [optional] +**share_class_figi** | **string** | The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) | [optional] +**share_class_shares_outstanding** | **float** | The recorded number of outstanding shares for this particular share class. | [optional] +**sic_code** | **string** | The standard industrial classification code for this ticker. For a list of SIC Codes, see the SEC's <a rel=\"nofollow\" target=\"_blank\" href=\"https://www.sec.gov/info/edgar/siccodes.htm\">SIC Code List</a>. | [optional] +**sic_description** | **string** | A description of this ticker's SIC code. | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | +**ticker_root** | **string** | The root of a specified ticker. For example, the root of BRK.A is BRK. | [optional] +**ticker_suffix** | **string** | The suffix of a specified ticker. For example, the suffix of BRK.A is A. | [optional] +**total_employees** | **float** | The approximate number of employees for the company. | [optional] +**type** | **string** | The type of the asset. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). | [optional] +**weighted_shares_outstanding** | **float** | The shares outstanding calculated assuming all shares of other share classes are converted to this share class. | [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/GetTicker200ResponseResultsAddress.md b/docs/Model/GetTicker200ResponseResultsAddress.md new file mode 100644 index 0000000..44e4e2b --- /dev/null +++ b/docs/Model/GetTicker200ResponseResultsAddress.md @@ -0,0 +1,12 @@ +# # GetTicker200ResponseResultsAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address1** | **string** | The first line of the company's headquarters address. | [optional] +**city** | **string** | The city of the company's headquarters address. | [optional] +**postal_code** | **string** | The postal code of the company's headquarters address. | [optional] +**state** | **string** | The state of the company's headquarters address. | [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/GetTicker200ResponseResultsBranding.md b/docs/Model/GetTicker200ResponseResultsBranding.md new file mode 100644 index 0000000..ed46aba --- /dev/null +++ b/docs/Model/GetTicker200ResponseResultsBranding.md @@ -0,0 +1,10 @@ +# # GetTicker200ResponseResultsBranding + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon_url** | **string** | A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. | [optional] +**logo_url** | **string** | A link to this ticker's company's logo. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more 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/IndexAggsBase.md b/docs/Model/IndexAggsBase.md new file mode 100644 index 0000000..edc695e --- /dev/null +++ b/docs/Model/IndexAggsBase.md @@ -0,0 +1,12 @@ +# # IndexAggsBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesGroupedResults.md b/docs/Model/IndicesGroupedResults.md new file mode 100644 index 0000000..12ad5b4 --- /dev/null +++ b/docs/Model/IndicesGroupedResults.md @@ -0,0 +1,9 @@ +# # IndicesGroupedResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]**](V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesOpenClose.md b/docs/Model/IndicesOpenClose.md new file mode 100644 index 0000000..3a416ab --- /dev/null +++ b/docs/Model/IndicesOpenClose.md @@ -0,0 +1,17 @@ +# # IndicesOpenClose + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **float** | The close value of the ticker symbol in after hours trading. | [optional] +**close** | **float** | The close value for the symbol in the given time period. | +**from** | **\DateTime** | The requested date. | +**high** | **float** | The highest value for the symbol in the given time period. | +**low** | **float** | The lowest value for the symbol in the given time period. | +**open** | **float** | The open value for the symbol in the given time period. | +**pre_market** | **int** | The open value of the ticker symbol in pre-market trading. | [optional] +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The exchange symbol that this item is traded under. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesSnapshot200Response.md b/docs/Model/IndicesSnapshot200Response.md new file mode 100644 index 0000000..7ed9313 --- /dev/null +++ b/docs/Model/IndicesSnapshot200Response.md @@ -0,0 +1,12 @@ +# # IndicesSnapshot200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInner[]**](IndicesSnapshot200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesSnapshot200ResponseResultsInner.md b/docs/Model/IndicesSnapshot200ResponseResultsInner.md new file mode 100644 index 0000000..db757ab --- /dev/null +++ b/docs/Model/IndicesSnapshot200ResponseResultsInner.md @@ -0,0 +1,18 @@ +# # IndicesSnapshot200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | The error while looking for this ticker. | [optional] +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**market_status** | **string** | The market status for the market that trades this ticker. | [optional] +**message** | **string** | The error message while looking for this ticker. | [optional] +**name** | **string** | Name of Index. | [optional] +**session** | [**\OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInnerSession**](IndicesSnapshot200ResponseResultsInnerSession.md) | | [optional] +**ticker** | **string** | Ticker of asset queried. | +**timeframe** | **string** | The time relevance of the data. | +**type** | **string** | The indices market. | [optional] +**value** | **float** | Value of Index. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesSnapshot200ResponseResultsInnerSession.md b/docs/Model/IndicesSnapshot200ResponseResultsInnerSession.md new file mode 100644 index 0000000..bf91dd7 --- /dev/null +++ b/docs/Model/IndicesSnapshot200ResponseResultsInnerSession.md @@ -0,0 +1,15 @@ +# # IndicesSnapshot200ResponseResultsInnerSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change** | **float** | The value of the change for the index from the previous trading day. | [optional] +**change_percent** | **float** | The percent of the change for the index from the previous trading day. | [optional] +**close** | **float** | The closing value for the index of the day. | [optional] +**high** | **float** | The highest value for the index of the day. | [optional] +**low** | **float** | The lowest value for the index of the day. | [optional] +**open** | **float** | The open value for the index of the day. | [optional] +**previous_close** | **float** | The closing value for the index of previous trading day. | [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/IndicesTickerResults.md b/docs/Model/IndicesTickerResults.md new file mode 100644 index 0000000..951478c --- /dev/null +++ b/docs/Model/IndicesTickerResults.md @@ -0,0 +1,9 @@ +# # IndicesTickerResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\IndicesTickerResultsResultsInner[]**](IndicesTickerResultsResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesTickerResultsResultsInner.md b/docs/Model/IndicesTickerResultsResultsInner.md new file mode 100644 index 0000000..3df3f45 --- /dev/null +++ b/docs/Model/IndicesTickerResultsResultsInner.md @@ -0,0 +1,14 @@ +# # IndicesTickerResultsResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close value for the symbol in the given time period. | +**h** | **float** | The highest value for the symbol in the given time period. | +**l** | **float** | The lowest value for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open value for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastQuote200Response.md b/docs/Model/LastQuote200Response.md new file mode 100644 index 0000000..07f99f5 --- /dev/null +++ b/docs/Model/LastQuote200Response.md @@ -0,0 +1,11 @@ +# # LastQuote200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | +**results** | [**\OpenAPI\Client\Model\LastQuote200ResponseResults**](LastQuote200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastQuote200ResponseResults.md b/docs/Model/LastQuote200ResponseResults.md new file mode 100644 index 0000000..164f6da --- /dev/null +++ b/docs/Model/LastQuote200ResponseResults.md @@ -0,0 +1,22 @@ +# # LastQuote200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p** | **float** | The ask price. | [optional] +**s** | **int** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | [optional] +**t** | **string** | The exchange symbol that this item is traded under. | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**c** | **int[]** | A list of condition codes. | [optional] +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | [optional] +**i** | **int[]** | A list of indicator codes. | [optional] +**p** | **float** | The bid price. | [optional] +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**s** | **int** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | [optional] +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | [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/LastQuoteCurrencies200Response.md b/docs/Model/LastQuoteCurrencies200Response.md new file mode 100644 index 0000000..b13d647 --- /dev/null +++ b/docs/Model/LastQuoteCurrencies200Response.md @@ -0,0 +1,12 @@ +# # LastQuoteCurrencies200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last** | [**\OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast**](RealTimeCurrencyConversion200ResponseLast.md) | | [optional] +**request_id** | **string** | A request id assigned by the server. | +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastTradeCrypto200Response.md b/docs/Model/LastTradeCrypto200Response.md new file mode 100644 index 0000000..5c1222a --- /dev/null +++ b/docs/Model/LastTradeCrypto200Response.md @@ -0,0 +1,12 @@ +# # LastTradeCrypto200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last** | [**\OpenAPI\Client\Model\LastTradeCrypto200ResponseLast**](LastTradeCrypto200ResponseLast.md) | | [optional] +**request_id** | **string** | A request id assigned by the server. | +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastTradeCrypto200ResponseLast.md b/docs/Model/LastTradeCrypto200ResponseLast.md new file mode 100644 index 0000000..8526e6c --- /dev/null +++ b/docs/Model/LastTradeCrypto200ResponseLast.md @@ -0,0 +1,13 @@ +# # LastTradeCrypto200ResponseLast + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**exchange** | **int** | The exchange that this crypto trade happened on. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**size** | **float** | The size of a trade (also known as volume). | +**timestamp** | **int** | The Unix millisecond timestamp. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastTradeOptions200Response.md b/docs/Model/LastTradeOptions200Response.md new file mode 100644 index 0000000..a251a0f --- /dev/null +++ b/docs/Model/LastTradeOptions200Response.md @@ -0,0 +1,11 @@ +# # LastTradeOptions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | +**results** | [**\OpenAPI\Client\Model\LastTradeOptions200ResponseResults**](LastTradeOptions200ResponseResults.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastTradeOptions200ResponseResults.md b/docs/Model/LastTradeOptions200ResponseResults.md new file mode 100644 index 0000000..9f10608 --- /dev/null +++ b/docs/Model/LastTradeOptions200ResponseResults.md @@ -0,0 +1,21 @@ +# # LastTradeOptions200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**c** | **int[]** | A list of condition codes. | [optional] +**e** | **int** | The trade correction indicator. | [optional] +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | [optional] +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**r** | **int** | The ID for the Trade Reporting Facility where the trade took place. | [optional] +**s** | **float** | The size of a trade (also known as volume). | [optional] +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | [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/ListConditions200Response.md b/docs/Model/ListConditions200Response.md new file mode 100644 index 0000000..3373395 --- /dev/null +++ b/docs/Model/ListConditions200Response.md @@ -0,0 +1,13 @@ +# # ListConditions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request ID assigned by the server. | +**results** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInner[]**](ListConditions200ResponseResultsInner.md) | An array of conditions that match your query. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListConditions200ResponseResultsInner.md b/docs/Model/ListConditions200ResponseResultsInner.md new file mode 100644 index 0000000..a0fc327 --- /dev/null +++ b/docs/Model/ListConditions200ResponseResultsInner.md @@ -0,0 +1,19 @@ +# # ListConditions200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**abbreviation** | **string** | A commonly-used abbreviation for this condition. | [optional] +**asset_class** | **string** | An identifier for a group of similar financial instruments. | +**data_types** | **string[]** | Data types that this condition applies to. | +**description** | **string** | A short description of the semantics of this condition. | [optional] +**exchange** | **int** | If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute. In other words, data with this condition attached comes exclusively from the given exchange. | [optional] +**id** | **int** | An identifier used by Polygon.io for this condition. Unique per data type. | +**legacy** | **bool** | If true, this condition is from an old version of the SIPs' specs and no longer is used. Other conditions may or may not reuse the same symbol as this one. | [optional] +**name** | **string** | The name of this condition. | +**sip_mapping** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerSipMapping**](ListConditions200ResponseResultsInnerSipMapping.md) | | +**type** | **string** | An identifier for a collection of related conditions. | +**update_rules** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRules**](ListConditions200ResponseResultsInnerUpdateRules.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListConditions200ResponseResultsInnerSipMapping.md b/docs/Model/ListConditions200ResponseResultsInnerSipMapping.md new file mode 100644 index 0000000..6051cfa --- /dev/null +++ b/docs/Model/ListConditions200ResponseResultsInnerSipMapping.md @@ -0,0 +1,11 @@ +# # ListConditions200ResponseResultsInnerSipMapping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cta** | **string** | | [optional] +**opra** | **string** | | [optional] +**utp** | **string** | | [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/ListConditions200ResponseResultsInnerUpdateRules.md b/docs/Model/ListConditions200ResponseResultsInnerUpdateRules.md new file mode 100644 index 0000000..a4e46cd --- /dev/null +++ b/docs/Model/ListConditions200ResponseResultsInnerUpdateRules.md @@ -0,0 +1,10 @@ +# # ListConditions200ResponseResultsInnerUpdateRules + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**consolidated** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesConsolidated**](ListConditions200ResponseResultsInnerUpdateRulesConsolidated.md) | | +**market_center** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesMarketCenter**](ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.md b/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.md new file mode 100644 index 0000000..fce1ac9 --- /dev/null +++ b/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.md @@ -0,0 +1,11 @@ +# # ListConditions200ResponseResultsInnerUpdateRulesConsolidated + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updates_high_low** | **bool** | Whether or not trades with this condition update the high/low. | +**updates_open_close** | **bool** | Whether or not trades with this condition update the open/close. | +**updates_volume** | **bool** | Whether or not trades with this condition update the volume. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.md b/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.md new file mode 100644 index 0000000..e6b5ac2 --- /dev/null +++ b/docs/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.md @@ -0,0 +1,11 @@ +# # ListConditions200ResponseResultsInnerUpdateRulesMarketCenter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updates_high_low** | **bool** | Whether or not trades with this condition update the high/low. | +**updates_open_close** | **bool** | Whether or not trades with this condition update the open/close. | +**updates_volume** | **bool** | Whether or not trades with this condition update the volume. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListConditions400Response.md b/docs/Model/ListConditions400Response.md new file mode 100644 index 0000000..a88ef0b --- /dev/null +++ b/docs/Model/ListConditions400Response.md @@ -0,0 +1,13 @@ +# # ListConditions400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request ID assigned by the server. | +**results** | [**\OpenAPI\Client\Model\ListConditions200ResponseResultsInner[]**](ListConditions200ResponseResultsInner.md) | An array of conditions that match your query. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListDividends200Response.md b/docs/Model/ListDividends200Response.md new file mode 100644 index 0000000..3212593 --- /dev/null +++ b/docs/Model/ListDividends200Response.md @@ -0,0 +1,12 @@ +# # ListDividends200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\ListDividends200ResponseResultsInner[]**](ListDividends200ResponseResultsInner.md) | | [optional] +**status** | **string** | | [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/ListDividends200ResponseResultsInner.md b/docs/Model/ListDividends200ResponseResultsInner.md new file mode 100644 index 0000000..c931a19 --- /dev/null +++ b/docs/Model/ListDividends200ResponseResultsInner.md @@ -0,0 +1,17 @@ +# # ListDividends200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cash_amount** | **float** | The cash amount of the dividend per share owned. | +**currency** | **string** | The currency in which the dividend is paid. | [optional] +**declaration_date** | **string** | The date that the dividend was announced. | [optional] +**dividend_type** | **string** | The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. Long-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively. | +**ex_dividend_date** | **string** | The date that the stock first trades without the dividend, determined by the exchange. | +**frequency** | **int** | The number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). | +**pay_date** | **string** | The date that the dividend is paid out. | [optional] +**record_date** | **string** | The date that the stock must be held to receive the dividend, set by the company. | [optional] +**ticker** | **string** | The ticker symbol of the dividend. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListExchanges200Response.md b/docs/Model/ListExchanges200Response.md new file mode 100644 index 0000000..96fb13a --- /dev/null +++ b/docs/Model/ListExchanges200Response.md @@ -0,0 +1,12 @@ +# # ListExchanges200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**request_id** | **string** | A request ID assigned by the server. | +**results** | [**\OpenAPI\Client\Model\ListExchanges200ResponseResultsInner[]**](ListExchanges200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListExchanges200ResponseResultsInner.md b/docs/Model/ListExchanges200ResponseResultsInner.md new file mode 100644 index 0000000..f81aa22 --- /dev/null +++ b/docs/Model/ListExchanges200ResponseResultsInner.md @@ -0,0 +1,18 @@ +# # ListExchanges200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acronym** | **string** | A commonly used abbreviation for this exchange. | [optional] +**asset_class** | **string** | An identifier for a group of similar financial instruments. | +**id** | **int** | A unique identifier used by Polygon.io for this exchange. | +**locale** | **string** | An identifier for a geographical location. | +**mic** | **string** | The Market Identifer Code of this exchange (see ISO 10383). | [optional] +**name** | **string** | Name of this exchange. | +**operating_mic** | **string** | The MIC of the entity that operates this exchange. | [optional] +**participant_id** | **string** | The ID used by SIP's to represent this exchange. | [optional] +**type** | **string** | Represents the type of exchange. | +**url** | **string** | A link to this exchange's website, if one exists. | [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/ListExchanges400Response.md b/docs/Model/ListExchanges400Response.md new file mode 100644 index 0000000..bcc14a4 --- /dev/null +++ b/docs/Model/ListExchanges400Response.md @@ -0,0 +1,11 @@ +# # ListExchanges400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**request_id** | **string** | A request ID assigned by the server. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilingFiles200Response.md b/docs/Model/ListFilingFiles200Response.md new file mode 100644 index 0000000..9d75dd9 --- /dev/null +++ b/docs/Model/ListFilingFiles200Response.md @@ -0,0 +1,13 @@ +# # ListFilingFiles200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | +**next_url** | **string** | | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner[]**](ListFilingFiles200ResponseResultsInner.md) | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilingFiles200ResponseResultsInner.md b/docs/Model/ListFilingFiles200ResponseResultsInner.md new file mode 100644 index 0000000..6c89c15 --- /dev/null +++ b/docs/Model/ListFilingFiles200ResponseResultsInner.md @@ -0,0 +1,15 @@ +# # ListFilingFiles200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | A description for the contents of the file. | +**filename** | **string** | The name for the file. | [optional] +**id** | **string** | An identifier unique to the filing for this data entry. | +**sequence** | **int** | File Sequence Number | +**size_bytes** | **int** | The size of the file in bytes. | +**source_url** | **string** | The source URL is a link back to the upstream source for this file. | +**type** | **string** | The type of document contained in the file. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilings200Response.md b/docs/Model/ListFilings200Response.md new file mode 100644 index 0000000..e7f5e15 --- /dev/null +++ b/docs/Model/ListFilings200Response.md @@ -0,0 +1,13 @@ +# # ListFilings200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | +**next_url** | **string** | | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\ListFilings200ResponseResultsInner[]**](ListFilings200ResponseResultsInner.md) | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilings200ResponseResultsInner.md b/docs/Model/ListFilings200ResponseResultsInner.md new file mode 100644 index 0000000..5f82e1c --- /dev/null +++ b/docs/Model/ListFilings200ResponseResultsInner.md @@ -0,0 +1,17 @@ +# # ListFilings200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acceptance_datetime** | **string** | The datetime when the filing was accepted by EDGAR in EST (format: YYYYMMDDHHMMSS) | +**accession_number** | **string** | Filing Accession Number | +**entities** | [**\OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInner[]**](ListFilings200ResponseResultsInnerEntitiesInner.md) | Entities related to the filing (e.g. the document filers). | +**files_count** | **int** | The number of files associated with the filing. | +**filing_date** | **string** | The date when the filing was filed in YYYYMMDD format. | +**id** | **string** | Unique identifier for the filing. | +**period_of_report_date** | **string** | The period of report for the filing in YYYYMMDD format. | +**source_url** | **string** | The source URL is a link back to the upstream source for this filing document. | +**type** | **string** | Filing Type | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilings200ResponseResultsInnerEntitiesInner.md b/docs/Model/ListFilings200ResponseResultsInnerEntitiesInner.md new file mode 100644 index 0000000..1a552a5 --- /dev/null +++ b/docs/Model/ListFilings200ResponseResultsInnerEntitiesInner.md @@ -0,0 +1,10 @@ +# # ListFilings200ResponseResultsInnerEntitiesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_data** | [**\OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInnerCompanyData**](ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.md) | | [optional] +**relation** | **string** | Relationship of this entity to the filing. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.md b/docs/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.md new file mode 100644 index 0000000..adcaf27 --- /dev/null +++ b/docs/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.md @@ -0,0 +1,12 @@ +# # ListFilings200ResponseResultsInnerEntitiesInnerCompanyData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cik** | **string** | Central Index Key (CIK) Number | +**name** | **string** | | +**sic** | **string** | Standard Industrial Classification (SIC) | +**ticker** | **string** | Ticker | [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/ListFinancials200Response.md b/docs/Model/ListFinancials200Response.md new file mode 100644 index 0000000..dafca58 --- /dev/null +++ b/docs/Model/ListFinancials200Response.md @@ -0,0 +1,13 @@ +# # ListFinancials200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | +**results** | [**\OpenAPI\Client\Model\ListFinancials200ResponseResultsInner[]**](ListFinancials200ResponseResultsInner.md) | | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFinancials200ResponseResultsInner.md b/docs/Model/ListFinancials200ResponseResultsInner.md new file mode 100644 index 0000000..cc1e0d8 --- /dev/null +++ b/docs/Model/ListFinancials200ResponseResultsInner.md @@ -0,0 +1,21 @@ +# # ListFinancials200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acceptance_datetime** | **mixed** | The datetime (EST timezone) the filing was accepted by EDGAR in YYYYMMDDHHMMSS format. | [optional] +**cik** | **string** | The CIK number for the company. | +**company_name** | **string** | The company name. | +**end_date** | **string** | The end date of the period that these financials cover in YYYYMMDD format. | [optional] +**filing_date** | **mixed** | The date that the SEC filing which these financials were derived from was made available. Note that this is not necessarily the date when this information became public, as some companies may publish a press release before filing with the SEC. | [optional] +**financials** | [**\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancials**](ListFinancials200ResponseResultsInnerFinancials.md) | | +**fiscal_period** | **string** | Fiscal period of the report according to the company (Q1, Q2, Q3, Q4, or FY). | +**fiscal_year** | **string** | Fiscal year of the report according to the company. | [optional] +**source_filing_file_url** | **mixed** | The URL of the specific XBRL instance document within the SEC filing that these financials were derived from. | [optional] +**source_filing_url** | **string** | The URL of the SEC filing that these financials were derived from. | [optional] +**start_date** | **string** | The start date of the period that these financials cover in YYYYMMDD format. | [optional] +**tickers** | **string[]** | The list of ticker symbols for the company. | [optional] +**timeframe** | **string** | The timeframe of the report (quarterly, annual or ttm). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListFinancials200ResponseResultsInnerFinancials.md b/docs/Model/ListFinancials200ResponseResultsInnerFinancials.md new file mode 100644 index 0000000..5b90e67 --- /dev/null +++ b/docs/Model/ListFinancials200ResponseResultsInnerFinancials.md @@ -0,0 +1,12 @@ +# # ListFinancials200ResponseResultsInnerFinancials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance_sheet** | [**\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet**](ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.md) | | [optional] +**cash_flow_statement** | **object** | Cash flow statement. The keys in this object can be any of the fields listed in the Cash Flow Statement section of the <a target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\">financials API glossary of terms</a>. See the attributes of the objects within `balance_sheet` for more details. | [optional] +**comprehensive_income** | **object** | Comprehensive income. The keys in this object can be any of the fields listed in the Comprehensive Income section of the <a target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\">financials API glossary of terms</a>. See the attributes of the objects within `balance_sheet` for more details. | [optional] +**income_statement** | **object** | Income statement. The keys in this object can be any of the fields listed in the Income Statement section of the <a target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\">financials API glossary of terms</a>. See the attributes of the objects within `balance_sheet` for more 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/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.md b/docs/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.md new file mode 100644 index 0000000..08c923d --- /dev/null +++ b/docs/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.md @@ -0,0 +1,9 @@ +# # ListFinancials200ResponseResultsInnerFinancialsBalanceSheet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**** | [**\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet**](ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListNews200Response.md b/docs/Model/ListNews200Response.md new file mode 100644 index 0000000..2346b36 --- /dev/null +++ b/docs/Model/ListNews200Response.md @@ -0,0 +1,13 @@ +# # ListNews200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\ListNews200ResponseResultsInner[]**](ListNews200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/ListNews200ResponseResultsInner.md b/docs/Model/ListNews200ResponseResultsInner.md new file mode 100644 index 0000000..6f28bcf --- /dev/null +++ b/docs/Model/ListNews200ResponseResultsInner.md @@ -0,0 +1,19 @@ +# # ListNews200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amp_url** | **string** | The mobile friendly Accelerated Mobile Page (AMP) URL. | [optional] +**article_url** | **string** | A link to the news article. | +**author** | **string** | The article's author. | +**description** | **string** | A description of the article. | [optional] +**id** | **string** | Unique identifier for the article. | +**image_url** | **string** | The article's image URL. | [optional] +**keywords** | **string[]** | The keywords associated with the article (which will vary depending on the publishing source). | [optional] +**published_utc** | **\DateTime** | The date the article was published on. | +**publisher** | [**\OpenAPI\Client\Model\ListNews200ResponseResultsInnerPublisher**](ListNews200ResponseResultsInnerPublisher.md) | | +**tickers** | **string[]** | The ticker symbols associated with the article. | +**title** | **string** | The title of the news article. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListNews200ResponseResultsInnerPublisher.md b/docs/Model/ListNews200ResponseResultsInnerPublisher.md new file mode 100644 index 0000000..222c9ff --- /dev/null +++ b/docs/Model/ListNews200ResponseResultsInnerPublisher.md @@ -0,0 +1,12 @@ +# # ListNews200ResponseResultsInnerPublisher + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**favicon_url** | **string** | The publisher's homepage favicon URL. | [optional] +**homepage_url** | **string** | The publisher's homepage URL. | +**logo_url** | **string** | The publisher's logo URL. | +**name** | **string** | The publisher's name. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListNewsPublishedUtcParameter.md b/docs/Model/ListNewsPublishedUtcParameter.md new file mode 100644 index 0000000..dad6448 --- /dev/null +++ b/docs/Model/ListNewsPublishedUtcParameter.md @@ -0,0 +1,8 @@ +# # ListNewsPublishedUtcParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListOptionsContracts200Response.md b/docs/Model/ListOptionsContracts200Response.md new file mode 100644 index 0000000..7a5ea6a --- /dev/null +++ b/docs/Model/ListOptionsContracts200Response.md @@ -0,0 +1,12 @@ +# # ListOptionsContracts200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | [optional] +**results** | [**\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner[]**](ListOptionsContracts200ResponseResultsInner.md) | | [optional] +**status** | **string** | | [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/ListOptionsContracts200ResponseResultsInner.md b/docs/Model/ListOptionsContracts200ResponseResultsInner.md new file mode 100644 index 0000000..b187a16 --- /dev/null +++ b/docs/Model/ListOptionsContracts200ResponseResultsInner.md @@ -0,0 +1,19 @@ +# # ListOptionsContracts200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_underlyings** | [**\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner[]**](ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.md) | If an option contract has additional underlyings or deliverables associated with it, they will appear here. See <a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.optionseducation.org/referencelibrary/faq/splits-mergers-spinoffs-bankruptcies\">here</a> for some examples of what might cause a contract to have additional underlyings. | [optional] +**cfi** | **string** | The 6 letter CFI code of the contract (defined in <a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/ISO_10962\">ISO 10962</a>) | [optional] +**contract_type** | **string** | The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". | [optional] +**correction** | **int** | The correction number for this option contract. | [optional] +**exercise_style** | **string** | The exercise style of this contract. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Option_style\">this link</a> for more details on exercise styles. | [optional] +**expiration_date** | **string** | The contract's expiration date in YYYY-MM-DD format. | [optional] +**primary_exchange** | **string** | The MIC code of the primary exchange that this contract is listed on. | [optional] +**shares_per_contract** | **float** | The number of shares per contract for this contract. | [optional] +**strike_price** | **float** | The strike price of the option contract. | [optional] +**ticker** | **string** | The ticker for the option contract. | [optional] +**underlying_ticker** | **string** | The underlying ticker that the option contract relates to. | [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/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.md b/docs/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.md new file mode 100644 index 0000000..a53c77c --- /dev/null +++ b/docs/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.md @@ -0,0 +1,11 @@ +# # ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | The number of shares per contract of the additional underlying, or the cash-in-lieu amount of the currency. | [optional] +**type** | **string** | The type of the additional underlying asset, either equity or currency. | [optional] +**underlying** | **string** | The name of the additional underlying asset. | [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/ListStockSplits200Response.md b/docs/Model/ListStockSplits200Response.md new file mode 100644 index 0000000..0499094 --- /dev/null +++ b/docs/Model/ListStockSplits200Response.md @@ -0,0 +1,12 @@ +# # ListStockSplits200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | [optional] +**results** | [**\OpenAPI\Client\Model\ListStockSplits200ResponseResultsInner[]**](ListStockSplits200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | [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/ListStockSplits200ResponseResultsInner.md b/docs/Model/ListStockSplits200ResponseResultsInner.md new file mode 100644 index 0000000..ee3efc4 --- /dev/null +++ b/docs/Model/ListStockSplits200ResponseResultsInner.md @@ -0,0 +1,12 @@ +# # ListStockSplits200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**execution_date** | **string** | The execution date of the stock split. On this date the stock split was applied. | [optional] +**split_from** | **float** | The second number in the split ratio. For example: In a 2-for-1 split, split_from would be 1. | +**split_to** | **float** | The first number in the split ratio. For example: In a 2-for-1 split, split_to would be 2. | +**ticker** | **string** | The ticker symbol of the stock split. | [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/ListTickerTaxonomyClassifications200Response.md b/docs/Model/ListTickerTaxonomyClassifications200Response.md new file mode 100644 index 0000000..d5a9fe5 --- /dev/null +++ b/docs/Model/ListTickerTaxonomyClassifications200Response.md @@ -0,0 +1,12 @@ +# # ListTickerTaxonomyClassifications200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200ResponseResultsInner[]**](ListTickerTaxonomyClassifications200ResponseResultsInner.md) | | [optional] +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListTickerTaxonomyClassifications200ResponseResultsInner.md b/docs/Model/ListTickerTaxonomyClassifications200ResponseResultsInner.md new file mode 100644 index 0000000..915b856 --- /dev/null +++ b/docs/Model/ListTickerTaxonomyClassifications200ResponseResultsInner.md @@ -0,0 +1,13 @@ +# # ListTickerTaxonomyClassifications200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **string** | The classification category. | [optional] +**reason** | **string** | The reason why the classification was given. | [optional] +**relevance** | **float** | The relevance score for the tag. This is a measure of confidence in the tag classification. | [optional] +**tag** | **string** | The classification tag. Each category has a set of associated tags. | [optional] +**ticker** | **string** | The ticker symbol for the asset. | [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/ListTickerTypes200Response.md b/docs/Model/ListTickerTypes200Response.md new file mode 100644 index 0000000..d9e44ab --- /dev/null +++ b/docs/Model/ListTickerTypes200Response.md @@ -0,0 +1,12 @@ +# # ListTickerTypes200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**request_id** | **string** | A request ID assigned by the server. | +**results** | [**\OpenAPI\Client\Model\ListTickerTypes200ResponseResultsInner[]**](ListTickerTypes200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListTickerTypes200ResponseResultsInner.md b/docs/Model/ListTickerTypes200ResponseResultsInner.md new file mode 100644 index 0000000..a75b4a2 --- /dev/null +++ b/docs/Model/ListTickerTypes200ResponseResultsInner.md @@ -0,0 +1,12 @@ +# # ListTickerTypes200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_class** | **string** | An identifier for a group of similar financial instruments. | +**code** | **string** | A code used by Polygon.io to refer to this ticker type. | +**description** | **string** | A short description of this ticker type. | +**locale** | **string** | An identifier for a geographical location. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListTickers200Response.md b/docs/Model/ListTickers200Response.md new file mode 100644 index 0000000..6947596 --- /dev/null +++ b/docs/Model/ListTickers200Response.md @@ -0,0 +1,13 @@ +# # ListTickers200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | A request id assigned by the server. | [optional] +**results** | [**\OpenAPI\Client\Model\ListTickers200ResponseResultsInner[]**](ListTickers200ResponseResultsInner.md) | An array of tickers that match your query. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. | [optional] +**status** | **string** | The status of this request's response. | [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/ListTickers200ResponseResultsInner.md b/docs/Model/ListTickers200ResponseResultsInner.md new file mode 100644 index 0000000..972bdf4 --- /dev/null +++ b/docs/Model/ListTickers200ResponseResultsInner.md @@ -0,0 +1,21 @@ +# # ListTickers200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Whether or not the asset is actively traded. False means the asset has been delisted. | [optional] +**cik** | **string** | The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key). | [optional] +**composite_figi** | **string** | The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) | [optional] +**currency_name** | **string** | The name of the currency that this asset is traded with. | [optional] +**delisted_utc** | **\DateTime** | The last date that the asset was traded. | [optional] +**last_updated_utc** | **\DateTime** | The information is accurate up to this time. | [optional] +**locale** | **string** | The locale of the asset. | +**market** | **string** | The market type of the asset. | +**name** | **string** | The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair. | +**primary_exchange** | **string** | The ISO code of the primary listing exchange for this asset. | [optional] +**share_class_figi** | **string** | The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | +**type** | **string** | The type of the asset. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). | [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/Locales.md b/docs/Model/Locales.md new file mode 100644 index 0000000..7d6b0f9 --- /dev/null +++ b/docs/Model/Locales.md @@ -0,0 +1,9 @@ +# # Locales + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\LocalesResultsInner[]**](LocalesResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LocalesResultsInner.md b/docs/Model/LocalesResultsInner.md new file mode 100644 index 0000000..4de5f2d --- /dev/null +++ b/docs/Model/LocalesResultsInner.md @@ -0,0 +1,10 @@ +# # LocalesResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**locale** | **string** | An abbreviated country name. | [optional] +**name** | **string** | The name of the country. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Map.md b/docs/Model/Map.md new file mode 100644 index 0000000..167b2ed --- /dev/null +++ b/docs/Model/Map.md @@ -0,0 +1,9 @@ +# # Map + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | [**\OpenAPI\Client\Model\MapKey**](MapKey.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MapKey.md b/docs/Model/MapKey.md new file mode 100644 index 0000000..0bdf0d4 --- /dev/null +++ b/docs/Model/MapKey.md @@ -0,0 +1,10 @@ +# # MapKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The descriptive name of this results key | [optional] +**type** | **string** | The data type of this results key | [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/MarketHolidayInner.md b/docs/Model/MarketHolidayInner.md new file mode 100644 index 0000000..e8bc574 --- /dev/null +++ b/docs/Model/MarketHolidayInner.md @@ -0,0 +1,14 @@ +# # MarketHolidayInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**close** | **\DateTime** | The market close time on the holiday (if it's not closed). | [optional] +**date** | **\DateTime** | The date of the holiday. | [optional] +**exchange** | **string** | Which market the record is for. | [optional] +**name** | **string** | The name of the holiday. | [optional] +**open** | **\DateTime** | The market open time on the holiday (if it's not closed). | [optional] +**status** | **string** | The status of the market on the holiday. | [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..bfe626b --- /dev/null +++ b/docs/Model/MarketStatus.md @@ -0,0 +1,14 @@ +# # MarketStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **bool** | Whether or not the market is in post-market hours. | [optional] +**currencies** | [**\OpenAPI\Client\Model\MarketStatusCurrencies**](MarketStatusCurrencies.md) | | [optional] +**early_hours** | **bool** | Whether or not the market is in pre-market hours. | [optional] +**exchanges** | [**\OpenAPI\Client\Model\MarketStatusExchanges**](MarketStatusExchanges.md) | | [optional] +**market** | **string** | The status of the market as a whole. | [optional] +**server_time** | **\DateTime** | The current time of the server. | [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/MarketStatusCurrencies.md b/docs/Model/MarketStatusCurrencies.md new file mode 100644 index 0000000..e58f7d2 --- /dev/null +++ b/docs/Model/MarketStatusCurrencies.md @@ -0,0 +1,10 @@ +# # MarketStatusCurrencies + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crypto** | **string** | The status of the crypto market. | [optional] +**fx** | **string** | The status of the forex market. | [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/MarketStatusExchanges.md b/docs/Model/MarketStatusExchanges.md new file mode 100644 index 0000000..88743f5 --- /dev/null +++ b/docs/Model/MarketStatusExchanges.md @@ -0,0 +1,11 @@ +# # MarketStatusExchanges + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nasdaq** | **string** | The status of the Nasdaq market. | [optional] +**nyse** | **string** | The status of the NYSE market. | [optional] +**otc** | **string** | The status of the OTC market. | [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/Markets.md b/docs/Model/Markets.md new file mode 100644 index 0000000..63a59a8 --- /dev/null +++ b/docs/Model/Markets.md @@ -0,0 +1,9 @@ +# # Markets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\MarketsResultsInner[]**](MarketsResultsInner.md) | A list of supported markets. | [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/MarketsResultsInner.md b/docs/Model/MarketsResultsInner.md new file mode 100644 index 0000000..64dd043 --- /dev/null +++ b/docs/Model/MarketsResultsInner.md @@ -0,0 +1,10 @@ +# # MarketsResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**desc** | **string** | A description of the market. | [optional] +**market** | **string** | The name of the market. | [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/NewsInner.md b/docs/Model/NewsInner.md new file mode 100644 index 0000000..17177f9 --- /dev/null +++ b/docs/Model/NewsInner.md @@ -0,0 +1,16 @@ +# # NewsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **string** | A URL of the image for the news article, if found. | [optional] +**keywords** | **string[]** | A list of common keywords related to the news article. | [optional] +**source** | **string** | The publication source of the article. | [optional] +**summary** | **string** | A summary of the news article. | [optional] +**symbols** | **string[]** | A list of ticker symbols relating to the article. | [optional] +**timestamp** | **\DateTime** | The timestamp of the news article. | [optional] +**title** | **string** | The title of the news article. | [optional] +**url** | **string** | A direct link to the news article from its source publication. | [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/OptionContract200Response.md b/docs/Model/OptionContract200Response.md new file mode 100644 index 0000000..bc3d47a --- /dev/null +++ b/docs/Model/OptionContract200Response.md @@ -0,0 +1,12 @@ +# # OptionContract200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInner**](OptionsChain200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200Response.md b/docs/Model/OptionsChain200Response.md new file mode 100644 index 0000000..024307d --- /dev/null +++ b/docs/Model/OptionsChain200Response.md @@ -0,0 +1,12 @@ +# # OptionsChain200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInner[]**](OptionsChain200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200ResponseResultsInner.md b/docs/Model/OptionsChain200ResponseResultsInner.md new file mode 100644 index 0000000..95f4347 --- /dev/null +++ b/docs/Model/OptionsChain200ResponseResultsInner.md @@ -0,0 +1,18 @@ +# # OptionsChain200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**break_even_price** | **float** | The price of the underlying asset for the contract to break even. For a call, this value is (strike price + premium paid). For a put, this value is (strike price - premium paid). | +**day** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDay**](OptionsChain200ResponseResultsInnerDay.md) | | +**details** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDetails**](OptionsChain200ResponseResultsInnerDetails.md) | | +**fmv** | **float** | Fair market value is only available on Business plans. It's it our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\">contact us</a>. | [optional] +**greeks** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks**](Snapshots200ResponseResultsInnerGreeks.md) | | [optional] +**implied_volatility** | **float** | The market's forecast for the volatility of the underlying asset, based on this option's current price. | [optional] +**last_quote** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastQuote**](OptionsChain200ResponseResultsInnerLastQuote.md) | | +**last_trade** | [**\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastTrade**](OptionsChain200ResponseResultsInnerLastTrade.md) | | [optional] +**open_interest** | **float** | The quantity of this contract held at the end of the last trading day. | +**underlying_asset** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset**](Snapshots200ResponseResultsInnerUnderlyingAsset.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200ResponseResultsInnerDay.md b/docs/Model/OptionsChain200ResponseResultsInnerDay.md new file mode 100644 index 0000000..e9fce63 --- /dev/null +++ b/docs/Model/OptionsChain200ResponseResultsInnerDay.md @@ -0,0 +1,18 @@ +# # OptionsChain200ResponseResultsInnerDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change** | **float** | The value of the price change for the contract from the previous trading day. | +**change_percent** | **float** | The percent of the price change for the contract from the previous trading day. | +**close** | **float** | The closing price for the contract of the day. | +**high** | **float** | The highest price for the contract of the day. | +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**low** | **float** | The lowest price for the contract of the day. | +**open** | **float** | The open price for the contract of the day. | +**previous_close** | **float** | The closing price for the contract of previous trading day. | +**volume** | **float** | The trading volume for the contract of the day. | +**vwap** | **float** | The trading volume weighted average price for the contract of the day. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200ResponseResultsInnerDetails.md b/docs/Model/OptionsChain200ResponseResultsInnerDetails.md new file mode 100644 index 0000000..d1c2d25 --- /dev/null +++ b/docs/Model/OptionsChain200ResponseResultsInnerDetails.md @@ -0,0 +1,14 @@ +# # OptionsChain200ResponseResultsInnerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_type** | **string** | The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". | +**exercise_style** | **string** | The exercise style of this contract. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Option_style\">this link</a> for more details on exercise styles. | +**expiration_date** | **\DateTime** | The contract's expiration date in YYYY-MM-DD format. | +**shares_per_contract** | **float** | The number of shares per contract for this contract. | +**strike_price** | **float** | The strike price of the option contract. | +**ticker** | **string** | The ticker symbol for the asset. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200ResponseResultsInnerLastQuote.md b/docs/Model/OptionsChain200ResponseResultsInnerLastQuote.md new file mode 100644 index 0000000..88b7d8c --- /dev/null +++ b/docs/Model/OptionsChain200ResponseResultsInnerLastQuote.md @@ -0,0 +1,17 @@ +# # OptionsChain200ResponseResultsInnerLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask** | **float** | The ask price. | +**ask_exchange** | **float** | The ask side exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**ask_size** | **float** | The ask size. | +**bid** | **float** | The bid price. | +**bid_exchange** | **float** | The bid side exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**bid_size** | **float** | The bid size. | +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**midpoint** | **float** | The average of the bid and ask price. | +**timeframe** | **string** | The time relevance of the data. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OptionsChain200ResponseResultsInnerLastTrade.md b/docs/Model/OptionsChain200ResponseResultsInnerLastTrade.md new file mode 100644 index 0000000..6b82e88 --- /dev/null +++ b/docs/Model/OptionsChain200ResponseResultsInnerLastTrade.md @@ -0,0 +1,14 @@ +# # OptionsChain200ResponseResultsInnerLastTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. | +**size** | **int** | The size of a trade (also known as volume). | +**timeframe** | **string** | The time relevance of the data. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaginationHooksBase.md b/docs/Model/PaginationHooksBase.md new file mode 100644 index 0000000..08a2009 --- /dev/null +++ b/docs/Model/PaginationHooksBase.md @@ -0,0 +1,9 @@ +# # PaginationHooksBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Quotes200Response.md b/docs/Model/Quotes200Response.md new file mode 100644 index 0000000..69f381f --- /dev/null +++ b/docs/Model/Quotes200Response.md @@ -0,0 +1,11 @@ +# # Quotes200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\Quotes200ResponseResultsInner[]**](Quotes200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Quotes200ResponseResultsInner.md b/docs/Model/Quotes200ResponseResultsInner.md new file mode 100644 index 0000000..30f5f20 --- /dev/null +++ b/docs/Model/Quotes200ResponseResultsInner.md @@ -0,0 +1,21 @@ +# # Quotes200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask_exchange** | **int** | The ask exchange ID | [optional] +**ask_price** | **float** | The ask price. | [optional] +**ask_size** | **float** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | [optional] +**bid_exchange** | **int** | The bid exchange ID | [optional] +**bid_price** | **float** | The bid price. | [optional] +**bid_size** | **float** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | [optional] +**conditions** | **int[]** | A list of condition codes. | [optional] +**indicators** | **int[]** | A list of indicator codes. | [optional] +**participant_timestamp** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**sequence_number** | **int** | The sequence number represents the sequence in which quote events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day. | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it. | +**tape** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | [optional] +**trf_timestamp** | **int** | The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this quote. | [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/QuotesFx200Response.md b/docs/Model/QuotesFx200Response.md new file mode 100644 index 0000000..2eee0c6 --- /dev/null +++ b/docs/Model/QuotesFx200Response.md @@ -0,0 +1,11 @@ +# # QuotesFx200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\QuotesFx200ResponseResultsInner[]**](QuotesFx200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/QuotesFx200ResponseResultsInner.md b/docs/Model/QuotesFx200ResponseResultsInner.md new file mode 100644 index 0000000..c895ceb --- /dev/null +++ b/docs/Model/QuotesFx200ResponseResultsInner.md @@ -0,0 +1,13 @@ +# # QuotesFx200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask_exchange** | **int** | The ask exchange ID | [optional] +**ask_price** | **float** | The ask price. | [optional] +**bid_exchange** | **int** | The bid exchange ID | [optional] +**bid_price** | **float** | The bid price. | [optional] +**participant_timestamp** | **int** | The nanosecond Exchange Unix Timestamp. This is the timestamp of when the quote was generated at the exchange. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/QuotesOptions200Response.md b/docs/Model/QuotesOptions200Response.md new file mode 100644 index 0000000..70193cf --- /dev/null +++ b/docs/Model/QuotesOptions200Response.md @@ -0,0 +1,11 @@ +# # QuotesOptions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\QuotesOptions200ResponseResultsInner[]**](QuotesOptions200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/QuotesOptions200ResponseResultsInner.md b/docs/Model/QuotesOptions200ResponseResultsInner.md new file mode 100644 index 0000000..1d63e15 --- /dev/null +++ b/docs/Model/QuotesOptions200ResponseResultsInner.md @@ -0,0 +1,16 @@ +# # QuotesOptions200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask_exchange** | **int** | The ask exchange ID | [optional] +**ask_price** | **float** | The ask price. | [optional] +**ask_size** | **float** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | [optional] +**bid_exchange** | **int** | The bid exchange ID | [optional] +**bid_price** | **float** | The bid price. | [optional] +**bid_size** | **float** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | [optional] +**sequence_number** | **int** | The sequence number represents the sequence in which quote events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RatingSection.md b/docs/Model/RatingSection.md new file mode 100644 index 0000000..177961b --- /dev/null +++ b/docs/Model/RatingSection.md @@ -0,0 +1,14 @@ +# # RatingSection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current** | **float** | Analyst Rating at current month | +**month1** | **float** | Analyst Ratings at 1 month in the future | +**month2** | **float** | Analyst Ratings at 2 month in the future | +**month3** | **float** | Analyst Ratings at 3 month in the future | +**month4** | **float** | Analyst Ratings at 4 month in the future | [optional] +**month5** | **float** | Analyst Ratings at 5 month in the future | [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/RealTimeCurrencyConversion200Response.md b/docs/Model/RealTimeCurrencyConversion200Response.md new file mode 100644 index 0000000..ccb9b68 --- /dev/null +++ b/docs/Model/RealTimeCurrencyConversion200Response.md @@ -0,0 +1,16 @@ +# # RealTimeCurrencyConversion200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**converted** | **float** | The result of the conversion. | +**from** | **string** | The \"from\" currency symbol. | +**initial_amount** | **float** | The amount to convert. | +**last** | [**\OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast**](RealTimeCurrencyConversion200ResponseLast.md) | | [optional] +**request_id** | **string** | A request id assigned by the server. | +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The symbol pair that was evaluated from the request. | +**to** | **string** | The \"to\" currency symbol. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RealTimeCurrencyConversion200ResponseLast.md b/docs/Model/RealTimeCurrencyConversion200ResponseLast.md new file mode 100644 index 0000000..f733dd7 --- /dev/null +++ b/docs/Model/RealTimeCurrencyConversion200ResponseLast.md @@ -0,0 +1,12 @@ +# # RealTimeCurrencyConversion200ResponseLast + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask** | **float** | The ask price. | +**bid** | **float** | The bid price. | +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**timestamp** | **int** | The Unix millisecond timestamp. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RequestIdBase.md b/docs/Model/RequestIdBase.md new file mode 100644 index 0000000..b4349c7 --- /dev/null +++ b/docs/Model/RequestIdBase.md @@ -0,0 +1,9 @@ +# # RequestIdBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotMinOHLCV.md b/docs/Model/SnapshotMinOHLCV.md new file mode 100644 index 0000000..7e86f3a --- /dev/null +++ b/docs/Model/SnapshotMinOHLCV.md @@ -0,0 +1,15 @@ +# # SnapshotMinOHLCV + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | [optional] +**h** | **float** | The highest price for the symbol in the given time period. | [optional] +**l** | **float** | The lowest price for the symbol in the given time period. | [optional] +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | [optional] +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | [optional] +**v** | **float** | The trading volume of the symbol in the given time 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/SnapshotOHLCV.md b/docs/Model/SnapshotOHLCV.md new file mode 100644 index 0000000..772d58f --- /dev/null +++ b/docs/Model/SnapshotOHLCV.md @@ -0,0 +1,13 @@ +# # SnapshotOHLCV + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotOHLCVVW.md b/docs/Model/SnapshotOHLCVVW.md new file mode 100644 index 0000000..3238e90 --- /dev/null +++ b/docs/Model/SnapshotOHLCVVW.md @@ -0,0 +1,14 @@ +# # SnapshotOHLCVVW + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotOHLCVVWOtc.md b/docs/Model/SnapshotOHLCVVWOtc.md new file mode 100644 index 0000000..b09b61b --- /dev/null +++ b/docs/Model/SnapshotOHLCVVWOtc.md @@ -0,0 +1,15 @@ +# # SnapshotOHLCVVWOtc + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotSummary200Response.md b/docs/Model/SnapshotSummary200Response.md new file mode 100644 index 0000000..8b3bd02 --- /dev/null +++ b/docs/Model/SnapshotSummary200Response.md @@ -0,0 +1,11 @@ +# # SnapshotSummary200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInner[]**](SnapshotSummary200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotSummary200ResponseResultsInner.md b/docs/Model/SnapshotSummary200ResponseResultsInner.md new file mode 100644 index 0000000..42ae444 --- /dev/null +++ b/docs/Model/SnapshotSummary200ResponseResultsInner.md @@ -0,0 +1,19 @@ +# # SnapshotSummary200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branding** | [**\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerBranding**](SnapshotSummary200ResponseResultsInnerBranding.md) | | +**error** | **string** | The error while looking for this ticker. | [optional] +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**market_status** | **string** | The market status for the market that trades this ticker. | +**message** | **string** | The error message while looking for this ticker. | [optional] +**name** | **string** | Name of ticker, forex, or crypto asset. | +**options** | [**\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerOptions**](SnapshotSummary200ResponseResultsInnerOptions.md) | | +**price** | **float** | The most up to date ticker price. | +**session** | [**\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession**](SnapshotSummary200ResponseResultsInnerSession.md) | | +**ticker** | **string** | Ticker of asset queried. | +**type** | **string** | The market for this ticker of stock, crypto, fx, option. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotSummary200ResponseResultsInnerBranding.md b/docs/Model/SnapshotSummary200ResponseResultsInnerBranding.md new file mode 100644 index 0000000..a9f8bf3 --- /dev/null +++ b/docs/Model/SnapshotSummary200ResponseResultsInnerBranding.md @@ -0,0 +1,10 @@ +# # SnapshotSummary200ResponseResultsInnerBranding + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon_url** | **string** | A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. | [optional] +**logo_url** | **string** | A link to this ticker's company's logo. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more 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/SnapshotSummary200ResponseResultsInnerOptions.md b/docs/Model/SnapshotSummary200ResponseResultsInnerOptions.md new file mode 100644 index 0000000..98f1793 --- /dev/null +++ b/docs/Model/SnapshotSummary200ResponseResultsInnerOptions.md @@ -0,0 +1,14 @@ +# # SnapshotSummary200ResponseResultsInnerOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_type** | **string** | The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". | +**exercise_style** | **string** | The exercise style of this contract. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Option_style\">this link</a> for more details on exercise styles. | +**expiration_date** | **\DateTime** | The contract's expiration date in YYYY-MM-DD format. | +**shares_per_contract** | **float** | The number of shares per contract for this contract. | +**strike_price** | **float** | The strike price of the option contract. | +**underlying_ticker** | **string** | The ticker for the option contract. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SnapshotSummary200ResponseResultsInnerSession.md b/docs/Model/SnapshotSummary200ResponseResultsInnerSession.md new file mode 100644 index 0000000..e5eacca --- /dev/null +++ b/docs/Model/SnapshotSummary200ResponseResultsInnerSession.md @@ -0,0 +1,21 @@ +# # SnapshotSummary200ResponseResultsInnerSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change** | **float** | The value of the price change for the asset from the previous trading day. | +**change_percent** | **float** | The percent of the price change for the asset from the previous trading day. | +**close** | **float** | The closing price of the asset for the day. | +**early_trading_change** | **float** | Today's early trading change amount, difference between price and previous close if in early trading hours, otherwise difference between last price during early trading and previous close. | [optional] +**early_trading_change_percent** | **float** | Today's early trading change as a percentage. | [optional] +**high** | **float** | The highest price of the asset for the day. | +**late_trading_change** | **float** | Today's late trading change amount, difference between price and today's close if in late trading hours, otherwise difference between last price during late trading and today's close. | [optional] +**late_trading_change_percent** | **float** | Today's late trading change as a percentage. | [optional] +**low** | **float** | The lowest price of the asset for the day. | +**open** | **float** | The open price of the asset for the day. | +**previous_close** | **float** | The closing price of the asset for the previous trading day. | +**price** | **float** | The price of the most recent trade or bid price for this asset. | [optional] +**volume** | **float** | The trading volume for the asset for the day. | [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/Snapshots200Response.md b/docs/Model/Snapshots200Response.md new file mode 100644 index 0000000..4ed6333 --- /dev/null +++ b/docs/Model/Snapshots200Response.md @@ -0,0 +1,12 @@ +# # Snapshots200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**request_id** | **string** | | +**results** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInner[]**](Snapshots200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInner.md b/docs/Model/Snapshots200ResponseResultsInner.md new file mode 100644 index 0000000..3a1e8d2 --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInner.md @@ -0,0 +1,25 @@ +# # Snapshots200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**break_even_price** | **float** | The price of the underlying asset for the contract to break even. For a call, this value is (strike price + premium paid). For a put, this value is (strike price - premium paid). | [optional] +**details** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerDetails**](Snapshots200ResponseResultsInnerDetails.md) | | [optional] +**error** | **string** | The error while looking for this ticker. | [optional] +**fmv** | **float** | Fair market value is only available on Business plans. It's it our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\">contact us</a>. | [optional] +**greeks** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks**](Snapshots200ResponseResultsInnerGreeks.md) | | [optional] +**implied_volatility** | **float** | The market's forecast for the volatility of the underlying asset, based on this option's current price. | [optional] +**last_quote** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastQuote**](Snapshots200ResponseResultsInnerLastQuote.md) | | [optional] +**last_trade** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastTrade**](Snapshots200ResponseResultsInnerLastTrade.md) | | [optional] +**market_status** | **string** | The market status for the market that trades this ticker. Possible values for stocks, options, crypto, and forex snapshots are open, closed, early_trading, or late_trading. Possible values for indices snapshots are regular_trading, closed, early_trading, and late_trading. | [optional] +**message** | **string** | The error message while looking for this ticker. | [optional] +**name** | **string** | The name of this contract. | [optional] +**open_interest** | **float** | The quantity of this contract held at the end of the last trading day. | [optional] +**session** | [**\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession**](SnapshotSummary200ResponseResultsInnerSession.md) | | [optional] +**ticker** | **string** | The ticker symbol for the asset. | +**type** | **string** | The asset class for this ticker. | [optional] +**underlying_asset** | [**\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset**](Snapshots200ResponseResultsInnerUnderlyingAsset.md) | | [optional] +**value** | **float** | Value of Index. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInnerDetails.md b/docs/Model/Snapshots200ResponseResultsInnerDetails.md new file mode 100644 index 0000000..370df0e --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInnerDetails.md @@ -0,0 +1,13 @@ +# # Snapshots200ResponseResultsInnerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_type** | **string** | The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". | +**exercise_style** | **string** | The exercise style of this contract. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Option_style\">this link</a> for more details on exercise styles. | +**expiration_date** | **\DateTime** | The contract's expiration date in YYYY-MM-DD format. | +**shares_per_contract** | **float** | The number of shares per contract for this contract. | +**strike_price** | **float** | The strike price of the option contract. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInnerGreeks.md b/docs/Model/Snapshots200ResponseResultsInnerGreeks.md new file mode 100644 index 0000000..6731408 --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInnerGreeks.md @@ -0,0 +1,12 @@ +# # Snapshots200ResponseResultsInnerGreeks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**delta** | **float** | The change in the option's price per $0.01 increment in the price of the underlying asset. | +**gamma** | **float** | The change in delta per $0.01 change in the price of the underlying asset. | +**theta** | **float** | The change in the option's price per day. | +**vega** | **float** | The change in the option's price per 1% increment in volatility. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInnerLastQuote.md b/docs/Model/Snapshots200ResponseResultsInnerLastQuote.md new file mode 100644 index 0000000..16b926c --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInnerLastQuote.md @@ -0,0 +1,17 @@ +# # Snapshots200ResponseResultsInnerLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask** | **float** | The ask price. | +**ask_exchange** | **int** | The ask side exchange ID. See <a href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**ask_size** | **float** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | [optional] +**bid** | **float** | The bid price. | +**bid_exchange** | **int** | The bid side exchange ID. See <a href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**bid_size** | **float** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | [optional] +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**midpoint** | **float** | The average of the bid and ask price. | [optional] +**timeframe** | **string** | The time relevance of the data. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInnerLastTrade.md b/docs/Model/Snapshots200ResponseResultsInnerLastTrade.md new file mode 100644 index 0000000..e0ef102 --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInnerLastTrade.md @@ -0,0 +1,17 @@ +# # Snapshots200ResponseResultsInnerLastTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | [optional] +**id** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | [optional] +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**participant_timestamp** | **int** | The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. | [optional] +**size** | **int** | The size of a trade (also known as volume). | +**timeframe** | **string** | The time relevance of the data. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Snapshots200ResponseResultsInnerUnderlyingAsset.md b/docs/Model/Snapshots200ResponseResultsInnerUnderlyingAsset.md new file mode 100644 index 0000000..42e03db --- /dev/null +++ b/docs/Model/Snapshots200ResponseResultsInnerUnderlyingAsset.md @@ -0,0 +1,14 @@ +# # Snapshots200ResponseResultsInnerUnderlyingAsset + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change_to_break_even** | **float** | The change in price for the contract to break even. | +**last_updated** | **int** | The nanosecond timestamp of when this information was updated. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | [optional] +**ticker** | **string** | The ticker symbol for the contract's underlying asset. | +**timeframe** | **string** | The time relevance of the data. | +**value** | **float** | The value of the underlying index. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StandardBase.md b/docs/Model/StandardBase.md new file mode 100644 index 0000000..172bba8 --- /dev/null +++ b/docs/Model/StandardBase.md @@ -0,0 +1,11 @@ +# # StandardBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | +**count** | **int** | The total number of results for this request. | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatusBase.md b/docs/Model/StatusBase.md new file mode 100644 index 0000000..0671291 --- /dev/null +++ b/docs/Model/StatusBase.md @@ -0,0 +1,9 @@ +# # StatusBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatusCountBase.md b/docs/Model/StatusCountBase.md new file mode 100644 index 0000000..573c6bc --- /dev/null +++ b/docs/Model/StatusCountBase.md @@ -0,0 +1,10 @@ +# # StatusCountBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksGroupedResults.md b/docs/Model/StocksGroupedResults.md new file mode 100644 index 0000000..98ddde6 --- /dev/null +++ b/docs/Model/StocksGroupedResults.md @@ -0,0 +1,9 @@ +# # StocksGroupedResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksOpenClose.md b/docs/Model/StocksOpenClose.md new file mode 100644 index 0000000..6f9f176 --- /dev/null +++ b/docs/Model/StocksOpenClose.md @@ -0,0 +1,19 @@ +# # StocksOpenClose + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **float** | The close price of the ticker symbol in after hours trading. | [optional] +**close** | **float** | The close price for the symbol in the given time period. | +**from** | **\DateTime** | The requested date. | +**high** | **float** | The highest price for the symbol in the given time period. | +**low** | **float** | The lowest price for the symbol in the given time period. | +**open** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**pre_market** | **int** | The open price of the ticker symbol in pre-market trading. | [optional] +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The exchange symbol that this item is traded under. | +**volume** | **float** | The trading volume of the symbol in the given time period. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksSnapshotLastQuote.md b/docs/Model/StocksSnapshotLastQuote.md new file mode 100644 index 0000000..282683b --- /dev/null +++ b/docs/Model/StocksSnapshotLastQuote.md @@ -0,0 +1,13 @@ +# # StocksSnapshotLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p** | **float** | The ask price. | +**s** | **int** | The ask size in lots. | +**p** | **float** | The bid price. | +**s** | **int** | The bid size in lots. | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksSnapshotMinute.md b/docs/Model/StocksSnapshotMinute.md new file mode 100644 index 0000000..a4a60b3 --- /dev/null +++ b/docs/Model/StocksSnapshotMinute.md @@ -0,0 +1,17 @@ +# # StocksSnapshotMinute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**av** | **int** | The accumulated volume. | +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksSnapshotMinuteOTC.md b/docs/Model/StocksSnapshotMinuteOTC.md new file mode 100644 index 0000000..45dfe75 --- /dev/null +++ b/docs/Model/StocksSnapshotMinuteOTC.md @@ -0,0 +1,18 @@ +# # StocksSnapshotMinuteOTC + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**av** | **int** | The accumulated volume. | +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksSnapshotTicker.md b/docs/Model/StocksSnapshotTicker.md new file mode 100644 index 0000000..6ea6c43 --- /dev/null +++ b/docs/Model/StocksSnapshotTicker.md @@ -0,0 +1,9 @@ +# # StocksSnapshotTicker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksSnapshotTickers.md b/docs/Model/StocksSnapshotTickers.md new file mode 100644 index 0000000..98a0aef --- /dev/null +++ b/docs/Model/StocksSnapshotTickers.md @@ -0,0 +1,9 @@ +# # StocksSnapshotTickers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksTickerResultsOTC.md b/docs/Model/StocksTickerResultsOTC.md new file mode 100644 index 0000000..83eb4f5 --- /dev/null +++ b/docs/Model/StocksTickerResultsOTC.md @@ -0,0 +1,9 @@ +# # StocksTickerResultsOTC + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]**](V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2Base.md b/docs/Model/StocksV2Base.md new file mode 100644 index 0000000..94256f7 --- /dev/null +++ b/docs/Model/StocksV2Base.md @@ -0,0 +1,13 @@ +# # StocksV2Base + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2NBBO.md b/docs/Model/StocksV2NBBO.md new file mode 100644 index 0000000..ab63f06 --- /dev/null +++ b/docs/Model/StocksV2NBBO.md @@ -0,0 +1,22 @@ +# # StocksV2NBBO + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**p** | **float** | The ask price. | +**s** | **int** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | +**x** | [**\OpenAPI\Client\Model\StocksV2NBBOAllOfX**](StocksV2NBBOAllOfX.md) | | +**c** | **int[]** | A list of condition codes. | +**i** | **int[]** | The indicators. For more information, see our glossary of [Conditions and Indicators](https://polygon.io/glossary/us/stocks/conditions-indicators). | +**p** | **float** | The bid price. | +**s** | **int** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | +**x** | [**\OpenAPI\Client\Model\StocksV2NBBOAllOfX**](StocksV2NBBOAllOfX.md) | | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2NBBOAllOfX.md b/docs/Model/StocksV2NBBOAllOfX.md new file mode 100644 index 0000000..bb20efb --- /dev/null +++ b/docs/Model/StocksV2NBBOAllOfX.md @@ -0,0 +1,8 @@ +# # StocksV2NBBOAllOfX + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2NBBOs.md b/docs/Model/StocksV2NBBOs.md new file mode 100644 index 0000000..cb119ed --- /dev/null +++ b/docs/Model/StocksV2NBBOs.md @@ -0,0 +1,9 @@ +# # StocksV2NBBOs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]**](V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2Trade.md b/docs/Model/StocksV2Trade.md new file mode 100644 index 0000000..84e83d4 --- /dev/null +++ b/docs/Model/StocksV2Trade.md @@ -0,0 +1,21 @@ +# # StocksV2Trade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**c** | **int[]** | A list of condition codes. | +**e** | **int** | The trade correction indicator. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**r** | **int** | The ID for the Trade Reporting Facility where the trade took place. | +**s** | **float** | The size of a trade (also known as volume). | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StocksV2Trades.md b/docs/Model/StocksV2Trades.md new file mode 100644 index 0000000..171b98f --- /dev/null +++ b/docs/Model/StocksV2Trades.md @@ -0,0 +1,9 @@ +# # StocksV2Trades + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]**](V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TickerBase.md b/docs/Model/TickerBase.md new file mode 100644 index 0000000..ffa58d1 --- /dev/null +++ b/docs/Model/TickerBase.md @@ -0,0 +1,9 @@ +# # TickerBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | The exchange symbol that this item is traded under. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TickerResults.md b/docs/Model/TickerResults.md new file mode 100644 index 0000000..3ee8f0f --- /dev/null +++ b/docs/Model/TickerResults.md @@ -0,0 +1,9 @@ +# # TickerResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]**](V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TradeDetailsMapItem.md b/docs/Model/TradeDetailsMapItem.md new file mode 100644 index 0000000..ee185ef --- /dev/null +++ b/docs/Model/TradeDetailsMapItem.md @@ -0,0 +1,10 @@ +# # TradeDetailsMapItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the trade detail item | [optional] +**type** | **string** | Actual type of the trade detail item | [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/Trades200Response.md b/docs/Model/Trades200Response.md new file mode 100644 index 0000000..f47693d --- /dev/null +++ b/docs/Model/Trades200Response.md @@ -0,0 +1,11 @@ +# # Trades200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\Trades200ResponseResultsInner[]**](Trades200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trades200ResponseResultsInner.md b/docs/Model/Trades200ResponseResultsInner.md new file mode 100644 index 0000000..6c8caf9 --- /dev/null +++ b/docs/Model/Trades200ResponseResultsInner.md @@ -0,0 +1,20 @@ +# # Trades200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**correction** | **int** | The trade correction indicator. | [optional] +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**id** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**participant_timestamp** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually generated at the exchange. | +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**sequence_number** | **int** | The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day. | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. | +**size** | **float** | The size of a trade (also known as volume). | +**tape** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | [optional] +**trf_id** | **int** | The ID for the Trade Reporting Facility where the trade took place. | [optional] +**trf_timestamp** | **int** | The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this trade. | [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/TradesCrypto200Response.md b/docs/Model/TradesCrypto200Response.md new file mode 100644 index 0000000..5c9c0ae --- /dev/null +++ b/docs/Model/TradesCrypto200Response.md @@ -0,0 +1,11 @@ +# # TradesCrypto200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\TradesCrypto200ResponseResultsInner[]**](TradesCrypto200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TradesCrypto200ResponseResultsInner.md b/docs/Model/TradesCrypto200ResponseResultsInner.md new file mode 100644 index 0000000..52cea66 --- /dev/null +++ b/docs/Model/TradesCrypto200ResponseResultsInner.md @@ -0,0 +1,14 @@ +# # TradesCrypto200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**id** | **string** | The Trade ID which uniquely identifies a trade on the exchange that the trade happened on. | +**participant_timestamp** | **int** | The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange. | [optional] +**price** | **float** | The price of the trade in the base currency of the crypto pair. | +**size** | **float** | The size of a trade (also known as volume). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TradesOptions200Response.md b/docs/Model/TradesOptions200Response.md new file mode 100644 index 0000000..4dedafe --- /dev/null +++ b/docs/Model/TradesOptions200Response.md @@ -0,0 +1,11 @@ +# # TradesOptions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] +**results** | [**\OpenAPI\Client\Model\TradesOptions200ResponseResultsInner[]**](TradesOptions200ResponseResultsInner.md) | | [optional] +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TradesOptions200ResponseResultsInner.md b/docs/Model/TradesOptions200ResponseResultsInner.md new file mode 100644 index 0000000..44f0ab8 --- /dev/null +++ b/docs/Model/TradesOptions200ResponseResultsInner.md @@ -0,0 +1,15 @@ +# # TradesOptions200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **int[]** | A list of condition codes. | [optional] +**correction** | **int** | The trade correction indicator. | [optional] +**exchange** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**participant_timestamp** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually generated at the exchange. | [optional] +**price** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**sip_timestamp** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. | +**size** | **float** | The size of a trade (also known as volume). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1HistoricCryptoFromToDateGet200Response.md b/docs/Model/V1HistoricCryptoFromToDateGet200Response.md new file mode 100644 index 0000000..cd1dfe6 --- /dev/null +++ b/docs/Model/V1HistoricCryptoFromToDateGet200Response.md @@ -0,0 +1,13 @@ +# # V1HistoricCryptoFromToDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **\DateTime** | The date that was evaluated from the request. | +**map** | **object** | A map for shortened result keys. | +**ms_latency** | **int** | The milliseconds of latency for the query results. | +**symbol** | **string** | The symbol pair that was evaluated from the request. | +**ticks** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md b/docs/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md new file mode 100644 index 0000000..4afb523 --- /dev/null +++ b/docs/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md @@ -0,0 +1,14 @@ +# # V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **int[]** | A list of condition codes. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**s** | **float** | The size of a trade (also known as volume). | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**x** | **int** | The exchange that this crypto trade happened on. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1HistoricForexFromToDateGet200Response.md b/docs/Model/V1HistoricForexFromToDateGet200Response.md new file mode 100644 index 0000000..71b8837 --- /dev/null +++ b/docs/Model/V1HistoricForexFromToDateGet200Response.md @@ -0,0 +1,14 @@ +# # V1HistoricForexFromToDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**day** | **\DateTime** | The date that was evaluated from the request. | +**map** | **object** | A map for shortened result keys. | +**ms_latency** | **int** | The milliseconds of latency for the query results. | +**pair** | **string** | The currency pair that was evaluated from the request. | +**ticks** | [**\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.md b/docs/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.md new file mode 100644 index 0000000..2a60429 --- /dev/null +++ b/docs/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.md @@ -0,0 +1,12 @@ +# # V1HistoricForexFromToDateGet200ResponseAllOfTicksInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a** | **float** | The ask price. | +**b** | **float** | The bid price. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1LastBase.md b/docs/Model/V1LastBase.md new file mode 100644 index 0000000..c4f5441 --- /dev/null +++ b/docs/Model/V1LastBase.md @@ -0,0 +1,11 @@ +# # V1LastBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The exchange symbol that this item is traded under. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1OpenCloseCryptoFromToDateGet200Response.md b/docs/Model/V1OpenCloseCryptoFromToDateGet200Response.md new file mode 100644 index 0000000..a29189b --- /dev/null +++ b/docs/Model/V1OpenCloseCryptoFromToDateGet200Response.md @@ -0,0 +1,15 @@ +# # V1OpenCloseCryptoFromToDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**close** | **float** | The close price for the symbol in the given time period. | +**closing_trades** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | +**day** | **\DateTime** | The date requested. | +**is_utc** | **bool** | Whether or not the timestamps are in UTC timezone. | +**open** | **float** | The open price for the symbol in the given time period. | +**open_trades** | [**\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]**](V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.md) | | +**symbol** | **string** | The symbol pair that was evaluated from the request. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1OpenCloseIndicesTickerDateGet200Response.md b/docs/Model/V1OpenCloseIndicesTickerDateGet200Response.md new file mode 100644 index 0000000..bfe1e4b --- /dev/null +++ b/docs/Model/V1OpenCloseIndicesTickerDateGet200Response.md @@ -0,0 +1,17 @@ +# # V1OpenCloseIndicesTickerDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **float** | The close value of the ticker symbol in after hours trading. | [optional] +**close** | **float** | The close value for the symbol in the given time period. | +**from** | **\DateTime** | The requested date. | +**high** | **float** | The highest value for the symbol in the given time period. | +**low** | **float** | The lowest value for the symbol in the given time period. | +**open** | **float** | The open value for the symbol in the given time period. | +**pre_market** | **int** | The open value of the ticker symbol in pre-market trading. | [optional] +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The exchange symbol that this item is traded under. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V1OpenCloseOptionsTickerDateGet200Response.md b/docs/Model/V1OpenCloseOptionsTickerDateGet200Response.md new file mode 100644 index 0000000..d2da6ff --- /dev/null +++ b/docs/Model/V1OpenCloseOptionsTickerDateGet200Response.md @@ -0,0 +1,19 @@ +# # V1OpenCloseOptionsTickerDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after_hours** | **float** | The close price of the ticker symbol in after hours trading. | [optional] +**close** | **float** | The close price for the symbol in the given time period. | +**from** | **\DateTime** | The requested date. | +**high** | **float** | The highest price for the symbol in the given time period. | +**low** | **float** | The lowest price for the symbol in the given time period. | +**open** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**pre_market** | **int** | The open price of the ticker symbol in pre-market trading. | [optional] +**status** | **string** | The status of this request's response. | +**symbol** | **string** | The exchange symbol that this item is traded under. | +**volume** | **float** | The trading volume of the symbol in the given time period. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsBase.md b/docs/Model/V2AggsBase.md new file mode 100644 index 0000000..d166223 --- /dev/null +++ b/docs/Model/V2AggsBase.md @@ -0,0 +1,13 @@ +# # V2AggsBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.md b/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.md new file mode 100644 index 0000000..97fb7b4 --- /dev/null +++ b/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.md @@ -0,0 +1,14 @@ +# # V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md b/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..d83b262 --- /dev/null +++ b/docs/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md @@ -0,0 +1,17 @@ +# # V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | [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/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.md b/docs/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.md new file mode 100644 index 0000000..08dd4f1 --- /dev/null +++ b/docs/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.md @@ -0,0 +1,14 @@ +# # V2AggsGroupedLocaleUsMarketStocksDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.md b/docs/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..becc72a --- /dev/null +++ b/docs/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.md @@ -0,0 +1,18 @@ +# # V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**t** | **int** | The Unix Msec timestamp for the end of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | [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/V2AggsTickerCryptoTickerPrevGet200Response.md b/docs/Model/V2AggsTickerCryptoTickerPrevGet200Response.md new file mode 100644 index 0000000..f5e0f03 --- /dev/null +++ b/docs/Model/V2AggsTickerCryptoTickerPrevGet200Response.md @@ -0,0 +1,15 @@ +# # V2AggsTickerCryptoTickerPrevGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | The exchange symbol that this item is traded under. | +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]**](V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md b/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md new file mode 100644 index 0000000..348b1b0 --- /dev/null +++ b/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.md @@ -0,0 +1,15 @@ +# # V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | The exchange symbol that this item is traded under. | +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]**](V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md b/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..c97dcd0 --- /dev/null +++ b/docs/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md @@ -0,0 +1,16 @@ +# # V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | [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/V2AggsTickerIndicesTickerPrevGet200Response.md b/docs/Model/V2AggsTickerIndicesTickerPrevGet200Response.md new file mode 100644 index 0000000..7b007d1 --- /dev/null +++ b/docs/Model/V2AggsTickerIndicesTickerPrevGet200Response.md @@ -0,0 +1,14 @@ +# # V2AggsTickerIndicesTickerPrevGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | The exchange symbol that this item is traded under. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]**](V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.md b/docs/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..2a1cacc --- /dev/null +++ b/docs/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.md @@ -0,0 +1,13 @@ +# # V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close value for the symbol in the given time period. | +**h** | **float** | The highest value for the symbol in the given time period. | +**l** | **float** | The lowest value for the symbol in the given time period. | +**o** | **float** | The open value for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.md b/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.md new file mode 100644 index 0000000..2775423 --- /dev/null +++ b/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.md @@ -0,0 +1,16 @@ +# # V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ticker** | **string** | The exchange symbol that this item is traded under. | +**adjusted** | **bool** | Whether or not this response was adjusted for splits. | +**query_count** | **int** | The number of aggregates (minute or day) used to generate the response. | +**request_id** | **string** | A request id assigned by the server. | +**results_count** | **int** | The total number of results for this request. | +**status** | **string** | The status of this request's response. | +**results** | [**\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]**](V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md) | | [optional] +**next_url** | **string** | If present, this value can be used to fetch the next page of data. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md b/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..c7e298b --- /dev/null +++ b/docs/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.md @@ -0,0 +1,17 @@ +# # V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | [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/V2LastBase.md b/docs/Model/V2LastBase.md new file mode 100644 index 0000000..a9e9b87 --- /dev/null +++ b/docs/Model/V2LastBase.md @@ -0,0 +1,10 @@ +# # V2LastBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **string** | A request id assigned by the server. | +**status** | **string** | The status of this request's response. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.md new file mode 100644 index 0000000..3e3c199 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.md @@ -0,0 +1,9 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.md new file mode 100644 index 0000000..19eda33 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.md @@ -0,0 +1,10 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md new file mode 100644 index 0000000..918a1c1 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md @@ -0,0 +1,17 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.md) | | +**fmv** | **float** | Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\">contact us</a>. | [optional] +**last_trade** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.md) | | +**min** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.md) | | +**prev_day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.md) | | +**ticker** | **string** | The exchange symbol that this item is traded under. | +**todays_change** | **float** | The value of the change from the previous day. | +**todays_change_perc** | **float** | The percentage change since the previous day. | +**updated** | **int** | The last updated timestamp. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.md new file mode 100644 index 0000000..82e9e3b --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.md @@ -0,0 +1,14 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.md new file mode 100644 index 0000000..3d93798 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.md @@ -0,0 +1,14 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **int[]** | The trade conditions. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**s** | **float** | The size (volume) of the trade. | +**t** | **int** | The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange. | +**x** | **int** | The exchange that this crypto trade happened on. See <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.md new file mode 100644 index 0000000..dadda9d --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.md @@ -0,0 +1,16 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.md new file mode 100644 index 0000000..beb7530 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.md @@ -0,0 +1,14 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.md new file mode 100644 index 0000000..9229fc7 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.md @@ -0,0 +1,9 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData**](V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.md new file mode 100644 index 0000000..fa6dd97 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.md @@ -0,0 +1,15 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ask_count** | **float** | The combined total number of asks in the book. | +**asks** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[]**](V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.md) | | +**bid_count** | **float** | The combined total number of bids in the book. | +**bids** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[]**](V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.md) | | +**spread** | **float** | The difference between the best bid and the best ask price across exchanges. | +**ticker** | **string** | The exchange symbol that this item is traded under. | +**updated** | **int** | The last updated timestamp. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.md new file mode 100644 index 0000000..d969c59 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.md @@ -0,0 +1,10 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p** | **float** | The price of this book level. | +**x** | **object** | A map of the exchange ID to number of shares at this price level. <br /> <br /> **Example:** <br /> `{ \"p\": 16302.94, \"x\": { \"1\": 0.02859424, \"6\": 0.023455 } }` <br /> <br /> In this example, exchange ID 1 has 0.02859424 shares available at $16,302.94, and exchange ID 6 has 0.023455 shares at the same price level. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.md new file mode 100644 index 0000000..63f9f8a --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.md @@ -0,0 +1,11 @@ +# # V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**request_id** | **string** | A request id assigned by the server. | +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.md new file mode 100644 index 0000000..2680e8b --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.md @@ -0,0 +1,10 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md new file mode 100644 index 0000000..de48281 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md @@ -0,0 +1,17 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.md) | | +**fmv** | **float** | Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\">contact us</a>. | [optional] +**last_quote** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.md) | | +**min** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.md) | | +**prev_day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay**](V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.md) | | +**ticker** | **string** | The exchange symbol that this item is traded under. | +**todays_change** | **float** | The value of the change from the previous day. | +**todays_change_perc** | **float** | The percentage change since the previous day. | +**updated** | **int** | The last updated timestamp. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.md new file mode 100644 index 0000000..40249a8 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.md @@ -0,0 +1,13 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**v** | **float** | The trading volume of the symbol in the given time period. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.md new file mode 100644 index 0000000..7903baa --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.md @@ -0,0 +1,12 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a** | **float** | The ask price. | +**b** | **float** | The bid price. | +**t** | **int** | The millisecond accuracy timestamp of the quote. | +**x** | **int** | The exchange ID on which this quote happened. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.md new file mode 100644 index 0000000..e3d97ba --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.md @@ -0,0 +1,15 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | [optional] +**h** | **float** | The highest price for the symbol in the given time period. | [optional] +**l** | **float** | The lowest price for the symbol in the given time period. | [optional] +**n** | **int** | The number of transactions in the aggregate window. | [optional] +**o** | **float** | The open price for the symbol in the given time period. | [optional] +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | [optional] +**v** | **float** | The trading volume of the symbol in the given time 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/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.md b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.md new file mode 100644 index 0000000..fffccd0 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.md @@ -0,0 +1,11 @@ +# # V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**request_id** | **string** | A request id assigned by the server. | +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.md new file mode 100644 index 0000000..4afec62 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.md @@ -0,0 +1,10 @@ +# # V2SnapshotLocaleUsMarketsStocksDirectionGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.md new file mode 100644 index 0000000..af3eb58 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.md @@ -0,0 +1,11 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The total number of results for this request. | [optional] +**status** | **string** | The status of this request's response. | +**tickers** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md new file mode 100644 index 0000000..cabf693 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md @@ -0,0 +1,18 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.md) | | [optional] +**fmv** | **float** | Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\">contact us</a>. | [optional] +**last_quote** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.md) | | [optional] +**last_trade** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.md) | | [optional] +**min** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.md) | | [optional] +**prev_day** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.md) | | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | [optional] +**todays_change** | **float** | The value of the change from the previous day. | [optional] +**todays_change_perc** | **float** | The percentage change since the previous day. | [optional] +**updated** | **int** | The last updated 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.md new file mode 100644 index 0000000..28f2551 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.md @@ -0,0 +1,15 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.md new file mode 100644 index 0000000..3014a19 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.md @@ -0,0 +1,13 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p** | **float** | The ask price. | +**s** | **int** | The ask size in lots. | +**p** | **float** | The bid price. | +**s** | **int** | The bid size in lots. | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.md new file mode 100644 index 0000000..b1a7e84 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.md @@ -0,0 +1,14 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **int[]** | The trade conditions. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**s** | **int** | The size (volume) of the trade. | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.md new file mode 100644 index 0000000..3ffd316 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.md @@ -0,0 +1,18 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**av** | **int** | The accumulated volume. | +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**n** | **int** | The number of transactions in the aggregate window. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**t** | **int** | The Unix Msec timestamp for the start of the aggregate window. | +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.md new file mode 100644 index 0000000..011cce6 --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.md @@ -0,0 +1,15 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**c** | **float** | The close price for the symbol in the given time period. | +**h** | **float** | The highest price for the symbol in the given time period. | +**l** | **float** | The lowest price for the symbol in the given time period. | +**o** | **float** | The open price for the symbol in the given time period. | +**otc** | **bool** | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | [optional] +**v** | **float** | The trading volume of the symbol in the given time period. | +**vw** | **float** | The volume weighted average price. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.md b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.md new file mode 100644 index 0000000..566eadc --- /dev/null +++ b/docs/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.md @@ -0,0 +1,11 @@ +# # V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of this request's response. | +**request_id** | **string** | A request id assigned by the server. | +**ticker** | [**\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner**](V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2TicksBase.md b/docs/Model/V2TicksBase.md new file mode 100644 index 0000000..0faf02f --- /dev/null +++ b/docs/Model/V2TicksBase.md @@ -0,0 +1,12 @@ +# # V2TicksBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**db_latency** | **int** | Latency in milliseconds for the query results from the database. | [optional] +**results_count** | **int** | The total number of results for this request. | [optional] +**success** | **bool** | Whether or not this query was executed successfully. | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | [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/V2TicksStocksNbboTickerDateGet200Response.md b/docs/Model/V2TicksStocksNbboTickerDateGet200Response.md new file mode 100644 index 0000000..8d136b5 --- /dev/null +++ b/docs/Model/V2TicksStocksNbboTickerDateGet200Response.md @@ -0,0 +1,13 @@ +# # V2TicksStocksNbboTickerDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**db_latency** | **int** | Latency in milliseconds for the query results from the database. | [optional] +**results_count** | **int** | The total number of results for this request. | [optional] +**success** | **bool** | Whether or not this query was executed successfully. | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | [optional] +**results** | [**\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]**](V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.md b/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..3fa560d --- /dev/null +++ b/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.md @@ -0,0 +1,22 @@ +# # V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**p** | **float** | The ask price. | +**s** | **int** | The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. | +**x** | [**\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX**](V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.md) | | +**c** | **int[]** | A list of condition codes. | +**i** | **int[]** | The indicators. For more information, see our glossary of [Conditions and Indicators](https://polygon.io/glossary/us/stocks/conditions-indicators). | +**p** | **float** | The bid price. | +**s** | **int** | The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. | +**x** | [**\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX**](V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.md) | | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.md b/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.md new file mode 100644 index 0000000..91dbb02 --- /dev/null +++ b/docs/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.md @@ -0,0 +1,8 @@ +# # V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2TicksStocksTradesTickerDateGet200Response.md b/docs/Model/V2TicksStocksTradesTickerDateGet200Response.md new file mode 100644 index 0000000..e11460e --- /dev/null +++ b/docs/Model/V2TicksStocksTradesTickerDateGet200Response.md @@ -0,0 +1,13 @@ +# # V2TicksStocksTradesTickerDateGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**db_latency** | **int** | Latency in milliseconds for the query results from the database. | [optional] +**results_count** | **int** | The total number of results for this request. | [optional] +**success** | **bool** | Whether or not this query was executed successfully. | [optional] +**ticker** | **string** | The exchange symbol that this item is traded under. | [optional] +**results** | [**\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]**](V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.md b/docs/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.md new file mode 100644 index 0000000..cf296d1 --- /dev/null +++ b/docs/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.md @@ -0,0 +1,21 @@ +# # V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **string** | The exchange symbol that this item is traded under. | +**f** | **int** | The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. | +**q** | **int** | The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). | +**t** | **int** | The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. | +**y** | **int** | The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. | +**c** | **int[]** | A list of condition codes. | +**e** | **int** | The trade correction indicator. | +**i** | **string** | The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. | +**p** | **float** | The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. | +**r** | **int** | The ID for the Trade Reporting Facility where the trade took place. | +**s** | **float** | The size of a trade (also known as volume). | +**x** | **int** | The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs. | +**z** | **int** | There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/CrpytoaggregatesApi.php b/lib/Api/CrpytoaggregatesApi.php new file mode 100644 index 0000000..f745e55 --- /dev/null +++ b/lib/Api/CrpytoaggregatesApi.php @@ -0,0 +1,1589 @@ + [ + 'application/json', + ], + 'cryptoRSI' => [ + 'application/json', + ], + 'cryptoSMA' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation cryptoEMA + * + * Exponential Moving Average (EMA) + * + * @param string $crypto_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoEMA200Response + */ + public function cryptoEMA($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoEMA'][0]) + { + list($response) = $this->cryptoEMAWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation cryptoEMAWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $crypto_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoEMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function cryptoEMAWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoEMA'][0]) + { + $request = $this->cryptoEMARequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoEMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoEMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoEMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoEMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cryptoEMAAsync + * + * Exponential Moving Average (EMA) + * + * @param string $crypto_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoEMAAsync($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoEMA'][0]) + { + return $this->cryptoEMAAsyncWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cryptoEMAAsyncWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $crypto_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoEMAAsyncWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoEMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + $request = $this->cryptoEMARequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'cryptoEMA' + * + * @param string $crypto_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cryptoEMARequest($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoEMA'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling cryptoEMA' + ); + } + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CrpytoaggregatesApi.cryptoEMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/ema/{cryptoTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cryptoRSI + * + * Relative Strength Index (RSI) + * + * @param string $crypto_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoRSI200Response + */ + public function cryptoRSI($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoRSI'][0]) + { + list($response) = $this->cryptoRSIWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation cryptoRSIWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $crypto_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoRSI200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function cryptoRSIWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoRSI'][0]) + { + $request = $this->cryptoRSIRequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoRSI200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoRSI200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoRSI200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoRSI200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cryptoRSIAsync + * + * Relative Strength Index (RSI) + * + * @param string $crypto_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoRSIAsync($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoRSI'][0]) + { + return $this->cryptoRSIAsyncWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cryptoRSIAsyncWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $crypto_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoRSIAsyncWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoRSI'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + $request = $this->cryptoRSIRequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'cryptoRSI' + * + * @param string $crypto_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cryptoRSIRequest($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoRSI'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling cryptoRSI' + ); + } + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CrpytoaggregatesApi.cryptoRSI, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/rsi/{cryptoTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cryptoSMA + * + * Simple Moving Average (SMA) + * + * @param string $crypto_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoSMA200Response + */ + public function cryptoSMA($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoSMA'][0]) + { + list($response) = $this->cryptoSMAWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation cryptoSMAWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $crypto_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoSMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function cryptoSMAWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoSMA'][0]) + { + $request = $this->cryptoSMARequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoSMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoSMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoSMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoSMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cryptoSMAAsync + * + * Simple Moving Average (SMA) + * + * @param string $crypto_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoSMAAsync($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoSMA'][0]) + { + return $this->cryptoSMAAsyncWithHttpInfo($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cryptoSMAAsyncWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $crypto_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoSMAAsyncWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoSMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + $request = $this->cryptoSMARequest($crypto_ticker, $timestamp, $timespan, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'cryptoSMA' + * + * @param string $crypto_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cryptoSMARequest($crypto_ticker, $timestamp = null, $timespan = 'day', $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoSMA'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling cryptoSMA' + ); + } + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CrpytoaggregatesApi.cryptoSMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/sma/{cryptoTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CryptoaggregatesApi.php b/lib/Api/CryptoaggregatesApi.php new file mode 100644 index 0000000..7fbdfb7 --- /dev/null +++ b/lib/Api/CryptoaggregatesApi.php @@ -0,0 +1,1753 @@ + [ + 'application/json', + ], + 'v2AggsGroupedLocaleGlobalMarketCryptoDateGet' => [ + 'application/json', + ], + 'v2AggsTickerCryptoTickerPrevGet' => [ + 'application/json', + ], + 'v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation cryptoMACD + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $crypto_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoMACD200Response + */ + public function cryptoMACD($crypto_ticker, $timestamp = null, $timespan = 'day', $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoMACD'][0]) + { + list($response) = $this->cryptoMACDWithHttpInfo($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation cryptoMACDWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $crypto_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoMACD200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function cryptoMACDWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoMACD'][0]) + { + $request = $this->cryptoMACDRequest($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoMACD200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoMACD200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoMACD200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoMACD200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cryptoMACDAsync + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $crypto_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoMACDAsync($crypto_ticker, $timestamp = null, $timespan = 'day', $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoMACD'][0]) + { + return $this->cryptoMACDAsyncWithHttpInfo($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cryptoMACDAsyncWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $crypto_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cryptoMACDAsyncWithHttpInfo($crypto_ticker, $timestamp = null, $timespan = 'day', $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoMACD'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + $request = $this->cryptoMACDRequest($crypto_ticker, $timestamp, $timespan, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'cryptoMACD' + * + * @param string $crypto_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cryptoMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cryptoMACDRequest($crypto_ticker, $timestamp = null, $timespan = 'day', $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['cryptoMACD'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling cryptoMACD' + ); + } + + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CryptoaggregatesApi.cryptoMACD, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/macd/{cryptoTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $short_window, + 'short_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $long_window, + 'long_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signal_window, + 'signal_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketCryptoDateGet + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response + */ + public function v2AggsGroupedLocaleGlobalMarketCryptoDateGet($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'][0]) + { + list($response) = $this->v2AggsGroupedLocaleGlobalMarketCryptoDateGetWithHttpInfo($date, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketCryptoDateGetWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsGroupedLocaleGlobalMarketCryptoDateGetWithHttpInfo($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'][0]) + { + $request = $this->v2AggsGroupedLocaleGlobalMarketCryptoDateGetRequest($date, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketCryptoDateGetAsync + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleGlobalMarketCryptoDateGetAsync($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'][0]) + { + return $this->v2AggsGroupedLocaleGlobalMarketCryptoDateGetAsyncWithHttpInfo($date, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketCryptoDateGetAsyncWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleGlobalMarketCryptoDateGetAsyncWithHttpInfo($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response'; + $request = $this->v2AggsGroupedLocaleGlobalMarketCryptoDateGetRequest($date, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsGroupedLocaleGlobalMarketCryptoDateGet' + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsGroupedLocaleGlobalMarketCryptoDateGetRequest($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketCryptoDateGet'][0]) + { + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v2AggsGroupedLocaleGlobalMarketCryptoDateGet' + ); + } + + + + $resourcePath = '/v2/aggs/grouped/locale/global/market/crypto/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerCryptoTickerPrevGet + * + * Previous Close + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response + */ + public function v2AggsTickerCryptoTickerPrevGet($crypto_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerPrevGet'][0]) + { + list($response) = $this->v2AggsTickerCryptoTickerPrevGetWithHttpInfo($crypto_ticker, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerCryptoTickerPrevGetWithHttpInfo + * + * Previous Close + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerCryptoTickerPrevGetWithHttpInfo($crypto_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerPrevGet'][0]) + { + $request = $this->v2AggsTickerCryptoTickerPrevGetRequest($crypto_ticker, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerCryptoTickerPrevGetAsync + * + * Previous Close + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerCryptoTickerPrevGetAsync($crypto_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerPrevGet'][0]) + { + return $this->v2AggsTickerCryptoTickerPrevGetAsyncWithHttpInfo($crypto_ticker, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerCryptoTickerPrevGetAsyncWithHttpInfo + * + * Previous Close + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerCryptoTickerPrevGetAsyncWithHttpInfo($crypto_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerPrevGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response'; + $request = $this->v2AggsTickerCryptoTickerPrevGetRequest($crypto_ticker, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerCryptoTickerPrevGet' + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerCryptoTickerPrevGetRequest($crypto_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerPrevGet'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling v2AggsTickerCryptoTickerPrevGet' + ); + } + + + + $resourcePath = '/v2/aggs/ticker/{cryptoTicker}/prev'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars) + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'][0]) + { + list($response) = $this->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetWithHttpInfo($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetWithHttpInfo($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'][0]) + { + $request = $this->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetRequest($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetAsync + * + * Aggregates (Bars) + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetAsync($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'][0]) + { + return $this->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetRequest($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + * + * @param string $crypto_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGetRequest($crypto_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'multiplier' is set + if ($multiplier === null || (is_array($multiplier) && count($multiplier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multiplier when calling v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'timespan' is set + if ($timespan === null || (is_array($timespan) && count($timespan) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timespan when calling v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet' + ); + } + + + + + + $resourcePath = '/v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + // path params + if ($multiplier !== null) { + $resourcePath = str_replace( + '{' . 'multiplier' . '}', + ObjectSerializer::toPathValue($multiplier), + $resourcePath + ); + } + // path params + if ($timespan !== null) { + $resourcePath = str_replace( + '{' . 'timespan' . '}', + ObjectSerializer::toPathValue($timespan), + $resourcePath + ); + } + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CryptolasttradeApi.php b/lib/Api/CryptolasttradeApi.php new file mode 100644 index 0000000..74c24f4 --- /dev/null +++ b/lib/Api/CryptolasttradeApi.php @@ -0,0 +1,475 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation lastTradeCrypto + * + * Last Trade for a Crypto Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeCrypto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\LastTradeCrypto200Response + */ + public function lastTradeCrypto($from, $to, string $contentType = self::contentTypes['lastTradeCrypto'][0]) + { + list($response) = $this->lastTradeCryptoWithHttpInfo($from, $to, $contentType); + return $response; + } + + /** + * Operation lastTradeCryptoWithHttpInfo + * + * Last Trade for a Crypto Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeCrypto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\LastTradeCrypto200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function lastTradeCryptoWithHttpInfo($from, $to, string $contentType = self::contentTypes['lastTradeCrypto'][0]) + { + $request = $this->lastTradeCryptoRequest($from, $to, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\LastTradeCrypto200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LastTradeCrypto200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LastTradeCrypto200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\LastTradeCrypto200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\LastTradeCrypto200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastTradeCryptoAsync + * + * Last Trade for a Crypto Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeCryptoAsync($from, $to, string $contentType = self::contentTypes['lastTradeCrypto'][0]) + { + return $this->lastTradeCryptoAsyncWithHttpInfo($from, $to, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastTradeCryptoAsyncWithHttpInfo + * + * Last Trade for a Crypto Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeCryptoAsyncWithHttpInfo($from, $to, string $contentType = self::contentTypes['lastTradeCrypto'][0]) + { + $returnType = '\OpenAPI\Client\Model\LastTradeCrypto200Response'; + $request = $this->lastTradeCryptoRequest($from, $to, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'lastTradeCrypto' + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastTradeCryptoRequest($from, $to, string $contentType = self::contentTypes['lastTradeCrypto'][0]) + { + + // 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 lastTradeCrypto' + ); + } + + // 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 lastTradeCrypto' + ); + } + + + $resourcePath = '/v1/last/crypto/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CryptoopenCloseApi.php b/lib/Api/CryptoopenCloseApi.php new file mode 100644 index 0000000..66a2aa9 --- /dev/null +++ b/lib/Api/CryptoopenCloseApi.php @@ -0,0 +1,510 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v1OpenCloseCryptoFromToDateGet + * + * Daily Open/Close + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response + */ + public function v1OpenCloseCryptoFromToDateGet($from, $to, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseCryptoFromToDateGet'][0]) + { + list($response) = $this->v1OpenCloseCryptoFromToDateGetWithHttpInfo($from, $to, $date, $adjusted, $contentType); + return $response; + } + + /** + * Operation v1OpenCloseCryptoFromToDateGetWithHttpInfo + * + * Daily Open/Close + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1OpenCloseCryptoFromToDateGetWithHttpInfo($from, $to, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseCryptoFromToDateGet'][0]) + { + $request = $this->v1OpenCloseCryptoFromToDateGetRequest($from, $to, $date, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1OpenCloseCryptoFromToDateGetAsync + * + * Daily Open/Close + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseCryptoFromToDateGetAsync($from, $to, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseCryptoFromToDateGet'][0]) + { + return $this->v1OpenCloseCryptoFromToDateGetAsyncWithHttpInfo($from, $to, $date, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1OpenCloseCryptoFromToDateGetAsyncWithHttpInfo + * + * Daily Open/Close + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseCryptoFromToDateGetAsyncWithHttpInfo($from, $to, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseCryptoFromToDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1OpenCloseCryptoFromToDateGet200Response'; + $request = $this->v1OpenCloseCryptoFromToDateGetRequest($from, $to, $date, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1OpenCloseCryptoFromToDateGet' + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1OpenCloseCryptoFromToDateGetRequest($from, $to, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseCryptoFromToDateGet'][0]) + { + + // 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 v1OpenCloseCryptoFromToDateGet' + ); + } + + // 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 v1OpenCloseCryptoFromToDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1OpenCloseCryptoFromToDateGet' + ); + } + + + + $resourcePath = '/v1/open-close/crypto/{from}/{to}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CryptosnapshotApi.php b/lib/Api/CryptosnapshotApi.php new file mode 100644 index 0000000..cce0c99 --- /dev/null +++ b/lib/Api/CryptosnapshotApi.php @@ -0,0 +1,1395 @@ + [ + 'application/json', + ], + 'v2SnapshotLocaleGlobalMarketsCryptoTickersGet' => [ + 'application/json', + ], + 'v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet' => [ + 'application/json', + ], + 'v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoDirectionGet + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsCryptoDirectionGet($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsCryptoDirectionGetWithHttpInfo($direction, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoDirectionGetWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsCryptoDirectionGetWithHttpInfo($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoDirectionGetRequest($direction, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoDirectionGetAsync + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoDirectionGetAsync($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsCryptoDirectionGetAsyncWithHttpInfo($direction, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoDirectionGetAsyncWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoDirectionGetAsyncWithHttpInfo($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoDirectionGetRequest($direction, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsCryptoDirectionGet' + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsCryptoDirectionGetRequest($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoDirectionGet'][0]) + { + + // verify the required parameter 'direction' is set + if ($direction === null || (is_array($direction) && count($direction) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $direction when calling v2SnapshotLocaleGlobalMarketsCryptoDirectionGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/global/markets/crypto/{direction}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($direction !== null) { + $resourcePath = str_replace( + '{' . 'direction' . '}', + ObjectSerializer::toPathValue($direction), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersGet + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersGet($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersGetWithHttpInfo($tickers, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersGetWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersGetWithHttpInfo($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersGetRequest($tickers, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersGetAsync + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersGetAsync($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsCryptoTickersGetAsyncWithHttpInfo($tickers, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersGetAsyncWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersGetAsyncWithHttpInfo($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersGetRequest($tickers, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsCryptoTickersGet' + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersGetRequest($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersGet'][0]) + { + + + + $resourcePath = '/v2/snapshot/locale/global/markets/crypto/tickers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tickers, + 'tickers', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet + * + * Ticker Full Book (L2) + * + * @param string $ticker The cryptocurrency ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetWithHttpInfo($ticker, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetWithHttpInfo + * + * Ticker Full Book (L2) + * + * @param string $ticker The cryptocurrency ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetRequest($ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetAsync + * + * Ticker Full Book (L2) + * + * @param string $ticker The cryptocurrency ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetAsync($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetAsyncWithHttpInfo($ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetAsyncWithHttpInfo + * + * Ticker Full Book (L2) + * + * @param string $ticker The cryptocurrency ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetAsyncWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetRequest($ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet' + * + * @param string $ticker The cryptocurrency ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGetRequest($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet + * + * Ticker + * + * @param string $ticker Ticker of the snapshot (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetWithHttpInfo($ticker, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetWithHttpInfo + * + * Ticker + * + * @param string $ticker Ticker of the snapshot (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetRequest($ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetAsync + * + * Ticker + * + * @param string $ticker Ticker of the snapshot (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetAsync($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetAsyncWithHttpInfo($ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetAsyncWithHttpInfo + * + * Ticker + * + * @param string $ticker Ticker of the snapshot (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetAsyncWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetRequest($ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet' + * + * @param string $ticker Ticker of the snapshot (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGetRequest($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CryptotradesApi.php b/lib/Api/CryptotradesApi.php new file mode 100644 index 0000000..887d56c --- /dev/null +++ b/lib/Api/CryptotradesApi.php @@ -0,0 +1,966 @@ + [ + 'application/json', + ], + 'v1HistoricCryptoFromToDateGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation tradesCrypto + * + * Trades + * + * @param string $crypto_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesCrypto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\TradesCrypto200Response + */ + public function tradesCrypto($crypto_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesCrypto'][0]) + { + list($response) = $this->tradesCryptoWithHttpInfo($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation tradesCryptoWithHttpInfo + * + * Trades + * + * @param string $crypto_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesCrypto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\TradesCrypto200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function tradesCryptoWithHttpInfo($crypto_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesCrypto'][0]) + { + $request = $this->tradesCryptoRequest($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\TradesCrypto200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\TradesCrypto200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\TradesCrypto200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\TradesCrypto200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\TradesCrypto200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation tradesCryptoAsync + * + * Trades + * + * @param string $crypto_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesCryptoAsync($crypto_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesCrypto'][0]) + { + return $this->tradesCryptoAsyncWithHttpInfo($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tradesCryptoAsyncWithHttpInfo + * + * Trades + * + * @param string $crypto_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesCryptoAsyncWithHttpInfo($crypto_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesCrypto'][0]) + { + $returnType = '\OpenAPI\Client\Model\TradesCrypto200Response'; + $request = $this->tradesCryptoRequest($crypto_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'tradesCrypto' + * + * @param string $crypto_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesCrypto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tradesCryptoRequest($crypto_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesCrypto'][0]) + { + + // verify the required parameter 'crypto_ticker' is set + if ($crypto_ticker === null || (is_array($crypto_ticker) && count($crypto_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $crypto_ticker when calling tradesCrypto' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CryptotradesApi.tradesCrypto, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling CryptotradesApi.tradesCrypto, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/trades/{cryptoTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($crypto_ticker !== null) { + $resourcePath = str_replace( + '{' . 'cryptoTicker' . '}', + ObjectSerializer::toPathValue($crypto_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v1HistoricCryptoFromToDateGet + * + * Historic Crypto Trades + * + * @param string $from The \"from\" symbol of the crypto pair. (required) + * @param string $to The \"to\" symbol of the crypto pair. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response + */ + public function v1HistoricCryptoFromToDateGet($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricCryptoFromToDateGet'][0]) + { + list($response) = $this->v1HistoricCryptoFromToDateGetWithHttpInfo($from, $to, $date, $offset, $limit, $contentType); + return $response; + } + + /** + * Operation v1HistoricCryptoFromToDateGetWithHttpInfo + * + * Historic Crypto Trades + * + * @param string $from The \"from\" symbol of the crypto pair. (required) + * @param string $to The \"to\" symbol of the crypto pair. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1HistoricCryptoFromToDateGetWithHttpInfo($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricCryptoFromToDateGet'][0]) + { + $request = $this->v1HistoricCryptoFromToDateGetRequest($from, $to, $date, $offset, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1HistoricCryptoFromToDateGetAsync + * + * Historic Crypto Trades + * + * @param string $from The \"from\" symbol of the crypto pair. (required) + * @param string $to The \"to\" symbol of the crypto pair. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1HistoricCryptoFromToDateGetAsync($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricCryptoFromToDateGet'][0]) + { + return $this->v1HistoricCryptoFromToDateGetAsyncWithHttpInfo($from, $to, $date, $offset, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1HistoricCryptoFromToDateGetAsyncWithHttpInfo + * + * Historic Crypto Trades + * + * @param string $from The \"from\" symbol of the crypto pair. (required) + * @param string $to The \"to\" symbol of the crypto pair. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1HistoricCryptoFromToDateGetAsyncWithHttpInfo($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricCryptoFromToDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200Response'; + $request = $this->v1HistoricCryptoFromToDateGetRequest($from, $to, $date, $offset, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1HistoricCryptoFromToDateGet' + * + * @param string $from The \"from\" symbol of the crypto pair. (required) + * @param string $to The \"to\" symbol of the crypto pair. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricCryptoFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1HistoricCryptoFromToDateGetRequest($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricCryptoFromToDateGet'][0]) + { + + // 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 v1HistoricCryptoFromToDateGet' + ); + } + + // 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 v1HistoricCryptoFromToDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1HistoricCryptoFromToDateGet' + ); + } + + + + + $resourcePath = '/v1/historic/crypto/{from}/{to}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php new file mode 100644 index 0000000..2434360 --- /dev/null +++ b/lib/Api/DefaultApi.php @@ -0,0 +1,901 @@ + [ + 'application/json', + ], + 'snapshots' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation snapshotSummary + * + * Summaries + * + * @param string $ticker_any_of Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshotSummary'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SnapshotSummary200Response + */ + public function snapshotSummary($ticker_any_of = null, string $contentType = self::contentTypes['snapshotSummary'][0]) + { + list($response) = $this->snapshotSummaryWithHttpInfo($ticker_any_of, $contentType); + return $response; + } + + /** + * Operation snapshotSummaryWithHttpInfo + * + * Summaries + * + * @param string $ticker_any_of Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshotSummary'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SnapshotSummary200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function snapshotSummaryWithHttpInfo($ticker_any_of = null, string $contentType = self::contentTypes['snapshotSummary'][0]) + { + $request = $this->snapshotSummaryRequest($ticker_any_of, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\SnapshotSummary200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SnapshotSummary200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SnapshotSummary200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SnapshotSummary200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SnapshotSummary200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation snapshotSummaryAsync + * + * Summaries + * + * @param string $ticker_any_of Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshotSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function snapshotSummaryAsync($ticker_any_of = null, string $contentType = self::contentTypes['snapshotSummary'][0]) + { + return $this->snapshotSummaryAsyncWithHttpInfo($ticker_any_of, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation snapshotSummaryAsyncWithHttpInfo + * + * Summaries + * + * @param string $ticker_any_of Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshotSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function snapshotSummaryAsyncWithHttpInfo($ticker_any_of = null, string $contentType = self::contentTypes['snapshotSummary'][0]) + { + $returnType = '\OpenAPI\Client\Model\SnapshotSummary200Response'; + $request = $this->snapshotSummaryRequest($ticker_any_of, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'snapshotSummary' + * + * @param string $ticker_any_of Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See <a rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/docs/stocks/get_v3_reference_tickers\">the tickers endpoint</a> for more details on supported tickers. If no tickers are passed then no results will be returned. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshotSummary'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function snapshotSummaryRequest($ticker_any_of = null, string $contentType = self::contentTypes['snapshotSummary'][0]) + { + + + + $resourcePath = '/v1/summaries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_any_of, + 'ticker.any_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation snapshots + * + * Universal Snapshot + * + * @param string $ticker ticker (optional) + * @param string $type Query by the type of asset. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshots'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\Snapshots200Response + */ + public function snapshots($ticker = null, $type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['snapshots'][0]) + { + list($response) = $this->snapshotsWithHttpInfo($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation snapshotsWithHttpInfo + * + * Universal Snapshot + * + * @param string $ticker (optional) + * @param string $type Query by the type of asset. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshots'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\Snapshots200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function snapshotsWithHttpInfo($ticker = null, $type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['snapshots'][0]) + { + $request = $this->snapshotsRequest($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\Snapshots200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Snapshots200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Snapshots200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Snapshots200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\Snapshots200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation snapshotsAsync + * + * Universal Snapshot + * + * @param string $ticker (optional) + * @param string $type Query by the type of asset. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function snapshotsAsync($ticker = null, $type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['snapshots'][0]) + { + return $this->snapshotsAsyncWithHttpInfo($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation snapshotsAsyncWithHttpInfo + * + * Universal Snapshot + * + * @param string $ticker (optional) + * @param string $type Query by the type of asset. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function snapshotsAsyncWithHttpInfo($ticker = null, $type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['snapshots'][0]) + { + $returnType = '\OpenAPI\Client\Model\Snapshots200Response'; + $request = $this->snapshotsRequest($ticker, $type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'snapshots' + * + * @param string $ticker (optional) + * @param string $type Query by the type of asset. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['snapshots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function snapshotsRequest($ticker = null, $type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['snapshots'][0]) + { + + + + + + + + + + if ($limit !== null && $limit > 250) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DefaultApi.snapshots, must be smaller than or equal to 250.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DefaultApi.snapshots, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/snapshot'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_any_of, + 'ticker.any_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxaggregatesApi.php b/lib/Api/FxaggregatesApi.php new file mode 100644 index 0000000..6908cee --- /dev/null +++ b/lib/Api/FxaggregatesApi.php @@ -0,0 +1,3262 @@ + [ + 'application/json', + ], + 'forexMACD' => [ + 'application/json', + ], + 'forexRSI' => [ + 'application/json', + ], + 'forexSMA' => [ + 'application/json', + ], + 'v2AggsGroupedLocaleGlobalMarketFxDateGet' => [ + 'application/json', + ], + 'v2AggsTickerForexTickerPrevGet' => [ + 'application/json', + ], + 'v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation forexEMA + * + * Exponential Moving Average (EMA) + * + * @param string $fx_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoEMA200Response + */ + public function forexEMA($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexEMA'][0]) + { + list($response) = $this->forexEMAWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation forexEMAWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $fx_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoEMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function forexEMAWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexEMA'][0]) + { + $request = $this->forexEMARequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoEMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoEMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoEMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoEMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexEMAAsync + * + * Exponential Moving Average (EMA) + * + * @param string $fx_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexEMAAsync($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexEMA'][0]) + { + return $this->forexEMAAsyncWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexEMAAsyncWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $fx_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexEMAAsyncWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexEMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + $request = $this->forexEMARequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'forexEMA' + * + * @param string $fx_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexEMARequest($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexEMA'][0]) + { + + // verify the required parameter 'fx_ticker' is set + if ($fx_ticker === null || (is_array($fx_ticker) && count($fx_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $fx_ticker when calling forexEMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxaggregatesApi.forexEMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/ema/{fxTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($fx_ticker !== null) { + $resourcePath = str_replace( + '{' . 'fxTicker' . '}', + ObjectSerializer::toPathValue($fx_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexMACD + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $fx_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoMACD200Response + */ + public function forexMACD($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexMACD'][0]) + { + list($response) = $this->forexMACDWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation forexMACDWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $fx_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoMACD200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function forexMACDWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexMACD'][0]) + { + $request = $this->forexMACDRequest($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoMACD200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoMACD200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoMACD200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoMACD200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexMACDAsync + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $fx_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexMACDAsync($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexMACD'][0]) + { + return $this->forexMACDAsyncWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexMACDAsyncWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $fx_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexMACDAsyncWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexMACD'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + $request = $this->forexMACDRequest($fx_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'forexMACD' + * + * @param string $fx_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexMACDRequest($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexMACD'][0]) + { + + // verify the required parameter 'fx_ticker' is set + if ($fx_ticker === null || (is_array($fx_ticker) && count($fx_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $fx_ticker when calling forexMACD' + ); + } + + + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxaggregatesApi.forexMACD, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/macd/{fxTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $short_window, + 'short_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $long_window, + 'long_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signal_window, + 'signal_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($fx_ticker !== null) { + $resourcePath = str_replace( + '{' . 'fxTicker' . '}', + ObjectSerializer::toPathValue($fx_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexRSI + * + * Relative Strength Index (RSI) + * + * @param string $fx_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoRSI200Response + */ + public function forexRSI($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexRSI'][0]) + { + list($response) = $this->forexRSIWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation forexRSIWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $fx_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoRSI200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function forexRSIWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexRSI'][0]) + { + $request = $this->forexRSIRequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoRSI200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoRSI200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoRSI200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoRSI200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexRSIAsync + * + * Relative Strength Index (RSI) + * + * @param string $fx_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexRSIAsync($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexRSI'][0]) + { + return $this->forexRSIAsyncWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexRSIAsyncWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $fx_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexRSIAsyncWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexRSI'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + $request = $this->forexRSIRequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'forexRSI' + * + * @param string $fx_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexRSIRequest($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexRSI'][0]) + { + + // verify the required parameter 'fx_ticker' is set + if ($fx_ticker === null || (is_array($fx_ticker) && count($fx_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $fx_ticker when calling forexRSI' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxaggregatesApi.forexRSI, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/rsi/{fxTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($fx_ticker !== null) { + $resourcePath = str_replace( + '{' . 'fxTicker' . '}', + ObjectSerializer::toPathValue($fx_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexSMA + * + * Simple Moving Average (SMA) + * + * @param string $fx_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoSMA200Response + */ + public function forexSMA($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexSMA'][0]) + { + list($response) = $this->forexSMAWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation forexSMAWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $fx_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoSMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function forexSMAWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexSMA'][0]) + { + $request = $this->forexSMARequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoSMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoSMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoSMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoSMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexSMAAsync + * + * Simple Moving Average (SMA) + * + * @param string $fx_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexSMAAsync($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexSMA'][0]) + { + return $this->forexSMAAsyncWithHttpInfo($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexSMAAsyncWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $fx_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexSMAAsyncWithHttpInfo($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexSMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + $request = $this->forexSMARequest($fx_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'forexSMA' + * + * @param string $fx_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forexSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexSMARequest($fx_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['forexSMA'][0]) + { + + // verify the required parameter 'fx_ticker' is set + if ($fx_ticker === null || (is_array($fx_ticker) && count($fx_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $fx_ticker when calling forexSMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxaggregatesApi.forexSMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/sma/{fxTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($fx_ticker !== null) { + $resourcePath = str_replace( + '{' . 'fxTicker' . '}', + ObjectSerializer::toPathValue($fx_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketFxDateGet + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response + */ + public function v2AggsGroupedLocaleGlobalMarketFxDateGet($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'][0]) + { + list($response) = $this->v2AggsGroupedLocaleGlobalMarketFxDateGetWithHttpInfo($date, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketFxDateGetWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsGroupedLocaleGlobalMarketFxDateGetWithHttpInfo($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'][0]) + { + $request = $this->v2AggsGroupedLocaleGlobalMarketFxDateGetRequest($date, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketFxDateGetAsync + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleGlobalMarketFxDateGetAsync($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'][0]) + { + return $this->v2AggsGroupedLocaleGlobalMarketFxDateGetAsyncWithHttpInfo($date, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsGroupedLocaleGlobalMarketFxDateGetAsyncWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleGlobalMarketFxDateGetAsyncWithHttpInfo($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response'; + $request = $this->v2AggsGroupedLocaleGlobalMarketFxDateGetRequest($date, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsGroupedLocaleGlobalMarketFxDateGet' + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsGroupedLocaleGlobalMarketFxDateGetRequest($date, $adjusted = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleGlobalMarketFxDateGet'][0]) + { + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v2AggsGroupedLocaleGlobalMarketFxDateGet' + ); + } + + + + $resourcePath = '/v2/aggs/grouped/locale/global/market/fx/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerForexTickerPrevGet + * + * Previous Close + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response + */ + public function v2AggsTickerForexTickerPrevGet($forex_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerPrevGet'][0]) + { + list($response) = $this->v2AggsTickerForexTickerPrevGetWithHttpInfo($forex_ticker, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerForexTickerPrevGetWithHttpInfo + * + * Previous Close + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerForexTickerPrevGetWithHttpInfo($forex_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerPrevGet'][0]) + { + $request = $this->v2AggsTickerForexTickerPrevGetRequest($forex_ticker, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerForexTickerPrevGetAsync + * + * Previous Close + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerForexTickerPrevGetAsync($forex_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerPrevGet'][0]) + { + return $this->v2AggsTickerForexTickerPrevGetAsyncWithHttpInfo($forex_ticker, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerForexTickerPrevGetAsyncWithHttpInfo + * + * Previous Close + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerForexTickerPrevGetAsyncWithHttpInfo($forex_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerPrevGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerPrevGet200Response'; + $request = $this->v2AggsTickerForexTickerPrevGetRequest($forex_ticker, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerForexTickerPrevGet' + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerForexTickerPrevGetRequest($forex_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerPrevGet'][0]) + { + + // verify the required parameter 'forex_ticker' is set + if ($forex_ticker === null || (is_array($forex_ticker) && count($forex_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $forex_ticker when calling v2AggsTickerForexTickerPrevGet' + ); + } + + + + $resourcePath = '/v2/aggs/ticker/{forexTicker}/prev'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($forex_ticker !== null) { + $resourcePath = str_replace( + '{' . 'forexTicker' . '}', + ObjectSerializer::toPathValue($forex_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars) + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'][0]) + { + list($response) = $this->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetWithHttpInfo($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetWithHttpInfo($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'][0]) + { + $request = $this->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetRequest($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetAsync + * + * Aggregates (Bars) + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetAsync($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'][0]) + { + return $this->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetRequest($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + * + * @param string $forex_ticker The ticker symbol of the currency pair. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerForexTickerRangeMultiplierTimespanFromToGetRequest($forex_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet'][0]) + { + + // verify the required parameter 'forex_ticker' is set + if ($forex_ticker === null || (is_array($forex_ticker) && count($forex_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $forex_ticker when calling v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'multiplier' is set + if ($multiplier === null || (is_array($multiplier) && count($multiplier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multiplier when calling v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'timespan' is set + if ($timespan === null || (is_array($timespan) && count($timespan) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timespan when calling v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet' + ); + } + + + + + + $resourcePath = '/v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($forex_ticker !== null) { + $resourcePath = str_replace( + '{' . 'forexTicker' . '}', + ObjectSerializer::toPathValue($forex_ticker), + $resourcePath + ); + } + // path params + if ($multiplier !== null) { + $resourcePath = str_replace( + '{' . 'multiplier' . '}', + ObjectSerializer::toPathValue($multiplier), + $resourcePath + ); + } + // path params + if ($timespan !== null) { + $resourcePath = str_replace( + '{' . 'timespan' . '}', + ObjectSerializer::toPathValue($timespan), + $resourcePath + ); + } + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxconversionApi.php b/lib/Api/FxconversionApi.php new file mode 100644 index 0000000..c316a97 --- /dev/null +++ b/lib/Api/FxconversionApi.php @@ -0,0 +1,505 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation realTimeCurrencyConversion + * + * Real-time Currency Conversion + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param float $amount The amount to convert, with a decimal. (optional, default to 1) + * @param int $precision The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. (optional, default to 2) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['realTimeCurrencyConversion'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\RealTimeCurrencyConversion200Response + */ + public function realTimeCurrencyConversion($from, $to, $amount = 1, $precision = 2, string $contentType = self::contentTypes['realTimeCurrencyConversion'][0]) + { + list($response) = $this->realTimeCurrencyConversionWithHttpInfo($from, $to, $amount, $precision, $contentType); + return $response; + } + + /** + * Operation realTimeCurrencyConversionWithHttpInfo + * + * Real-time Currency Conversion + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param float $amount The amount to convert, with a decimal. (optional, default to 1) + * @param int $precision The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. (optional, default to 2) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['realTimeCurrencyConversion'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\RealTimeCurrencyConversion200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function realTimeCurrencyConversionWithHttpInfo($from, $to, $amount = 1, $precision = 2, string $contentType = self::contentTypes['realTimeCurrencyConversion'][0]) + { + $request = $this->realTimeCurrencyConversionRequest($from, $to, $amount, $precision, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation realTimeCurrencyConversionAsync + * + * Real-time Currency Conversion + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param float $amount The amount to convert, with a decimal. (optional, default to 1) + * @param int $precision The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. (optional, default to 2) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['realTimeCurrencyConversion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function realTimeCurrencyConversionAsync($from, $to, $amount = 1, $precision = 2, string $contentType = self::contentTypes['realTimeCurrencyConversion'][0]) + { + return $this->realTimeCurrencyConversionAsyncWithHttpInfo($from, $to, $amount, $precision, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation realTimeCurrencyConversionAsyncWithHttpInfo + * + * Real-time Currency Conversion + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param float $amount The amount to convert, with a decimal. (optional, default to 1) + * @param int $precision The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. (optional, default to 2) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['realTimeCurrencyConversion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function realTimeCurrencyConversionAsyncWithHttpInfo($from, $to, $amount = 1, $precision = 2, string $contentType = self::contentTypes['realTimeCurrencyConversion'][0]) + { + $returnType = '\OpenAPI\Client\Model\RealTimeCurrencyConversion200Response'; + $request = $this->realTimeCurrencyConversionRequest($from, $to, $amount, $precision, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'realTimeCurrencyConversion' + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param float $amount The amount to convert, with a decimal. (optional, default to 1) + * @param int $precision The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. (optional, default to 2) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['realTimeCurrencyConversion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function realTimeCurrencyConversionRequest($from, $to, $amount = 1, $precision = 2, string $contentType = self::contentTypes['realTimeCurrencyConversion'][0]) + { + + // 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 realTimeCurrencyConversion' + ); + } + + // 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 realTimeCurrencyConversion' + ); + } + + + + + $resourcePath = '/v1/conversion/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $amount, + 'amount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $precision, + 'precision', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxlastquoteApi.php b/lib/Api/FxlastquoteApi.php new file mode 100644 index 0000000..d642785 --- /dev/null +++ b/lib/Api/FxlastquoteApi.php @@ -0,0 +1,475 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation lastQuoteCurrencies + * + * Last Quote for a Currency Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuoteCurrencies'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\LastQuoteCurrencies200Response + */ + public function lastQuoteCurrencies($from, $to, string $contentType = self::contentTypes['lastQuoteCurrencies'][0]) + { + list($response) = $this->lastQuoteCurrenciesWithHttpInfo($from, $to, $contentType); + return $response; + } + + /** + * Operation lastQuoteCurrenciesWithHttpInfo + * + * Last Quote for a Currency Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuoteCurrencies'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\LastQuoteCurrencies200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function lastQuoteCurrenciesWithHttpInfo($from, $to, string $contentType = self::contentTypes['lastQuoteCurrencies'][0]) + { + $request = $this->lastQuoteCurrenciesRequest($from, $to, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\LastQuoteCurrencies200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LastQuoteCurrencies200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LastQuoteCurrencies200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\LastQuoteCurrencies200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\LastQuoteCurrencies200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastQuoteCurrenciesAsync + * + * Last Quote for a Currency Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuoteCurrencies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastQuoteCurrenciesAsync($from, $to, string $contentType = self::contentTypes['lastQuoteCurrencies'][0]) + { + return $this->lastQuoteCurrenciesAsyncWithHttpInfo($from, $to, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastQuoteCurrenciesAsyncWithHttpInfo + * + * Last Quote for a Currency Pair + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuoteCurrencies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastQuoteCurrenciesAsyncWithHttpInfo($from, $to, string $contentType = self::contentTypes['lastQuoteCurrencies'][0]) + { + $returnType = '\OpenAPI\Client\Model\LastQuoteCurrencies200Response'; + $request = $this->lastQuoteCurrenciesRequest($from, $to, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'lastQuoteCurrencies' + * + * @param string $from The \"from\" symbol of the pair. (required) + * @param string $to The \"to\" symbol of the pair. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuoteCurrencies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastQuoteCurrenciesRequest($from, $to, string $contentType = self::contentTypes['lastQuoteCurrencies'][0]) + { + + // 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 lastQuoteCurrencies' + ); + } + + // 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 lastQuoteCurrencies' + ); + } + + + $resourcePath = '/v1/last_quote/currencies/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxquotesApi.php b/lib/Api/FxquotesApi.php new file mode 100644 index 0000000..08ca9fd --- /dev/null +++ b/lib/Api/FxquotesApi.php @@ -0,0 +1,581 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation quotesFx + * + * Quotes (BBO) + * + * @param string $fx_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesFx'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\QuotesFx200Response + */ + public function quotesFx($fx_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesFx'][0]) + { + list($response) = $this->quotesFxWithHttpInfo($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation quotesFxWithHttpInfo + * + * Quotes (BBO) + * + * @param string $fx_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesFx'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\QuotesFx200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function quotesFxWithHttpInfo($fx_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesFx'][0]) + { + $request = $this->quotesFxRequest($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\QuotesFx200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\QuotesFx200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\QuotesFx200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\QuotesFx200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\QuotesFx200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation quotesFxAsync + * + * Quotes (BBO) + * + * @param string $fx_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesFx'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesFxAsync($fx_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesFx'][0]) + { + return $this->quotesFxAsyncWithHttpInfo($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation quotesFxAsyncWithHttpInfo + * + * Quotes (BBO) + * + * @param string $fx_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesFx'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesFxAsyncWithHttpInfo($fx_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesFx'][0]) + { + $returnType = '\OpenAPI\Client\Model\QuotesFx200Response'; + $request = $this->quotesFxRequest($fx_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'quotesFx' + * + * @param string $fx_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesFx'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function quotesFxRequest($fx_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesFx'][0]) + { + + // verify the required parameter 'fx_ticker' is set + if ($fx_ticker === null || (is_array($fx_ticker) && count($fx_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $fx_ticker when calling quotesFx' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxquotesApi.quotesFx, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FxquotesApi.quotesFx, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/quotes/{fxTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($fx_ticker !== null) { + $resourcePath = str_replace( + '{' . 'fxTicker' . '}', + ObjectSerializer::toPathValue($fx_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxsnapshotApi.php b/lib/Api/FxsnapshotApi.php new file mode 100644 index 0000000..26356fe --- /dev/null +++ b/lib/Api/FxsnapshotApi.php @@ -0,0 +1,1080 @@ + [ + 'application/json', + ], + 'v2SnapshotLocaleGlobalMarketsForexTickersGet' => [ + 'application/json', + ], + 'v2SnapshotLocaleGlobalMarketsForexTickersTickerGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexDirectionGet + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsForexDirectionGet($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsForexDirectionGetWithHttpInfo($direction, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexDirectionGetWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsForexDirectionGetWithHttpInfo($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsForexDirectionGetRequest($direction, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexDirectionGetAsync + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexDirectionGetAsync($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsForexDirectionGetAsyncWithHttpInfo($direction, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexDirectionGetAsyncWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexDirectionGetAsyncWithHttpInfo($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsForexDirectionGetRequest($direction, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsForexDirectionGet' + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsForexDirectionGetRequest($direction, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexDirectionGet'][0]) + { + + // verify the required parameter 'direction' is set + if ($direction === null || (is_array($direction) && count($direction) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $direction when calling v2SnapshotLocaleGlobalMarketsForexDirectionGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/global/markets/forex/{direction}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($direction !== null) { + $resourcePath = str_replace( + '{' . 'direction' . '}', + ObjectSerializer::toPathValue($direction), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersGet + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersGet($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsForexTickersGetWithHttpInfo($tickers, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersGetWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersGetWithHttpInfo($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsForexTickersGetRequest($tickers, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersGetAsync + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersGetAsync($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsForexTickersGetAsyncWithHttpInfo($tickers, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersGetAsyncWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersGetAsyncWithHttpInfo($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsForexTickersGetRequest($tickers, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsForexTickersGet' + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersGetRequest($tickers = null, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersGet'][0]) + { + + + + $resourcePath = '/v2/snapshot/locale/global/markets/forex/tickers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tickers, + 'tickers', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersTickerGet + * + * Ticker + * + * @param string $ticker The forex ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersTickerGet($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'][0]) + { + list($response) = $this->v2SnapshotLocaleGlobalMarketsForexTickersTickerGetWithHttpInfo($ticker, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersTickerGetWithHttpInfo + * + * Ticker + * + * @param string $ticker The forex ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersTickerGetWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'][0]) + { + $request = $this->v2SnapshotLocaleGlobalMarketsForexTickersTickerGetRequest($ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersTickerGetAsync + * + * Ticker + * + * @param string $ticker The forex ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersTickerGetAsync($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'][0]) + { + return $this->v2SnapshotLocaleGlobalMarketsForexTickersTickerGetAsyncWithHttpInfo($ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleGlobalMarketsForexTickersTickerGetAsyncWithHttpInfo + * + * Ticker + * + * @param string $ticker The forex ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersTickerGetAsyncWithHttpInfo($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response'; + $request = $this->v2SnapshotLocaleGlobalMarketsForexTickersTickerGetRequest($ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleGlobalMarketsForexTickersTickerGet' + * + * @param string $ticker The forex ticker. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleGlobalMarketsForexTickersTickerGetRequest($ticker, string $contentType = self::contentTypes['v2SnapshotLocaleGlobalMarketsForexTickersTickerGet'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling v2SnapshotLocaleGlobalMarketsForexTickersTickerGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/global/markets/forex/tickers/{ticker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FxtradesApi.php b/lib/Api/FxtradesApi.php new file mode 100644 index 0000000..cf7135b --- /dev/null +++ b/lib/Api/FxtradesApi.php @@ -0,0 +1,525 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v1HistoricForexFromToDateGet + * + * Historic Forex Ticks + * + * @param string $from The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. (required) + * @param string $to The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricForexFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response + */ + public function v1HistoricForexFromToDateGet($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricForexFromToDateGet'][0]) + { + list($response) = $this->v1HistoricForexFromToDateGetWithHttpInfo($from, $to, $date, $offset, $limit, $contentType); + return $response; + } + + /** + * Operation v1HistoricForexFromToDateGetWithHttpInfo + * + * Historic Forex Ticks + * + * @param string $from The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. (required) + * @param string $to The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricForexFromToDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1HistoricForexFromToDateGetWithHttpInfo($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricForexFromToDateGet'][0]) + { + $request = $this->v1HistoricForexFromToDateGetRequest($from, $to, $date, $offset, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1HistoricForexFromToDateGetAsync + * + * Historic Forex Ticks + * + * @param string $from The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. (required) + * @param string $to The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricForexFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1HistoricForexFromToDateGetAsync($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricForexFromToDateGet'][0]) + { + return $this->v1HistoricForexFromToDateGetAsyncWithHttpInfo($from, $to, $date, $offset, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1HistoricForexFromToDateGetAsyncWithHttpInfo + * + * Historic Forex Ticks + * + * @param string $from The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. (required) + * @param string $to The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricForexFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1HistoricForexFromToDateGetAsyncWithHttpInfo($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricForexFromToDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200Response'; + $request = $this->v1HistoricForexFromToDateGetRequest($from, $to, $date, $offset, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1HistoricForexFromToDateGet' + * + * @param string $from The \"from\" symbol of the currency pair. Example: For **USD/JPY** the `from` would be **USD**. (required) + * @param string $to The \"to\" symbol of the currency pair. Example: For **USD/JPY** the `to` would be **JPY**. (required) + * @param \DateTime $date The date/day of the historic ticks to retrieve. (required) + * @param int $offset The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $limit Limit the size of the response, max 10000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HistoricForexFromToDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1HistoricForexFromToDateGetRequest($from, $to, $date, $offset = null, $limit = null, string $contentType = self::contentTypes['v1HistoricForexFromToDateGet'][0]) + { + + // 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 v1HistoricForexFromToDateGet' + ); + } + + // 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 v1HistoricForexFromToDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1HistoricForexFromToDateGet' + ); + } + + + + + $resourcePath = '/v1/historic/forex/{from}/{to}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/IndicesaggregatesApi.php b/lib/Api/IndicesaggregatesApi.php new file mode 100644 index 0000000..5938133 --- /dev/null +++ b/lib/Api/IndicesaggregatesApi.php @@ -0,0 +1,2902 @@ + [ + 'application/json', + ], + 'indicesMACD' => [ + 'application/json', + ], + 'indicesRSI' => [ + 'application/json', + ], + 'indicesSMA' => [ + 'application/json', + ], + 'v2AggsTickerIndicesTickerPrevGet' => [ + 'application/json', + ], + 'v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation indicesEMA + * + * Exponential Moving Average (EMA) + * + * @param string $indices_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoEMA200Response + */ + public function indicesEMA($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesEMA'][0]) + { + list($response) = $this->indicesEMAWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation indicesEMAWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $indices_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoEMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesEMAWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesEMA'][0]) + { + $request = $this->indicesEMARequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoEMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoEMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoEMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoEMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesEMAAsync + * + * Exponential Moving Average (EMA) + * + * @param string $indices_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesEMAAsync($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesEMA'][0]) + { + return $this->indicesEMAAsyncWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesEMAAsyncWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $indices_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesEMAAsyncWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesEMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + $request = $this->indicesEMARequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'indicesEMA' + * + * @param string $indices_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesEMARequest($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesEMA'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling indicesEMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicesaggregatesApi.indicesEMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/ema/{indicesTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indicesMACD + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $indices_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoMACD200Response + */ + public function indicesMACD($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesMACD'][0]) + { + list($response) = $this->indicesMACDWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation indicesMACDWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $indices_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoMACD200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesMACDWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesMACD'][0]) + { + $request = $this->indicesMACDRequest($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoMACD200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoMACD200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoMACD200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoMACD200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesMACDAsync + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $indices_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesMACDAsync($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesMACD'][0]) + { + return $this->indicesMACDAsyncWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesMACDAsyncWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $indices_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesMACDAsyncWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesMACD'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + $request = $this->indicesMACDRequest($indices_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'indicesMACD' + * + * @param string $indices_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesMACDRequest($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesMACD'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling indicesMACD' + ); + } + + + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicesaggregatesApi.indicesMACD, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/macd/{indicesTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $short_window, + 'short_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $long_window, + 'long_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signal_window, + 'signal_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indicesRSI + * + * Relative Strength Index (RSI) + * + * @param string $indices_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoRSI200Response + */ + public function indicesRSI($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesRSI'][0]) + { + list($response) = $this->indicesRSIWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation indicesRSIWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $indices_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoRSI200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesRSIWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesRSI'][0]) + { + $request = $this->indicesRSIRequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoRSI200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoRSI200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoRSI200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoRSI200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesRSIAsync + * + * Relative Strength Index (RSI) + * + * @param string $indices_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesRSIAsync($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesRSI'][0]) + { + return $this->indicesRSIAsyncWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesRSIAsyncWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $indices_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesRSIAsyncWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesRSI'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + $request = $this->indicesRSIRequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'indicesRSI' + * + * @param string $indices_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesRSIRequest($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesRSI'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling indicesRSI' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicesaggregatesApi.indicesRSI, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/rsi/{indicesTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indicesSMA + * + * Simple Moving Average (SMA) + * + * @param string $indices_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoSMA200Response + */ + public function indicesSMA($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesSMA'][0]) + { + list($response) = $this->indicesSMAWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation indicesSMAWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $indices_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoSMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesSMAWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesSMA'][0]) + { + $request = $this->indicesSMARequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoSMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoSMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoSMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoSMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesSMAAsync + * + * Simple Moving Average (SMA) + * + * @param string $indices_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesSMAAsync($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesSMA'][0]) + { + return $this->indicesSMAAsyncWithHttpInfo($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesSMAAsyncWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $indices_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesSMAAsyncWithHttpInfo($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesSMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + $request = $this->indicesSMARequest($indices_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'indicesSMA' + * + * @param string $indices_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesSMARequest($indices_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['indicesSMA'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling indicesSMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicesaggregatesApi.indicesSMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/sma/{indicesTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerIndicesTickerPrevGet + * + * Previous Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response + */ + public function v2AggsTickerIndicesTickerPrevGet($indices_ticker, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerPrevGet'][0]) + { + list($response) = $this->v2AggsTickerIndicesTickerPrevGetWithHttpInfo($indices_ticker, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerIndicesTickerPrevGetWithHttpInfo + * + * Previous Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerIndicesTickerPrevGetWithHttpInfo($indices_ticker, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerPrevGet'][0]) + { + $request = $this->v2AggsTickerIndicesTickerPrevGetRequest($indices_ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerIndicesTickerPrevGetAsync + * + * Previous Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerIndicesTickerPrevGetAsync($indices_ticker, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerPrevGet'][0]) + { + return $this->v2AggsTickerIndicesTickerPrevGetAsyncWithHttpInfo($indices_ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerIndicesTickerPrevGetAsyncWithHttpInfo + * + * Previous Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerIndicesTickerPrevGetAsyncWithHttpInfo($indices_ticker, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerPrevGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response'; + $request = $this->v2AggsTickerIndicesTickerPrevGetRequest($indices_ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerIndicesTickerPrevGet' + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerIndicesTickerPrevGetRequest($indices_ticker, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerPrevGet'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling v2AggsTickerIndicesTickerPrevGet' + ); + } + + + $resourcePath = '/v2/aggs/ticker/{indicesTicker}/prev'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars) + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response + */ + public function v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet($indices_ticker, $multiplier, $timespan, $from, $to, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'][0]) + { + list($response) = $this->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetWithHttpInfo($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetWithHttpInfo($indices_ticker, $multiplier, $timespan, $from, $to, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'][0]) + { + $request = $this->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetRequest($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetAsync + * + * Aggregates (Bars) + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetAsync($indices_ticker, $multiplier, $timespan, $from, $to, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'][0]) + { + return $this->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($indices_ticker, $multiplier, $timespan, $from, $to, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200Response'; + $request = $this->v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetRequest($indices_ticker, $multiplier, $timespan, $from, $to, $sort, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGetRequest($indices_ticker, $multiplier, $timespan, $from, $to, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'multiplier' is set + if ($multiplier === null || (is_array($multiplier) && count($multiplier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multiplier when calling v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'timespan' is set + if ($timespan === null || (is_array($timespan) && count($timespan) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timespan when calling v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet' + ); + } + + + + + $resourcePath = '/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + // path params + if ($multiplier !== null) { + $resourcePath = str_replace( + '{' . 'multiplier' . '}', + ObjectSerializer::toPathValue($multiplier), + $resourcePath + ); + } + // path params + if ($timespan !== null) { + $resourcePath = str_replace( + '{' . 'timespan' . '}', + ObjectSerializer::toPathValue($timespan), + $resourcePath + ); + } + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/IndicessnapshotApi.php b/lib/Api/IndicessnapshotApi.php new file mode 100644 index 0000000..96f5537 --- /dev/null +++ b/lib/Api/IndicessnapshotApi.php @@ -0,0 +1,576 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation indicesSnapshot + * + * Indices Snapshot + * + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $ticker Search a range of tickers lexicographically. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSnapshot'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\IndicesSnapshot200Response + */ + public function indicesSnapshot($ticker_any_of = null, $ticker = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['indicesSnapshot'][0]) + { + list($response) = $this->indicesSnapshotWithHttpInfo($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation indicesSnapshotWithHttpInfo + * + * Indices Snapshot + * + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $ticker Search a range of tickers lexicographically. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSnapshot'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\IndicesSnapshot200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesSnapshotWithHttpInfo($ticker_any_of = null, $ticker = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['indicesSnapshot'][0]) + { + $request = $this->indicesSnapshotRequest($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\IndicesSnapshot200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\IndicesSnapshot200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\IndicesSnapshot200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\IndicesSnapshot200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\IndicesSnapshot200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesSnapshotAsync + * + * Indices Snapshot + * + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $ticker Search a range of tickers lexicographically. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSnapshot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesSnapshotAsync($ticker_any_of = null, $ticker = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['indicesSnapshot'][0]) + { + return $this->indicesSnapshotAsyncWithHttpInfo($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesSnapshotAsyncWithHttpInfo + * + * Indices Snapshot + * + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $ticker Search a range of tickers lexicographically. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSnapshot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesSnapshotAsyncWithHttpInfo($ticker_any_of = null, $ticker = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['indicesSnapshot'][0]) + { + $returnType = '\OpenAPI\Client\Model\IndicesSnapshot200Response'; + $request = $this->indicesSnapshotRequest($ticker_any_of, $ticker, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'indicesSnapshot' + * + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $ticker Search a range of tickers lexicographically. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indicesSnapshot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesSnapshotRequest($ticker_any_of = null, $ticker = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['indicesSnapshot'][0]) + { + + + + + + + + + if ($limit !== null && $limit > 250) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicessnapshotApi.indicesSnapshot, must be smaller than or equal to 250.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling IndicessnapshotApi.indicesSnapshot, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/snapshot/indices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_any_of, + 'ticker.any_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/InternalApi.php b/lib/Api/InternalApi.php new file mode 100644 index 0000000..1aec558 --- /dev/null +++ b/lib/Api/InternalApi.php @@ -0,0 +1,606 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listTickerTaxonomyClassifications + * + * Ticker Taxonomies + * + * @param string $ticker ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response + */ + public function listTickerTaxonomyClassifications($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + list($response) = $this->listTickerTaxonomyClassificationsWithHttpInfo($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listTickerTaxonomyClassificationsWithHttpInfo + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listTickerTaxonomyClassificationsWithHttpInfo($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + $request = $this->listTickerTaxonomyClassificationsRequest($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listTickerTaxonomyClassificationsAsync + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTaxonomyClassificationsAsync($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + return $this->listTickerTaxonomyClassificationsAsyncWithHttpInfo($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listTickerTaxonomyClassificationsAsyncWithHttpInfo + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTaxonomyClassificationsAsyncWithHttpInfo($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response'; + $request = $this->listTickerTaxonomyClassificationsRequest($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listTickerTaxonomyClassifications' + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listTickerTaxonomyClassificationsRequest($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + + + + + + + + + + + if ($limit !== null && $limit > 250) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling InternalApi.listTickerTaxonomyClassifications, must be smaller than or equal to 250.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling InternalApi.listTickerTaxonomyClassifications, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/vX/reference/tickers/taxonomies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category, + 'category', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tag, + 'tag', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_any_of, + 'ticker.any_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionsaggregatesApi.php b/lib/Api/OptionsaggregatesApi.php new file mode 100644 index 0000000..ca95afe --- /dev/null +++ b/lib/Api/OptionsaggregatesApi.php @@ -0,0 +1,2932 @@ + [ + 'application/json', + ], + 'optionsMACD' => [ + 'application/json', + ], + 'optionsRSI' => [ + 'application/json', + ], + 'optionsSMA' => [ + 'application/json', + ], + 'v2AggsTickerOptionsTickerPrevGet' => [ + 'application/json', + ], + 'v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation optionsEMA + * + * Exponential Moving Average (EMA) + * + * @param string $options_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoEMA200Response + */ + public function optionsEMA($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsEMA'][0]) + { + list($response) = $this->optionsEMAWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation optionsEMAWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $options_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsEMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoEMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionsEMAWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsEMA'][0]) + { + $request = $this->optionsEMARequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoEMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoEMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoEMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoEMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionsEMAAsync + * + * Exponential Moving Average (EMA) + * + * @param string $options_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsEMAAsync($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsEMA'][0]) + { + return $this->optionsEMAAsyncWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionsEMAAsyncWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $options_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsEMAAsyncWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsEMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + $request = $this->optionsEMARequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionsEMA' + * + * @param string $options_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsEMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionsEMARequest($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsEMA'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling optionsEMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsaggregatesApi.optionsEMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/ema/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation optionsMACD + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $options_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoMACD200Response + */ + public function optionsMACD($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsMACD'][0]) + { + list($response) = $this->optionsMACDWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation optionsMACDWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $options_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsMACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoMACD200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionsMACDWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsMACD'][0]) + { + $request = $this->optionsMACDRequest($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoMACD200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoMACD200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoMACD200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoMACD200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionsMACDAsync + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $options_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsMACDAsync($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsMACD'][0]) + { + return $this->optionsMACDAsyncWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionsMACDAsyncWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $options_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsMACDAsyncWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsMACD'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + $request = $this->optionsMACDRequest($options_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionsMACD' + * + * @param string $options_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsMACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionsMACDRequest($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsMACD'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling optionsMACD' + ); + } + + + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsaggregatesApi.optionsMACD, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/macd/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $short_window, + 'short_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $long_window, + 'long_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signal_window, + 'signal_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation optionsRSI + * + * Relative Strength Index (RSI) + * + * @param string $options_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoRSI200Response + */ + public function optionsRSI($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsRSI'][0]) + { + list($response) = $this->optionsRSIWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation optionsRSIWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $options_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsRSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoRSI200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionsRSIWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsRSI'][0]) + { + $request = $this->optionsRSIRequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoRSI200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoRSI200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoRSI200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoRSI200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionsRSIAsync + * + * Relative Strength Index (RSI) + * + * @param string $options_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsRSIAsync($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsRSI'][0]) + { + return $this->optionsRSIAsyncWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionsRSIAsyncWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $options_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsRSIAsyncWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsRSI'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + $request = $this->optionsRSIRequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionsRSI' + * + * @param string $options_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsRSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionsRSIRequest($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsRSI'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling optionsRSI' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsaggregatesApi.optionsRSI, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/rsi/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation optionsSMA + * + * Simple Moving Average (SMA) + * + * @param string $options_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoSMA200Response + */ + public function optionsSMA($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsSMA'][0]) + { + list($response) = $this->optionsSMAWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation optionsSMAWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $options_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsSMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoSMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionsSMAWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsSMA'][0]) + { + $request = $this->optionsSMARequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoSMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoSMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoSMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoSMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionsSMAAsync + * + * Simple Moving Average (SMA) + * + * @param string $options_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsSMAAsync($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsSMA'][0]) + { + return $this->optionsSMAAsyncWithHttpInfo($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionsSMAAsyncWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $options_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsSMAAsyncWithHttpInfo($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsSMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + $request = $this->optionsSMARequest($options_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionsSMA' + * + * @param string $options_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsSMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionsSMARequest($options_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['optionsSMA'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling optionsSMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsaggregatesApi.optionsSMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/sma/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerOptionsTickerPrevGet + * + * Previous Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerOptionsTickerPrevGet($options_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerPrevGet'][0]) + { + list($response) = $this->v2AggsTickerOptionsTickerPrevGetWithHttpInfo($options_ticker, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerOptionsTickerPrevGetWithHttpInfo + * + * Previous Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerOptionsTickerPrevGetWithHttpInfo($options_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerPrevGet'][0]) + { + $request = $this->v2AggsTickerOptionsTickerPrevGetRequest($options_ticker, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerOptionsTickerPrevGetAsync + * + * Previous Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerOptionsTickerPrevGetAsync($options_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerPrevGet'][0]) + { + return $this->v2AggsTickerOptionsTickerPrevGetAsyncWithHttpInfo($options_ticker, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerOptionsTickerPrevGetAsyncWithHttpInfo + * + * Previous Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerOptionsTickerPrevGetAsyncWithHttpInfo($options_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerPrevGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerOptionsTickerPrevGetRequest($options_ticker, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerOptionsTickerPrevGet' + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerOptionsTickerPrevGetRequest($options_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerPrevGet'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling v2AggsTickerOptionsTickerPrevGet' + ); + } + + + + $resourcePath = '/v2/aggs/ticker/{optionsTicker}/prev'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars) + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet($options_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'][0]) + { + list($response) = $this->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetWithHttpInfo($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetWithHttpInfo($options_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'][0]) + { + $request = $this->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetRequest($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetAsync + * + * Aggregates (Bars) + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetAsync($options_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'][0]) + { + return $this->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($options_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetRequest($options_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGetRequest($options_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'multiplier' is set + if ($multiplier === null || (is_array($multiplier) && count($multiplier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multiplier when calling v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'timespan' is set + if ($timespan === null || (is_array($timespan) && count($timespan) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timespan when calling v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet' + ); + } + + + + + + $resourcePath = '/v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + // path params + if ($multiplier !== null) { + $resourcePath = str_replace( + '{' . 'multiplier' . '}', + ObjectSerializer::toPathValue($multiplier), + $resourcePath + ); + } + // path params + if ($timespan !== null) { + $resourcePath = str_replace( + '{' . 'timespan' . '}', + ObjectSerializer::toPathValue($timespan), + $resourcePath + ); + } + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionslasttradeApi.php b/lib/Api/OptionslasttradeApi.php new file mode 100644 index 0000000..eb42551 --- /dev/null +++ b/lib/Api/OptionslasttradeApi.php @@ -0,0 +1,455 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation lastTradeOptions + * + * Last Trade + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\LastTradeOptions200Response + */ + public function lastTradeOptions($options_ticker, string $contentType = self::contentTypes['lastTradeOptions'][0]) + { + list($response) = $this->lastTradeOptionsWithHttpInfo($options_ticker, $contentType); + return $response; + } + + /** + * Operation lastTradeOptionsWithHttpInfo + * + * Last Trade + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\LastTradeOptions200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function lastTradeOptionsWithHttpInfo($options_ticker, string $contentType = self::contentTypes['lastTradeOptions'][0]) + { + $request = $this->lastTradeOptionsRequest($options_ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\LastTradeOptions200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LastTradeOptions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LastTradeOptions200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\LastTradeOptions200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\LastTradeOptions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastTradeOptionsAsync + * + * Last Trade + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeOptionsAsync($options_ticker, string $contentType = self::contentTypes['lastTradeOptions'][0]) + { + return $this->lastTradeOptionsAsyncWithHttpInfo($options_ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastTradeOptionsAsyncWithHttpInfo + * + * Last Trade + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeOptionsAsyncWithHttpInfo($options_ticker, string $contentType = self::contentTypes['lastTradeOptions'][0]) + { + $returnType = '\OpenAPI\Client\Model\LastTradeOptions200Response'; + $request = $this->lastTradeOptionsRequest($options_ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'lastTradeOptions' + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTradeOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastTradeOptionsRequest($options_ticker, string $contentType = self::contentTypes['lastTradeOptions'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling lastTradeOptions' + ); + } + + + $resourcePath = '/v2/last/trade/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionsopenCloseApi.php b/lib/Api/OptionsopenCloseApi.php new file mode 100644 index 0000000..554bcba --- /dev/null +++ b/lib/Api/OptionsopenCloseApi.php @@ -0,0 +1,490 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v1OpenCloseOptionsTickerDateGet + * + * Daily Open/Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseOptionsTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response + */ + public function v1OpenCloseOptionsTickerDateGet($options_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseOptionsTickerDateGet'][0]) + { + list($response) = $this->v1OpenCloseOptionsTickerDateGetWithHttpInfo($options_ticker, $date, $adjusted, $contentType); + return $response; + } + + /** + * Operation v1OpenCloseOptionsTickerDateGetWithHttpInfo + * + * Daily Open/Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseOptionsTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1OpenCloseOptionsTickerDateGetWithHttpInfo($options_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseOptionsTickerDateGet'][0]) + { + $request = $this->v1OpenCloseOptionsTickerDateGetRequest($options_ticker, $date, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1OpenCloseOptionsTickerDateGetAsync + * + * Daily Open/Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseOptionsTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseOptionsTickerDateGetAsync($options_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseOptionsTickerDateGet'][0]) + { + return $this->v1OpenCloseOptionsTickerDateGetAsyncWithHttpInfo($options_ticker, $date, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1OpenCloseOptionsTickerDateGetAsyncWithHttpInfo + * + * Daily Open/Close + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseOptionsTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseOptionsTickerDateGetAsyncWithHttpInfo($options_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseOptionsTickerDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response'; + $request = $this->v1OpenCloseOptionsTickerDateGetRequest($options_ticker, $date, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1OpenCloseOptionsTickerDateGet' + * + * @param string $options_ticker The ticker symbol of the options contract. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseOptionsTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1OpenCloseOptionsTickerDateGetRequest($options_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseOptionsTickerDateGet'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling v1OpenCloseOptionsTickerDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1OpenCloseOptionsTickerDateGet' + ); + } + + + + $resourcePath = '/v1/open-close/{optionsTicker}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionsquotesApi.php b/lib/Api/OptionsquotesApi.php new file mode 100644 index 0000000..e37f9f5 --- /dev/null +++ b/lib/Api/OptionsquotesApi.php @@ -0,0 +1,581 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation quotesOptions + * + * Quotes + * + * @param string $options_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\QuotesOptions200Response + */ + public function quotesOptions($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesOptions'][0]) + { + list($response) = $this->quotesOptionsWithHttpInfo($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation quotesOptionsWithHttpInfo + * + * Quotes + * + * @param string $options_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\QuotesOptions200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function quotesOptionsWithHttpInfo($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesOptions'][0]) + { + $request = $this->quotesOptionsRequest($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\QuotesOptions200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\QuotesOptions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\QuotesOptions200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\QuotesOptions200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\QuotesOptions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation quotesOptionsAsync + * + * Quotes + * + * @param string $options_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesOptionsAsync($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesOptions'][0]) + { + return $this->quotesOptionsAsyncWithHttpInfo($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation quotesOptionsAsyncWithHttpInfo + * + * Quotes + * + * @param string $options_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesOptionsAsyncWithHttpInfo($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesOptions'][0]) + { + $returnType = '\OpenAPI\Client\Model\QuotesOptions200Response'; + $request = $this->quotesOptionsRequest($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'quotesOptions' + * + * @param string $options_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function quotesOptionsRequest($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotesOptions'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling quotesOptions' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsquotesApi.quotesOptions, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionsquotesApi.quotesOptions, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/quotes/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionssnapshotApi.php b/lib/Api/OptionssnapshotApi.php new file mode 100644 index 0000000..2664a9d --- /dev/null +++ b/lib/Api/OptionssnapshotApi.php @@ -0,0 +1,1006 @@ + [ + 'application/json', + ], + 'optionsChain' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation optionContract + * + * Option Contract + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param string $option_contract The option contract identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionContract'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\OptionContract200Response + */ + public function optionContract($underlying_asset, $option_contract, string $contentType = self::contentTypes['optionContract'][0]) + { + list($response) = $this->optionContractWithHttpInfo($underlying_asset, $option_contract, $contentType); + return $response; + } + + /** + * Operation optionContractWithHttpInfo + * + * Option Contract + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param string $option_contract The option contract identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionContract'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\OptionContract200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionContractWithHttpInfo($underlying_asset, $option_contract, string $contentType = self::contentTypes['optionContract'][0]) + { + $request = $this->optionContractRequest($underlying_asset, $option_contract, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\OptionContract200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptionContract200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OptionContract200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\OptionContract200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\OptionContract200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionContractAsync + * + * Option Contract + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param string $option_contract The option contract identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionContractAsync($underlying_asset, $option_contract, string $contentType = self::contentTypes['optionContract'][0]) + { + return $this->optionContractAsyncWithHttpInfo($underlying_asset, $option_contract, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionContractAsyncWithHttpInfo + * + * Option Contract + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param string $option_contract The option contract identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionContractAsyncWithHttpInfo($underlying_asset, $option_contract, string $contentType = self::contentTypes['optionContract'][0]) + { + $returnType = '\OpenAPI\Client\Model\OptionContract200Response'; + $request = $this->optionContractRequest($underlying_asset, $option_contract, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionContract' + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param string $option_contract The option contract identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionContractRequest($underlying_asset, $option_contract, string $contentType = self::contentTypes['optionContract'][0]) + { + + // verify the required parameter 'underlying_asset' is set + if ($underlying_asset === null || (is_array($underlying_asset) && count($underlying_asset) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying_asset when calling optionContract' + ); + } + + // verify the required parameter 'option_contract' is set + if ($option_contract === null || (is_array($option_contract) && count($option_contract) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $option_contract when calling optionContract' + ); + } + + + $resourcePath = '/v3/snapshot/options/{underlyingAsset}/{optionContract}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($underlying_asset !== null) { + $resourcePath = str_replace( + '{' . 'underlyingAsset' . '}', + ObjectSerializer::toPathValue($underlying_asset), + $resourcePath + ); + } + // path params + if ($option_contract !== null) { + $resourcePath = str_replace( + '{' . 'optionContract' . '}', + ObjectSerializer::toPathValue($option_contract), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation optionsChain + * + * Options Chain + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsChain'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\OptionsChain200Response + */ + public function optionsChain($underlying_asset, $strike_price = null, $expiration_date = null, $contract_type = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['optionsChain'][0]) + { + list($response) = $this->optionsChainWithHttpInfo($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation optionsChainWithHttpInfo + * + * Options Chain + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsChain'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\OptionsChain200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function optionsChainWithHttpInfo($underlying_asset, $strike_price = null, $expiration_date = null, $contract_type = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['optionsChain'][0]) + { + $request = $this->optionsChainRequest($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\OptionsChain200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptionsChain200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OptionsChain200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\OptionsChain200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\OptionsChain200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation optionsChainAsync + * + * Options Chain + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsChain'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsChainAsync($underlying_asset, $strike_price = null, $expiration_date = null, $contract_type = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['optionsChain'][0]) + { + return $this->optionsChainAsyncWithHttpInfo($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation optionsChainAsyncWithHttpInfo + * + * Options Chain + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsChain'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function optionsChainAsyncWithHttpInfo($underlying_asset, $strike_price = null, $expiration_date = null, $contract_type = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['optionsChain'][0]) + { + $returnType = '\OpenAPI\Client\Model\OptionsChain200Response'; + $request = $this->optionsChainRequest($underlying_asset, $strike_price, $expiration_date, $contract_type, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'optionsChain' + * + * @param string $underlying_asset The underlying ticker symbol of the option contract. (required) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['optionsChain'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function optionsChainRequest($underlying_asset, $strike_price = null, $expiration_date = null, $contract_type = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['optionsChain'][0]) + { + + // verify the required parameter 'underlying_asset' is set + if ($underlying_asset === null || (is_array($underlying_asset) && count($underlying_asset) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $underlying_asset when calling optionsChain' + ); + } + + + + + + + + + + + + + + if ($limit !== null && $limit > 250) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionssnapshotApi.optionsChain, must be smaller than or equal to 250.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionssnapshotApi.optionsChain, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/snapshot/options/{underlyingAsset}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price, + 'strike_price', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date, + 'expiration_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $contract_type, + 'contract_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_gte, + 'strike_price.gte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_gt, + 'strike_price.gt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_lte, + 'strike_price.lte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_lt, + 'strike_price.lt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_gte, + 'expiration_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_gt, + 'expiration_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_lte, + 'expiration_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_lt, + 'expiration_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($underlying_asset !== null) { + $resourcePath = str_replace( + '{' . 'underlyingAsset' . '}', + ObjectSerializer::toPathValue($underlying_asset), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OptionstradesApi.php b/lib/Api/OptionstradesApi.php new file mode 100644 index 0000000..34c6aa1 --- /dev/null +++ b/lib/Api/OptionstradesApi.php @@ -0,0 +1,581 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation tradesOptions + * + * Trades + * + * @param string $options_ticker The options ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\TradesOptions200Response + */ + public function tradesOptions($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesOptions'][0]) + { + list($response) = $this->tradesOptionsWithHttpInfo($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation tradesOptionsWithHttpInfo + * + * Trades + * + * @param string $options_ticker The options ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesOptions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\TradesOptions200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function tradesOptionsWithHttpInfo($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesOptions'][0]) + { + $request = $this->tradesOptionsRequest($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\TradesOptions200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\TradesOptions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\TradesOptions200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\TradesOptions200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\TradesOptions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation tradesOptionsAsync + * + * Trades + * + * @param string $options_ticker The options ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesOptionsAsync($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesOptions'][0]) + { + return $this->tradesOptionsAsyncWithHttpInfo($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tradesOptionsAsyncWithHttpInfo + * + * Trades + * + * @param string $options_ticker The options ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesOptionsAsyncWithHttpInfo($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesOptions'][0]) + { + $returnType = '\OpenAPI\Client\Model\TradesOptions200Response'; + $request = $this->tradesOptionsRequest($options_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'tradesOptions' + * + * @param string $options_ticker The options ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tradesOptions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tradesOptionsRequest($options_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['tradesOptions'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling tradesOptions' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionstradesApi.tradesOptions, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OptionstradesApi.tradesOptions, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/trades/{optionsTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'optionsTicker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/PublicApi.php b/lib/Api/PublicApi.php new file mode 100644 index 0000000..7280d72 --- /dev/null +++ b/lib/Api/PublicApi.php @@ -0,0 +1,606 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listTickerTaxonomyClassifications + * + * Ticker Taxonomies + * + * @param string $ticker ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response + */ + public function listTickerTaxonomyClassifications($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + list($response) = $this->listTickerTaxonomyClassificationsWithHttpInfo($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listTickerTaxonomyClassificationsWithHttpInfo + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listTickerTaxonomyClassificationsWithHttpInfo($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + $request = $this->listTickerTaxonomyClassificationsRequest($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listTickerTaxonomyClassificationsAsync + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTaxonomyClassificationsAsync($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + return $this->listTickerTaxonomyClassificationsAsyncWithHttpInfo($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listTickerTaxonomyClassificationsAsyncWithHttpInfo + * + * Ticker Taxonomies + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTaxonomyClassificationsAsyncWithHttpInfo($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200Response'; + $request = $this->listTickerTaxonomyClassificationsRequest($ticker, $category, $tag, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ticker_any_of, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listTickerTaxonomyClassifications' + * + * @param string $ticker (optional) + * @param string $category Filter by taxonomy category. (optional) + * @param string $tag Filter by taxonomy tag. Each category has a set of associated tags. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $ticker_any_of Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL are subject to your technology stack. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 250. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTaxonomyClassifications'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listTickerTaxonomyClassificationsRequest($ticker = null, $category = null, $tag = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ticker_any_of = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listTickerTaxonomyClassifications'][0]) + { + + + + + + + + + + + if ($limit !== null && $limit > 250) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listTickerTaxonomyClassifications, must be smaller than or equal to 250.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listTickerTaxonomyClassifications, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/vX/reference/tickers/taxonomies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category, + 'category', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tag, + 'tag', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_any_of, + 'ticker.any_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferenceconditionsApi.php b/lib/Api/ReferenceconditionsApi.php new file mode 100644 index 0000000..b48bc01 --- /dev/null +++ b/lib/Api/ReferenceconditionsApi.php @@ -0,0 +1,616 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listConditions + * + * Conditions + * + * @param string $asset_class Filter for conditions within a given asset class. (optional) + * @param string $data_type Filter by data type. (optional) + * @param int $id Filter for conditions with a given ID. (optional) + * @param string $sip Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'asset_class') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listConditions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListConditions200Response|\OpenAPI\Client\Model\ListConditions400Response|\OpenAPI\Client\Model\ListConditions400Response + */ + public function listConditions($asset_class = null, $data_type = null, $id = null, $sip = null, $order = null, $limit = 10, $sort = 'asset_class', string $contentType = self::contentTypes['listConditions'][0]) + { + list($response) = $this->listConditionsWithHttpInfo($asset_class, $data_type, $id, $sip, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listConditionsWithHttpInfo + * + * Conditions + * + * @param string $asset_class Filter for conditions within a given asset class. (optional) + * @param string $data_type Filter by data type. (optional) + * @param int $id Filter for conditions with a given ID. (optional) + * @param string $sip Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'asset_class') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listConditions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListConditions200Response|\OpenAPI\Client\Model\ListConditions400Response|\OpenAPI\Client\Model\ListConditions400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listConditionsWithHttpInfo($asset_class = null, $data_type = null, $id = null, $sip = null, $order = null, $limit = 10, $sort = 'asset_class', string $contentType = self::contentTypes['listConditions'][0]) + { + $request = $this->listConditionsRequest($asset_class, $data_type, $id, $sip, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListConditions200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListConditions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListConditions200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\OpenAPI\Client\Model\ListConditions400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListConditions400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListConditions400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ListConditions400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListConditions400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListConditions400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListConditions200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListConditions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListConditions400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListConditions400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listConditionsAsync + * + * Conditions + * + * @param string $asset_class Filter for conditions within a given asset class. (optional) + * @param string $data_type Filter by data type. (optional) + * @param int $id Filter for conditions with a given ID. (optional) + * @param string $sip Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'asset_class') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listConditions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listConditionsAsync($asset_class = null, $data_type = null, $id = null, $sip = null, $order = null, $limit = 10, $sort = 'asset_class', string $contentType = self::contentTypes['listConditions'][0]) + { + return $this->listConditionsAsyncWithHttpInfo($asset_class, $data_type, $id, $sip, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listConditionsAsyncWithHttpInfo + * + * Conditions + * + * @param string $asset_class Filter for conditions within a given asset class. (optional) + * @param string $data_type Filter by data type. (optional) + * @param int $id Filter for conditions with a given ID. (optional) + * @param string $sip Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'asset_class') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listConditions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listConditionsAsyncWithHttpInfo($asset_class = null, $data_type = null, $id = null, $sip = null, $order = null, $limit = 10, $sort = 'asset_class', string $contentType = self::contentTypes['listConditions'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListConditions200Response'; + $request = $this->listConditionsRequest($asset_class, $data_type, $id, $sip, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listConditions' + * + * @param string $asset_class Filter for conditions within a given asset class. (optional) + * @param string $data_type Filter by data type. (optional) + * @param int $id Filter for conditions with a given ID. (optional) + * @param string $sip Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'asset_class') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listConditions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listConditionsRequest($asset_class = null, $data_type = null, $id = null, $sip = null, $order = null, $limit = 10, $sort = 'asset_class', string $contentType = self::contentTypes['listConditions'][0]) + { + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferenceconditionsApi.listConditions, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferenceconditionsApi.listConditions, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/reference/conditions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $asset_class, + 'asset_class', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $data_type, + 'data_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sip, + 'sip', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencedividendsApi.php b/lib/Api/ReferencedividendsApi.php new file mode 100644 index 0000000..da34f85 --- /dev/null +++ b/lib/Api/ReferencedividendsApi.php @@ -0,0 +1,966 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listDividends + * + * Dividends v3 + * + * @param string $ticker Return the dividends that contain this ticker. (optional) + * @param \DateTime $ex_dividend_date Query by ex-dividend date with the format YYYY-MM-DD. (optional) + * @param \DateTime $record_date Query by record date with the format YYYY-MM-DD. (optional) + * @param \DateTime $declaration_date Query by declaration date with the format YYYY-MM-DD. (optional) + * @param \DateTime $pay_date Query by pay date with the format YYYY-MM-DD. (optional) + * @param int $frequency Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). (optional) + * @param float $cash_amount Query by the cash amount of the dividend. (optional) + * @param string $dividend_type Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param \DateTime $ex_dividend_date_gte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_gt Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lt Range by ex_dividend_date. (optional) + * @param \DateTime $record_date_gte Range by record_date. (optional) + * @param \DateTime $record_date_gt Range by record_date. (optional) + * @param \DateTime $record_date_lte Range by record_date. (optional) + * @param \DateTime $record_date_lt Range by record_date. (optional) + * @param \DateTime $declaration_date_gte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_gt Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lt Range by declaration_date. (optional) + * @param \DateTime $pay_date_gte Range by pay_date. (optional) + * @param \DateTime $pay_date_gt Range by pay_date. (optional) + * @param \DateTime $pay_date_lte Range by pay_date. (optional) + * @param \DateTime $pay_date_lt Range by pay_date. (optional) + * @param float $cash_amount_gte Range by cash_amount. (optional) + * @param float $cash_amount_gt Range by cash_amount. (optional) + * @param float $cash_amount_lte Range by cash_amount. (optional) + * @param float $cash_amount_lt Range by cash_amount. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ex_dividend_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDividends'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListDividends200Response + */ + public function listDividends($ticker = null, $ex_dividend_date = null, $record_date = null, $declaration_date = null, $pay_date = null, $frequency = null, $cash_amount = null, $dividend_type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ex_dividend_date_gte = null, $ex_dividend_date_gt = null, $ex_dividend_date_lte = null, $ex_dividend_date_lt = null, $record_date_gte = null, $record_date_gt = null, $record_date_lte = null, $record_date_lt = null, $declaration_date_gte = null, $declaration_date_gt = null, $declaration_date_lte = null, $declaration_date_lt = null, $pay_date_gte = null, $pay_date_gt = null, $pay_date_lte = null, $pay_date_lt = null, $cash_amount_gte = null, $cash_amount_gt = null, $cash_amount_lte = null, $cash_amount_lt = null, $order = null, $limit = 10, $sort = 'ex_dividend_date', string $contentType = self::contentTypes['listDividends'][0]) + { + list($response) = $this->listDividendsWithHttpInfo($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listDividendsWithHttpInfo + * + * Dividends v3 + * + * @param string $ticker Return the dividends that contain this ticker. (optional) + * @param \DateTime $ex_dividend_date Query by ex-dividend date with the format YYYY-MM-DD. (optional) + * @param \DateTime $record_date Query by record date with the format YYYY-MM-DD. (optional) + * @param \DateTime $declaration_date Query by declaration date with the format YYYY-MM-DD. (optional) + * @param \DateTime $pay_date Query by pay date with the format YYYY-MM-DD. (optional) + * @param int $frequency Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). (optional) + * @param float $cash_amount Query by the cash amount of the dividend. (optional) + * @param string $dividend_type Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param \DateTime $ex_dividend_date_gte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_gt Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lt Range by ex_dividend_date. (optional) + * @param \DateTime $record_date_gte Range by record_date. (optional) + * @param \DateTime $record_date_gt Range by record_date. (optional) + * @param \DateTime $record_date_lte Range by record_date. (optional) + * @param \DateTime $record_date_lt Range by record_date. (optional) + * @param \DateTime $declaration_date_gte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_gt Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lt Range by declaration_date. (optional) + * @param \DateTime $pay_date_gte Range by pay_date. (optional) + * @param \DateTime $pay_date_gt Range by pay_date. (optional) + * @param \DateTime $pay_date_lte Range by pay_date. (optional) + * @param \DateTime $pay_date_lt Range by pay_date. (optional) + * @param float $cash_amount_gte Range by cash_amount. (optional) + * @param float $cash_amount_gt Range by cash_amount. (optional) + * @param float $cash_amount_lte Range by cash_amount. (optional) + * @param float $cash_amount_lt Range by cash_amount. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ex_dividend_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDividends'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListDividends200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listDividendsWithHttpInfo($ticker = null, $ex_dividend_date = null, $record_date = null, $declaration_date = null, $pay_date = null, $frequency = null, $cash_amount = null, $dividend_type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ex_dividend_date_gte = null, $ex_dividend_date_gt = null, $ex_dividend_date_lte = null, $ex_dividend_date_lt = null, $record_date_gte = null, $record_date_gt = null, $record_date_lte = null, $record_date_lt = null, $declaration_date_gte = null, $declaration_date_gt = null, $declaration_date_lte = null, $declaration_date_lt = null, $pay_date_gte = null, $pay_date_gt = null, $pay_date_lte = null, $pay_date_lt = null, $cash_amount_gte = null, $cash_amount_gt = null, $cash_amount_lte = null, $cash_amount_lt = null, $order = null, $limit = 10, $sort = 'ex_dividend_date', string $contentType = self::contentTypes['listDividends'][0]) + { + $request = $this->listDividendsRequest($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListDividends200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListDividends200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListDividends200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListDividends200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListDividends200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listDividendsAsync + * + * Dividends v3 + * + * @param string $ticker Return the dividends that contain this ticker. (optional) + * @param \DateTime $ex_dividend_date Query by ex-dividend date with the format YYYY-MM-DD. (optional) + * @param \DateTime $record_date Query by record date with the format YYYY-MM-DD. (optional) + * @param \DateTime $declaration_date Query by declaration date with the format YYYY-MM-DD. (optional) + * @param \DateTime $pay_date Query by pay date with the format YYYY-MM-DD. (optional) + * @param int $frequency Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). (optional) + * @param float $cash_amount Query by the cash amount of the dividend. (optional) + * @param string $dividend_type Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param \DateTime $ex_dividend_date_gte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_gt Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lt Range by ex_dividend_date. (optional) + * @param \DateTime $record_date_gte Range by record_date. (optional) + * @param \DateTime $record_date_gt Range by record_date. (optional) + * @param \DateTime $record_date_lte Range by record_date. (optional) + * @param \DateTime $record_date_lt Range by record_date. (optional) + * @param \DateTime $declaration_date_gte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_gt Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lt Range by declaration_date. (optional) + * @param \DateTime $pay_date_gte Range by pay_date. (optional) + * @param \DateTime $pay_date_gt Range by pay_date. (optional) + * @param \DateTime $pay_date_lte Range by pay_date. (optional) + * @param \DateTime $pay_date_lt Range by pay_date. (optional) + * @param float $cash_amount_gte Range by cash_amount. (optional) + * @param float $cash_amount_gt Range by cash_amount. (optional) + * @param float $cash_amount_lte Range by cash_amount. (optional) + * @param float $cash_amount_lt Range by cash_amount. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ex_dividend_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDividends'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDividendsAsync($ticker = null, $ex_dividend_date = null, $record_date = null, $declaration_date = null, $pay_date = null, $frequency = null, $cash_amount = null, $dividend_type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ex_dividend_date_gte = null, $ex_dividend_date_gt = null, $ex_dividend_date_lte = null, $ex_dividend_date_lt = null, $record_date_gte = null, $record_date_gt = null, $record_date_lte = null, $record_date_lt = null, $declaration_date_gte = null, $declaration_date_gt = null, $declaration_date_lte = null, $declaration_date_lt = null, $pay_date_gte = null, $pay_date_gt = null, $pay_date_lte = null, $pay_date_lt = null, $cash_amount_gte = null, $cash_amount_gt = null, $cash_amount_lte = null, $cash_amount_lt = null, $order = null, $limit = 10, $sort = 'ex_dividend_date', string $contentType = self::contentTypes['listDividends'][0]) + { + return $this->listDividendsAsyncWithHttpInfo($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listDividendsAsyncWithHttpInfo + * + * Dividends v3 + * + * @param string $ticker Return the dividends that contain this ticker. (optional) + * @param \DateTime $ex_dividend_date Query by ex-dividend date with the format YYYY-MM-DD. (optional) + * @param \DateTime $record_date Query by record date with the format YYYY-MM-DD. (optional) + * @param \DateTime $declaration_date Query by declaration date with the format YYYY-MM-DD. (optional) + * @param \DateTime $pay_date Query by pay date with the format YYYY-MM-DD. (optional) + * @param int $frequency Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). (optional) + * @param float $cash_amount Query by the cash amount of the dividend. (optional) + * @param string $dividend_type Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param \DateTime $ex_dividend_date_gte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_gt Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lt Range by ex_dividend_date. (optional) + * @param \DateTime $record_date_gte Range by record_date. (optional) + * @param \DateTime $record_date_gt Range by record_date. (optional) + * @param \DateTime $record_date_lte Range by record_date. (optional) + * @param \DateTime $record_date_lt Range by record_date. (optional) + * @param \DateTime $declaration_date_gte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_gt Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lt Range by declaration_date. (optional) + * @param \DateTime $pay_date_gte Range by pay_date. (optional) + * @param \DateTime $pay_date_gt Range by pay_date. (optional) + * @param \DateTime $pay_date_lte Range by pay_date. (optional) + * @param \DateTime $pay_date_lt Range by pay_date. (optional) + * @param float $cash_amount_gte Range by cash_amount. (optional) + * @param float $cash_amount_gt Range by cash_amount. (optional) + * @param float $cash_amount_lte Range by cash_amount. (optional) + * @param float $cash_amount_lt Range by cash_amount. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ex_dividend_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDividends'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDividendsAsyncWithHttpInfo($ticker = null, $ex_dividend_date = null, $record_date = null, $declaration_date = null, $pay_date = null, $frequency = null, $cash_amount = null, $dividend_type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ex_dividend_date_gte = null, $ex_dividend_date_gt = null, $ex_dividend_date_lte = null, $ex_dividend_date_lt = null, $record_date_gte = null, $record_date_gt = null, $record_date_lte = null, $record_date_lt = null, $declaration_date_gte = null, $declaration_date_gt = null, $declaration_date_lte = null, $declaration_date_lt = null, $pay_date_gte = null, $pay_date_gt = null, $pay_date_lte = null, $pay_date_lt = null, $cash_amount_gte = null, $cash_amount_gt = null, $cash_amount_lte = null, $cash_amount_lt = null, $order = null, $limit = 10, $sort = 'ex_dividend_date', string $contentType = self::contentTypes['listDividends'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListDividends200Response'; + $request = $this->listDividendsRequest($ticker, $ex_dividend_date, $record_date, $declaration_date, $pay_date, $frequency, $cash_amount, $dividend_type, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $ex_dividend_date_gte, $ex_dividend_date_gt, $ex_dividend_date_lte, $ex_dividend_date_lt, $record_date_gte, $record_date_gt, $record_date_lte, $record_date_lt, $declaration_date_gte, $declaration_date_gt, $declaration_date_lte, $declaration_date_lt, $pay_date_gte, $pay_date_gt, $pay_date_lte, $pay_date_lt, $cash_amount_gte, $cash_amount_gt, $cash_amount_lte, $cash_amount_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listDividends' + * + * @param string $ticker Return the dividends that contain this ticker. (optional) + * @param \DateTime $ex_dividend_date Query by ex-dividend date with the format YYYY-MM-DD. (optional) + * @param \DateTime $record_date Query by record date with the format YYYY-MM-DD. (optional) + * @param \DateTime $declaration_date Query by declaration date with the format YYYY-MM-DD. (optional) + * @param \DateTime $pay_date Query by pay date with the format YYYY-MM-DD. (optional) + * @param int $frequency Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). (optional) + * @param float $cash_amount Query by the cash amount of the dividend. (optional) + * @param string $dividend_type Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param \DateTime $ex_dividend_date_gte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_gt Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lte Range by ex_dividend_date. (optional) + * @param \DateTime $ex_dividend_date_lt Range by ex_dividend_date. (optional) + * @param \DateTime $record_date_gte Range by record_date. (optional) + * @param \DateTime $record_date_gt Range by record_date. (optional) + * @param \DateTime $record_date_lte Range by record_date. (optional) + * @param \DateTime $record_date_lt Range by record_date. (optional) + * @param \DateTime $declaration_date_gte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_gt Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lte Range by declaration_date. (optional) + * @param \DateTime $declaration_date_lt Range by declaration_date. (optional) + * @param \DateTime $pay_date_gte Range by pay_date. (optional) + * @param \DateTime $pay_date_gt Range by pay_date. (optional) + * @param \DateTime $pay_date_lte Range by pay_date. (optional) + * @param \DateTime $pay_date_lt Range by pay_date. (optional) + * @param float $cash_amount_gte Range by cash_amount. (optional) + * @param float $cash_amount_gt Range by cash_amount. (optional) + * @param float $cash_amount_lte Range by cash_amount. (optional) + * @param float $cash_amount_lt Range by cash_amount. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ex_dividend_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDividends'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listDividendsRequest($ticker = null, $ex_dividend_date = null, $record_date = null, $declaration_date = null, $pay_date = null, $frequency = null, $cash_amount = null, $dividend_type = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $ex_dividend_date_gte = null, $ex_dividend_date_gt = null, $ex_dividend_date_lte = null, $ex_dividend_date_lt = null, $record_date_gte = null, $record_date_gt = null, $record_date_lte = null, $record_date_lt = null, $declaration_date_gte = null, $declaration_date_gt = null, $declaration_date_lte = null, $declaration_date_lt = null, $pay_date_gte = null, $pay_date_gt = null, $pay_date_lte = null, $pay_date_lt = null, $cash_amount_gte = null, $cash_amount_gt = null, $cash_amount_lte = null, $cash_amount_lt = null, $order = null, $limit = 10, $sort = 'ex_dividend_date', string $contentType = self::contentTypes['listDividends'][0]) + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencedividendsApi.listDividends, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencedividendsApi.listDividends, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/reference/dividends'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ex_dividend_date, + 'ex_dividend_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $record_date, + 'record_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $declaration_date, + 'declaration_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pay_date, + 'pay_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $frequency, + 'frequency', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cash_amount, + 'cash_amount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dividend_type, + 'dividend_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ex_dividend_date_gte, + 'ex_dividend_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ex_dividend_date_gt, + 'ex_dividend_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ex_dividend_date_lte, + 'ex_dividend_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ex_dividend_date_lt, + 'ex_dividend_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $record_date_gte, + 'record_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $record_date_gt, + 'record_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $record_date_lte, + 'record_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $record_date_lt, + 'record_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $declaration_date_gte, + 'declaration_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $declaration_date_gt, + 'declaration_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $declaration_date_lte, + 'declaration_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $declaration_date_lt, + 'declaration_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pay_date_gte, + 'pay_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pay_date_gt, + 'pay_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pay_date_lte, + 'pay_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pay_date_lt, + 'pay_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cash_amount_gte, + 'cash_amount.gte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cash_amount_gt, + 'cash_amount.gt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cash_amount_lte, + 'cash_amount.lte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cash_amount_lt, + 'cash_amount.lt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferenceexchangesApi.php b/lib/Api/ReferenceexchangesApi.php new file mode 100644 index 0000000..38e1dd7 --- /dev/null +++ b/lib/Api/ReferenceexchangesApi.php @@ -0,0 +1,535 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listExchanges + * + * Exchanges + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExchanges'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListExchanges200Response|\OpenAPI\Client\Model\ListExchanges400Response|\OpenAPI\Client\Model\ListExchanges400Response + */ + public function listExchanges($asset_class = null, $locale = null, string $contentType = self::contentTypes['listExchanges'][0]) + { + list($response) = $this->listExchangesWithHttpInfo($asset_class, $locale, $contentType); + return $response; + } + + /** + * Operation listExchangesWithHttpInfo + * + * Exchanges + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExchanges'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListExchanges200Response|\OpenAPI\Client\Model\ListExchanges400Response|\OpenAPI\Client\Model\ListExchanges400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listExchangesWithHttpInfo($asset_class = null, $locale = null, string $contentType = self::contentTypes['listExchanges'][0]) + { + $request = $this->listExchangesRequest($asset_class, $locale, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListExchanges200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListExchanges200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListExchanges200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\OpenAPI\Client\Model\ListExchanges400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListExchanges400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListExchanges400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ListExchanges400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListExchanges400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListExchanges400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListExchanges200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListExchanges200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListExchanges400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListExchanges400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listExchangesAsync + * + * Exchanges + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExchanges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listExchangesAsync($asset_class = null, $locale = null, string $contentType = self::contentTypes['listExchanges'][0]) + { + return $this->listExchangesAsyncWithHttpInfo($asset_class, $locale, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listExchangesAsyncWithHttpInfo + * + * Exchanges + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExchanges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listExchangesAsyncWithHttpInfo($asset_class = null, $locale = null, string $contentType = self::contentTypes['listExchanges'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListExchanges200Response'; + $request = $this->listExchangesRequest($asset_class, $locale, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listExchanges' + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExchanges'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listExchangesRequest($asset_class = null, $locale = null, string $contentType = self::contentTypes['listExchanges'][0]) + { + + + + + $resourcePath = '/v3/reference/exchanges'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $asset_class, + 'asset_class', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencenewsApi.php b/lib/Api/ReferencenewsApi.php new file mode 100644 index 0000000..65feb70 --- /dev/null +++ b/lib/Api/ReferencenewsApi.php @@ -0,0 +1,636 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listNews + * + * Ticker News + * + * @param string $ticker Return results that contain this ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc Return results published on, before, or after this date. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gt Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lt Search by published_utc. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'published_utc') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNews'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListNews200Response + */ + public function listNews($ticker = null, $published_utc = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $published_utc_gte = null, $published_utc_gt = null, $published_utc_lte = null, $published_utc_lt = null, $order = null, $limit = 10, $sort = 'published_utc', string $contentType = self::contentTypes['listNews'][0]) + { + list($response) = $this->listNewsWithHttpInfo($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listNewsWithHttpInfo + * + * Ticker News + * + * @param string $ticker Return results that contain this ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc Return results published on, before, or after this date. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gt Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lt Search by published_utc. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'published_utc') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNews'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListNews200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listNewsWithHttpInfo($ticker = null, $published_utc = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $published_utc_gte = null, $published_utc_gt = null, $published_utc_lte = null, $published_utc_lt = null, $order = null, $limit = 10, $sort = 'published_utc', string $contentType = self::contentTypes['listNews'][0]) + { + $request = $this->listNewsRequest($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListNews200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListNews200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListNews200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListNews200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListNews200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listNewsAsync + * + * Ticker News + * + * @param string $ticker Return results that contain this ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc Return results published on, before, or after this date. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gt Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lt Search by published_utc. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'published_utc') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNews'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listNewsAsync($ticker = null, $published_utc = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $published_utc_gte = null, $published_utc_gt = null, $published_utc_lte = null, $published_utc_lt = null, $order = null, $limit = 10, $sort = 'published_utc', string $contentType = self::contentTypes['listNews'][0]) + { + return $this->listNewsAsyncWithHttpInfo($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listNewsAsyncWithHttpInfo + * + * Ticker News + * + * @param string $ticker Return results that contain this ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc Return results published on, before, or after this date. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gt Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lt Search by published_utc. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'published_utc') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNews'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listNewsAsyncWithHttpInfo($ticker = null, $published_utc = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $published_utc_gte = null, $published_utc_gt = null, $published_utc_lte = null, $published_utc_lt = null, $order = null, $limit = 10, $sort = 'published_utc', string $contentType = self::contentTypes['listNews'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListNews200Response'; + $request = $this->listNewsRequest($ticker, $published_utc, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $published_utc_gte, $published_utc_gt, $published_utc_lte, $published_utc_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listNews' + * + * @param string $ticker Return results that contain this ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc Return results published on, before, or after this date. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_gt Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lte Search by published_utc. (optional) + * @param ListNewsPublishedUtcParameter $published_utc_lt Search by published_utc. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'published_utc') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNews'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listNewsRequest($ticker = null, $published_utc = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $published_utc_gte = null, $published_utc_gt = null, $published_utc_lte = null, $published_utc_lt = null, $order = null, $limit = 10, $sort = 'published_utc', string $contentType = self::contentTypes['listNews'][0]) + { + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencenewsApi.listNews, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencenewsApi.listNews, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/reference/news'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $published_utc, + 'published_utc', // param base name + 'OneOfDateTimeDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $published_utc_gte, + 'published_utc.gte', // param base name + 'OneOfDateTimeDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $published_utc_gt, + 'published_utc.gt', // param base name + 'OneOfDateTimeDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $published_utc_lte, + 'published_utc.lte', // param base name + 'OneOfDateTimeDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $published_utc_lt, + 'published_utc.lt', // param base name + 'OneOfDateTimeDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferenceoptionscontractApi.php b/lib/Api/ReferenceoptionscontractApi.php new file mode 100644 index 0000000..856dc68 --- /dev/null +++ b/lib/Api/ReferenceoptionscontractApi.php @@ -0,0 +1,470 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getOptionsContract + * + * Options Contract + * + * @param string $options_ticker Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). (required) + * @param string $as_of Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOptionsContract'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOptionsContract200Response + */ + public function getOptionsContract($options_ticker, $as_of = null, string $contentType = self::contentTypes['getOptionsContract'][0]) + { + list($response) = $this->getOptionsContractWithHttpInfo($options_ticker, $as_of, $contentType); + return $response; + } + + /** + * Operation getOptionsContractWithHttpInfo + * + * Options Contract + * + * @param string $options_ticker Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). (required) + * @param string $as_of Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOptionsContract'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOptionsContract200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getOptionsContractWithHttpInfo($options_ticker, $as_of = null, string $contentType = self::contentTypes['getOptionsContract'][0]) + { + $request = $this->getOptionsContractRequest($options_ticker, $as_of, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\GetOptionsContract200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\GetOptionsContract200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOptionsContract200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\GetOptionsContract200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOptionsContract200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOptionsContractAsync + * + * Options Contract + * + * @param string $options_ticker Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). (required) + * @param string $as_of Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOptionsContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsContractAsync($options_ticker, $as_of = null, string $contentType = self::contentTypes['getOptionsContract'][0]) + { + return $this->getOptionsContractAsyncWithHttpInfo($options_ticker, $as_of, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOptionsContractAsyncWithHttpInfo + * + * Options Contract + * + * @param string $options_ticker Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). (required) + * @param string $as_of Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOptionsContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOptionsContractAsyncWithHttpInfo($options_ticker, $as_of = null, string $contentType = self::contentTypes['getOptionsContract'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOptionsContract200Response'; + $request = $this->getOptionsContractRequest($options_ticker, $as_of, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getOptionsContract' + * + * @param string $options_ticker Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/). (required) + * @param string $as_of Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOptionsContract'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOptionsContractRequest($options_ticker, $as_of = null, string $contentType = self::contentTypes['getOptionsContract'][0]) + { + + // verify the required parameter 'options_ticker' is set + if ($options_ticker === null || (is_array($options_ticker) && count($options_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $options_ticker when calling getOptionsContract' + ); + } + + + + $resourcePath = '/v3/reference/options/contracts/{options_ticker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $as_of, + 'as_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($options_ticker !== null) { + $resourcePath = str_replace( + '{' . 'options_ticker' . '}', + ObjectSerializer::toPathValue($options_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferenceoptionscontractslistApi.php b/lib/Api/ReferenceoptionscontractslistApi.php new file mode 100644 index 0000000..9faf4dd --- /dev/null +++ b/lib/Api/ReferenceoptionscontractslistApi.php @@ -0,0 +1,771 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listOptionsContracts + * + * Options Contracts + * + * @param string $ticker This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). (optional) + * @param string $underlying_ticker Query for contracts relating to an underlying stock ticker. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $as_of Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param bool $expired Query for expired contracts. Default is false. (optional) + * @param string $underlying_ticker_gte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_gt Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lt Range by underlying_ticker. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOptionsContracts'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListOptionsContracts200Response + */ + public function listOptionsContracts($ticker = null, $underlying_ticker = null, $contract_type = null, $expiration_date = null, $as_of = null, $strike_price = null, $expired = null, $underlying_ticker_gte = null, $underlying_ticker_gt = null, $underlying_ticker_lte = null, $underlying_ticker_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listOptionsContracts'][0]) + { + list($response) = $this->listOptionsContractsWithHttpInfo($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listOptionsContractsWithHttpInfo + * + * Options Contracts + * + * @param string $ticker This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). (optional) + * @param string $underlying_ticker Query for contracts relating to an underlying stock ticker. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $as_of Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param bool $expired Query for expired contracts. Default is false. (optional) + * @param string $underlying_ticker_gte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_gt Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lt Range by underlying_ticker. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOptionsContracts'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListOptionsContracts200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listOptionsContractsWithHttpInfo($ticker = null, $underlying_ticker = null, $contract_type = null, $expiration_date = null, $as_of = null, $strike_price = null, $expired = null, $underlying_ticker_gte = null, $underlying_ticker_gt = null, $underlying_ticker_lte = null, $underlying_ticker_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listOptionsContracts'][0]) + { + $request = $this->listOptionsContractsRequest($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListOptionsContracts200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListOptionsContracts200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListOptionsContracts200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListOptionsContracts200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListOptionsContracts200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listOptionsContractsAsync + * + * Options Contracts + * + * @param string $ticker This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). (optional) + * @param string $underlying_ticker Query for contracts relating to an underlying stock ticker. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $as_of Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param bool $expired Query for expired contracts. Default is false. (optional) + * @param string $underlying_ticker_gte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_gt Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lt Range by underlying_ticker. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOptionsContracts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsContractsAsync($ticker = null, $underlying_ticker = null, $contract_type = null, $expiration_date = null, $as_of = null, $strike_price = null, $expired = null, $underlying_ticker_gte = null, $underlying_ticker_gt = null, $underlying_ticker_lte = null, $underlying_ticker_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listOptionsContracts'][0]) + { + return $this->listOptionsContractsAsyncWithHttpInfo($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOptionsContractsAsyncWithHttpInfo + * + * Options Contracts + * + * @param string $ticker This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). (optional) + * @param string $underlying_ticker Query for contracts relating to an underlying stock ticker. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $as_of Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param bool $expired Query for expired contracts. Default is false. (optional) + * @param string $underlying_ticker_gte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_gt Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lt Range by underlying_ticker. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOptionsContracts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOptionsContractsAsyncWithHttpInfo($ticker = null, $underlying_ticker = null, $contract_type = null, $expiration_date = null, $as_of = null, $strike_price = null, $expired = null, $underlying_ticker_gte = null, $underlying_ticker_gt = null, $underlying_ticker_lte = null, $underlying_ticker_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listOptionsContracts'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListOptionsContracts200Response'; + $request = $this->listOptionsContractsRequest($ticker, $underlying_ticker, $contract_type, $expiration_date, $as_of, $strike_price, $expired, $underlying_ticker_gte, $underlying_ticker_gt, $underlying_ticker_lte, $underlying_ticker_lt, $expiration_date_gte, $expiration_date_gt, $expiration_date_lte, $expiration_date_lt, $strike_price_gte, $strike_price_gt, $strike_price_lte, $strike_price_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listOptionsContracts' + * + * @param string $ticker This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker). (optional) + * @param string $underlying_ticker Query for contracts relating to an underlying stock ticker. (optional) + * @param string $contract_type Query by the type of contract. (optional) + * @param string $expiration_date Query by contract expiration with date format YYYY-MM-DD. (optional) + * @param string $as_of Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date. (optional) + * @param float $strike_price Query by strike price of a contract. (optional) + * @param bool $expired Query for expired contracts. Default is false. (optional) + * @param string $underlying_ticker_gte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_gt Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lte Range by underlying_ticker. (optional) + * @param string $underlying_ticker_lt Range by underlying_ticker. (optional) + * @param string $expiration_date_gte Range by expiration_date. (optional) + * @param string $expiration_date_gt Range by expiration_date. (optional) + * @param string $expiration_date_lte Range by expiration_date. (optional) + * @param string $expiration_date_lt Range by expiration_date. (optional) + * @param float $strike_price_gte Range by strike_price. (optional) + * @param float $strike_price_gt Range by strike_price. (optional) + * @param float $strike_price_lte Range by strike_price. (optional) + * @param float $strike_price_lt Range by strike_price. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOptionsContracts'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listOptionsContractsRequest($ticker = null, $underlying_ticker = null, $contract_type = null, $expiration_date = null, $as_of = null, $strike_price = null, $expired = null, $underlying_ticker_gte = null, $underlying_ticker_gt = null, $underlying_ticker_lte = null, $underlying_ticker_lt = null, $expiration_date_gte = null, $expiration_date_gt = null, $expiration_date_lte = null, $expiration_date_lt = null, $strike_price_gte = null, $strike_price_gt = null, $strike_price_lte = null, $strike_price_lt = null, $order = null, $limit = 10, $sort = 'ticker', string $contentType = self::contentTypes['listOptionsContracts'][0]) + { + + + + + + + + + + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferenceoptionscontractslistApi.listOptionsContracts, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferenceoptionscontractslistApi.listOptionsContracts, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/reference/options/contracts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $underlying_ticker, + 'underlying_ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $contract_type, + 'contract_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date, + 'expiration_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $as_of, + 'as_of', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price, + 'strike_price', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expired, + 'expired', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $underlying_ticker_gte, + 'underlying_ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $underlying_ticker_gt, + 'underlying_ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $underlying_ticker_lte, + 'underlying_ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $underlying_ticker_lt, + 'underlying_ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_gte, + 'expiration_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_gt, + 'expiration_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_lte, + 'expiration_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expiration_date_lt, + 'expiration_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_gte, + 'strike_price.gte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_gt, + 'strike_price.gt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_lte, + 'strike_price.lte', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $strike_price_lt, + 'strike_price.lt', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencesecfilingApi.php b/lib/Api/ReferencesecfilingApi.php new file mode 100644 index 0000000..b59ef07 --- /dev/null +++ b/lib/Api/ReferencesecfilingApi.php @@ -0,0 +1,449 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getFiling + * + * SEC Filing + * + * @param string $filing_id Select by filing id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFiling'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListFilings200ResponseResultsInner + */ + public function getFiling($filing_id = null, string $contentType = self::contentTypes['getFiling'][0]) + { + list($response) = $this->getFilingWithHttpInfo($filing_id, $contentType); + return $response; + } + + /** + * Operation getFilingWithHttpInfo + * + * SEC Filing + * + * @param string $filing_id Select by filing id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFiling'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListFilings200ResponseResultsInner, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilingWithHttpInfo($filing_id = null, string $contentType = self::contentTypes['getFiling'][0]) + { + $request = $this->getFilingRequest($filing_id, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListFilings200ResponseResultsInner' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListFilings200ResponseResultsInner' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListFilings200ResponseResultsInner', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListFilings200ResponseResultsInner'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListFilings200ResponseResultsInner', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFilingAsync + * + * SEC Filing + * + * @param string $filing_id Select by filing id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFiling'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilingAsync($filing_id = null, string $contentType = self::contentTypes['getFiling'][0]) + { + return $this->getFilingAsyncWithHttpInfo($filing_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilingAsyncWithHttpInfo + * + * SEC Filing + * + * @param string $filing_id Select by filing id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFiling'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilingAsyncWithHttpInfo($filing_id = null, string $contentType = self::contentTypes['getFiling'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListFilings200ResponseResultsInner'; + $request = $this->getFilingRequest($filing_id, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getFiling' + * + * @param string $filing_id Select by filing id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFiling'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFilingRequest($filing_id = null, string $contentType = self::contentTypes['getFiling'][0]) + { + + + + $resourcePath = '/v1/reference/sec/filings/{filing_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($filing_id !== null) { + $resourcePath = str_replace( + '{' . 'filing_id' . '}', + ObjectSerializer::toPathValue($filing_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencesecfilingfileApi.php b/lib/Api/ReferencesecfilingfileApi.php new file mode 100644 index 0000000..3e0688f --- /dev/null +++ b/lib/Api/ReferencesecfilingfileApi.php @@ -0,0 +1,463 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getFilingFile + * + * SEC Filing File + * + * @param string $filing_id Select by filing id. (optional) + * @param string $file_id Select by file id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilingFile'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner + */ + public function getFilingFile($filing_id = null, $file_id = null, string $contentType = self::contentTypes['getFilingFile'][0]) + { + list($response) = $this->getFilingFileWithHttpInfo($filing_id, $file_id, $contentType); + return $response; + } + + /** + * Operation getFilingFileWithHttpInfo + * + * SEC Filing File + * + * @param string $filing_id Select by filing id. (optional) + * @param string $file_id Select by file id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilingFile'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilingFileWithHttpInfo($filing_id = null, $file_id = null, string $contentType = self::contentTypes['getFilingFile'][0]) + { + $request = $this->getFilingFileRequest($filing_id, $file_id, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFilingFileAsync + * + * SEC Filing File + * + * @param string $filing_id Select by filing id. (optional) + * @param string $file_id Select by file id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilingFile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilingFileAsync($filing_id = null, $file_id = null, string $contentType = self::contentTypes['getFilingFile'][0]) + { + return $this->getFilingFileAsyncWithHttpInfo($filing_id, $file_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilingFileAsyncWithHttpInfo + * + * SEC Filing File + * + * @param string $filing_id Select by filing id. (optional) + * @param string $file_id Select by file id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilingFile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilingFileAsyncWithHttpInfo($filing_id = null, $file_id = null, string $contentType = self::contentTypes['getFilingFile'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner'; + $request = $this->getFilingFileRequest($filing_id, $file_id, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getFilingFile' + * + * @param string $filing_id Select by filing id. (optional) + * @param string $file_id Select by file id. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilingFile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFilingFileRequest($filing_id = null, $file_id = null, string $contentType = self::contentTypes['getFilingFile'][0]) + { + + + + + $resourcePath = '/v1/reference/sec/filings/{filing_id}/files/{file_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($filing_id !== null) { + $resourcePath = str_replace( + '{' . 'filing_id' . '}', + ObjectSerializer::toPathValue($filing_id), + $resourcePath + ); + } + // path params + if ($file_id !== null) { + $resourcePath = str_replace( + '{' . 'file_id' . '}', + ObjectSerializer::toPathValue($file_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencesecfilingfilesApi.php b/lib/Api/ReferencesecfilingfilesApi.php new file mode 100644 index 0000000..7671b9b --- /dev/null +++ b/lib/Api/ReferencesecfilingfilesApi.php @@ -0,0 +1,650 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listFilingFiles + * + * SEC Filing Files + * + * @param string $filing_id Select by filing id. (optional) + * @param int $sequence Query by file sequence number. (optional) + * @param string $filename Query by file name. (optional) + * @param int $sequence_gte Search by sequence. (optional) + * @param int $sequence_gt Search by sequence. (optional) + * @param int $sequence_lte Search by sequence. (optional) + * @param int $sequence_lt Search by sequence. (optional) + * @param string $filename_gte Search by filename. (optional) + * @param string $filename_gt Search by filename. (optional) + * @param string $filename_lte Search by filename. (optional) + * @param string $filename_lt Search by filename. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'sequence') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilingFiles'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListFilingFiles200Response + */ + public function listFilingFiles($filing_id = null, $sequence = null, $filename = null, $sequence_gte = null, $sequence_gt = null, $sequence_lte = null, $sequence_lt = null, $filename_gte = null, $filename_gt = null, $filename_lte = null, $filename_lt = null, $order = null, $limit = 10, $sort = 'sequence', string $contentType = self::contentTypes['listFilingFiles'][0]) + { + list($response) = $this->listFilingFilesWithHttpInfo($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listFilingFilesWithHttpInfo + * + * SEC Filing Files + * + * @param string $filing_id Select by filing id. (optional) + * @param int $sequence Query by file sequence number. (optional) + * @param string $filename Query by file name. (optional) + * @param int $sequence_gte Search by sequence. (optional) + * @param int $sequence_gt Search by sequence. (optional) + * @param int $sequence_lte Search by sequence. (optional) + * @param int $sequence_lt Search by sequence. (optional) + * @param string $filename_gte Search by filename. (optional) + * @param string $filename_gt Search by filename. (optional) + * @param string $filename_lte Search by filename. (optional) + * @param string $filename_lt Search by filename. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'sequence') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilingFiles'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListFilingFiles200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listFilingFilesWithHttpInfo($filing_id = null, $sequence = null, $filename = null, $sequence_gte = null, $sequence_gt = null, $sequence_lte = null, $sequence_lt = null, $filename_gte = null, $filename_gt = null, $filename_lte = null, $filename_lt = null, $order = null, $limit = 10, $sort = 'sequence', string $contentType = self::contentTypes['listFilingFiles'][0]) + { + $request = $this->listFilingFilesRequest($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListFilingFiles200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListFilingFiles200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListFilingFiles200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListFilingFiles200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListFilingFiles200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listFilingFilesAsync + * + * SEC Filing Files + * + * @param string $filing_id Select by filing id. (optional) + * @param int $sequence Query by file sequence number. (optional) + * @param string $filename Query by file name. (optional) + * @param int $sequence_gte Search by sequence. (optional) + * @param int $sequence_gt Search by sequence. (optional) + * @param int $sequence_lte Search by sequence. (optional) + * @param int $sequence_lt Search by sequence. (optional) + * @param string $filename_gte Search by filename. (optional) + * @param string $filename_gt Search by filename. (optional) + * @param string $filename_lte Search by filename. (optional) + * @param string $filename_lt Search by filename. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'sequence') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilingFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilingFilesAsync($filing_id = null, $sequence = null, $filename = null, $sequence_gte = null, $sequence_gt = null, $sequence_lte = null, $sequence_lt = null, $filename_gte = null, $filename_gt = null, $filename_lte = null, $filename_lt = null, $order = null, $limit = 10, $sort = 'sequence', string $contentType = self::contentTypes['listFilingFiles'][0]) + { + return $this->listFilingFilesAsyncWithHttpInfo($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFilingFilesAsyncWithHttpInfo + * + * SEC Filing Files + * + * @param string $filing_id Select by filing id. (optional) + * @param int $sequence Query by file sequence number. (optional) + * @param string $filename Query by file name. (optional) + * @param int $sequence_gte Search by sequence. (optional) + * @param int $sequence_gt Search by sequence. (optional) + * @param int $sequence_lte Search by sequence. (optional) + * @param int $sequence_lt Search by sequence. (optional) + * @param string $filename_gte Search by filename. (optional) + * @param string $filename_gt Search by filename. (optional) + * @param string $filename_lte Search by filename. (optional) + * @param string $filename_lt Search by filename. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'sequence') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilingFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilingFilesAsyncWithHttpInfo($filing_id = null, $sequence = null, $filename = null, $sequence_gte = null, $sequence_gt = null, $sequence_lte = null, $sequence_lt = null, $filename_gte = null, $filename_gt = null, $filename_lte = null, $filename_lt = null, $order = null, $limit = 10, $sort = 'sequence', string $contentType = self::contentTypes['listFilingFiles'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListFilingFiles200Response'; + $request = $this->listFilingFilesRequest($filing_id, $sequence, $filename, $sequence_gte, $sequence_gt, $sequence_lte, $sequence_lt, $filename_gte, $filename_gt, $filename_lte, $filename_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listFilingFiles' + * + * @param string $filing_id Select by filing id. (optional) + * @param int $sequence Query by file sequence number. (optional) + * @param string $filename Query by file name. (optional) + * @param int $sequence_gte Search by sequence. (optional) + * @param int $sequence_gt Search by sequence. (optional) + * @param int $sequence_lte Search by sequence. (optional) + * @param int $sequence_lt Search by sequence. (optional) + * @param string $filename_gte Search by filename. (optional) + * @param string $filename_gt Search by filename. (optional) + * @param string $filename_lte Search by filename. (optional) + * @param string $filename_lt Search by filename. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'sequence') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilingFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listFilingFilesRequest($filing_id = null, $sequence = null, $filename = null, $sequence_gte = null, $sequence_gt = null, $sequence_lte = null, $sequence_lt = null, $filename_gte = null, $filename_gt = null, $filename_lte = null, $filename_lt = null, $order = null, $limit = 10, $sort = 'sequence', string $contentType = self::contentTypes['listFilingFiles'][0]) + { + + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencesecfilingfilesApi.listFilingFiles, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencesecfilingfilesApi.listFilingFiles, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v1/reference/sec/filings/{filing_id}/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sequence, + 'sequence', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filename, + 'filename', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sequence_gte, + 'sequence.gte', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sequence_gt, + 'sequence.gt', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sequence_lte, + 'sequence.lte', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sequence_lt, + 'sequence.lt', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filename_gte, + 'filename.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filename_gt, + 'filename.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filename_lte, + 'filename.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filename_lt, + 'filename.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($filing_id !== null) { + $resourcePath = str_replace( + '{' . 'filing_id' . '}', + ObjectSerializer::toPathValue($filing_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencesecfilingsApi.php b/lib/Api/ReferencesecfilingsApi.php new file mode 100644 index 0000000..a3c35a8 --- /dev/null +++ b/lib/Api/ReferencesecfilingsApi.php @@ -0,0 +1,771 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listFilings + * + * SEC Filings + * + * @param string $type Query by filing type. (optional) + * @param string $filing_date Query by filing date. (optional) + * @param string $period_of_report_date Query by period of report. (optional) + * @param bool $has_xbrl If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. (optional) + * @param string $entities_company_data_name Query by entity company name. (optional) + * @param string $entities_company_data_cik Query by entity company CIK. (optional) + * @param string $entities_company_data_ticker Query by entity company ticker. (optional) + * @param string $entities_company_data_sic Query by entity company SIC. (optional) + * @param string $filing_date_gte Search by filing_date. (optional) + * @param string $filing_date_gt Search by filing_date. (optional) + * @param string $filing_date_lte Search by filing_date. (optional) + * @param string $filing_date_lt Search by filing_date. (optional) + * @param string $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $entities_company_data_name_search Search by entities.company_data.name. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'filing_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListFilings200Response + */ + public function listFilings($type = null, $filing_date = null, $period_of_report_date = null, $has_xbrl = null, $entities_company_data_name = null, $entities_company_data_cik = null, $entities_company_data_ticker = null, $entities_company_data_sic = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $entities_company_data_name_search = null, $order = null, $limit = 10, $sort = 'filing_date', string $contentType = self::contentTypes['listFilings'][0]) + { + list($response) = $this->listFilingsWithHttpInfo($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listFilingsWithHttpInfo + * + * SEC Filings + * + * @param string $type Query by filing type. (optional) + * @param string $filing_date Query by filing date. (optional) + * @param string $period_of_report_date Query by period of report. (optional) + * @param bool $has_xbrl If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. (optional) + * @param string $entities_company_data_name Query by entity company name. (optional) + * @param string $entities_company_data_cik Query by entity company CIK. (optional) + * @param string $entities_company_data_ticker Query by entity company ticker. (optional) + * @param string $entities_company_data_sic Query by entity company SIC. (optional) + * @param string $filing_date_gte Search by filing_date. (optional) + * @param string $filing_date_gt Search by filing_date. (optional) + * @param string $filing_date_lte Search by filing_date. (optional) + * @param string $filing_date_lt Search by filing_date. (optional) + * @param string $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $entities_company_data_name_search Search by entities.company_data.name. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'filing_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListFilings200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listFilingsWithHttpInfo($type = null, $filing_date = null, $period_of_report_date = null, $has_xbrl = null, $entities_company_data_name = null, $entities_company_data_cik = null, $entities_company_data_ticker = null, $entities_company_data_sic = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $entities_company_data_name_search = null, $order = null, $limit = 10, $sort = 'filing_date', string $contentType = self::contentTypes['listFilings'][0]) + { + $request = $this->listFilingsRequest($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListFilings200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListFilings200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListFilings200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListFilings200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListFilings200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listFilingsAsync + * + * SEC Filings + * + * @param string $type Query by filing type. (optional) + * @param string $filing_date Query by filing date. (optional) + * @param string $period_of_report_date Query by period of report. (optional) + * @param bool $has_xbrl If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. (optional) + * @param string $entities_company_data_name Query by entity company name. (optional) + * @param string $entities_company_data_cik Query by entity company CIK. (optional) + * @param string $entities_company_data_ticker Query by entity company ticker. (optional) + * @param string $entities_company_data_sic Query by entity company SIC. (optional) + * @param string $filing_date_gte Search by filing_date. (optional) + * @param string $filing_date_gt Search by filing_date. (optional) + * @param string $filing_date_lte Search by filing_date. (optional) + * @param string $filing_date_lt Search by filing_date. (optional) + * @param string $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $entities_company_data_name_search Search by entities.company_data.name. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'filing_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilingsAsync($type = null, $filing_date = null, $period_of_report_date = null, $has_xbrl = null, $entities_company_data_name = null, $entities_company_data_cik = null, $entities_company_data_ticker = null, $entities_company_data_sic = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $entities_company_data_name_search = null, $order = null, $limit = 10, $sort = 'filing_date', string $contentType = self::contentTypes['listFilings'][0]) + { + return $this->listFilingsAsyncWithHttpInfo($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFilingsAsyncWithHttpInfo + * + * SEC Filings + * + * @param string $type Query by filing type. (optional) + * @param string $filing_date Query by filing date. (optional) + * @param string $period_of_report_date Query by period of report. (optional) + * @param bool $has_xbrl If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. (optional) + * @param string $entities_company_data_name Query by entity company name. (optional) + * @param string $entities_company_data_cik Query by entity company CIK. (optional) + * @param string $entities_company_data_ticker Query by entity company ticker. (optional) + * @param string $entities_company_data_sic Query by entity company SIC. (optional) + * @param string $filing_date_gte Search by filing_date. (optional) + * @param string $filing_date_gt Search by filing_date. (optional) + * @param string $filing_date_lte Search by filing_date. (optional) + * @param string $filing_date_lt Search by filing_date. (optional) + * @param string $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $entities_company_data_name_search Search by entities.company_data.name. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'filing_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilingsAsyncWithHttpInfo($type = null, $filing_date = null, $period_of_report_date = null, $has_xbrl = null, $entities_company_data_name = null, $entities_company_data_cik = null, $entities_company_data_ticker = null, $entities_company_data_sic = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $entities_company_data_name_search = null, $order = null, $limit = 10, $sort = 'filing_date', string $contentType = self::contentTypes['listFilings'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListFilings200Response'; + $request = $this->listFilingsRequest($type, $filing_date, $period_of_report_date, $has_xbrl, $entities_company_data_name, $entities_company_data_cik, $entities_company_data_ticker, $entities_company_data_sic, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $entities_company_data_name_search, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listFilings' + * + * @param string $type Query by filing type. (optional) + * @param string $filing_date Query by filing date. (optional) + * @param string $period_of_report_date Query by period of report. (optional) + * @param bool $has_xbrl If true, query only for filings with an XBRL instance file. If false, query for filings without an XBRL instance file. If this parameter is not provided, query for filings with or without XBRL instance files. (optional) + * @param string $entities_company_data_name Query by entity company name. (optional) + * @param string $entities_company_data_cik Query by entity company CIK. (optional) + * @param string $entities_company_data_ticker Query by entity company ticker. (optional) + * @param string $entities_company_data_sic Query by entity company SIC. (optional) + * @param string $filing_date_gte Search by filing_date. (optional) + * @param string $filing_date_gt Search by filing_date. (optional) + * @param string $filing_date_lte Search by filing_date. (optional) + * @param string $filing_date_lt Search by filing_date. (optional) + * @param string $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param string $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $entities_company_data_name_search Search by entities.company_data.name. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'filing_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listFilingsRequest($type = null, $filing_date = null, $period_of_report_date = null, $has_xbrl = null, $entities_company_data_name = null, $entities_company_data_cik = null, $entities_company_data_ticker = null, $entities_company_data_sic = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $entities_company_data_name_search = null, $order = null, $limit = 10, $sort = 'filing_date', string $contentType = self::contentTypes['listFilings'][0]) + { + + + if ($filing_date !== null && !preg_match("/^[0-9]{8}$/", $filing_date)) { + throw new \InvalidArgumentException("invalid value for \"filing_date\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($period_of_report_date !== null && !preg_match("/^[0-9]{8}$/", $period_of_report_date)) { + throw new \InvalidArgumentException("invalid value for \"period_of_report_date\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + + + + + + if ($filing_date_gte !== null && !preg_match("/^[0-9]{8}$/", $filing_date_gte)) { + throw new \InvalidArgumentException("invalid value for \"filing_date_gte\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($filing_date_gt !== null && !preg_match("/^[0-9]{8}$/", $filing_date_gt)) { + throw new \InvalidArgumentException("invalid value for \"filing_date_gt\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($filing_date_lte !== null && !preg_match("/^[0-9]{8}$/", $filing_date_lte)) { + throw new \InvalidArgumentException("invalid value for \"filing_date_lte\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($filing_date_lt !== null && !preg_match("/^[0-9]{8}$/", $filing_date_lt)) { + throw new \InvalidArgumentException("invalid value for \"filing_date_lt\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($period_of_report_date_gte !== null && !preg_match("/^[0-9]{8}$/", $period_of_report_date_gte)) { + throw new \InvalidArgumentException("invalid value for \"period_of_report_date_gte\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($period_of_report_date_gt !== null && !preg_match("/^[0-9]{8}$/", $period_of_report_date_gt)) { + throw new \InvalidArgumentException("invalid value for \"period_of_report_date_gt\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($period_of_report_date_lte !== null && !preg_match("/^[0-9]{8}$/", $period_of_report_date_lte)) { + throw new \InvalidArgumentException("invalid value for \"period_of_report_date_lte\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + if ($period_of_report_date_lt !== null && !preg_match("/^[0-9]{8}$/", $period_of_report_date_lt)) { + throw new \InvalidArgumentException("invalid value for \"period_of_report_date_lt\" when calling ReferencesecfilingsApi.listFilings, must conform to the pattern /^[0-9]{8}$/."); + } + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencesecfilingsApi.listFilings, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencesecfilingsApi.listFilings, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v1/reference/sec/filings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date, + 'filing_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date, + 'period_of_report_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_xbrl, + 'has_xbrl', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entities_company_data_name, + 'entities.company_data.name', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entities_company_data_cik, + 'entities.company_data.cik', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entities_company_data_ticker, + 'entities.company_data.ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entities_company_data_sic, + 'entities.company_data.sic', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_gte, + 'filing_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_gt, + 'filing_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_lte, + 'filing_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_lt, + 'filing_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_gte, + 'period_of_report_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_gt, + 'period_of_report_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_lte, + 'period_of_report_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_lt, + 'period_of_report_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entities_company_data_name_search, + 'entities.company_data.name.search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencestocksApi.php b/lib/Api/ReferencestocksApi.php new file mode 100644 index 0000000..f5defc4 --- /dev/null +++ b/lib/Api/ReferencestocksApi.php @@ -0,0 +1,1252 @@ + [ + 'application/json', + ], + 'listStockSplits' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listFinancials + * + * Stock Financials vX + * + * @param string $ticker Query by company ticker. (optional) + * @param string $cik Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number (optional) + * @param string $company_name Query by company name. (optional) + * @param string $sic Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) (optional) + * @param \DateTime $filing_date Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 (optional) + * @param \DateTime $period_of_report_date The period of report for the filing with financials data in YYYY-MM-DD format. (optional) + * @param string $timeframe Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 (optional) + * @param bool $include_sources Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. (optional, default to false) + * @param string $company_name_search Search by company_name. (optional) + * @param \DateTime $filing_date_gte Search by filing_date. (optional) + * @param \DateTime $filing_date_gt Search by filing_date. (optional) + * @param \DateTime $filing_date_lte Search by filing_date. (optional) + * @param \DateTime $filing_date_lt Search by filing_date. (optional) + * @param \DateTime $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 100. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'period_of_report_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFinancials'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListFinancials200Response + */ + public function listFinancials($ticker = null, $cik = null, $company_name = null, $sic = null, $filing_date = null, $period_of_report_date = null, $timeframe = null, $include_sources = false, $company_name_search = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $order = null, $limit = 10, $sort = 'period_of_report_date', string $contentType = self::contentTypes['listFinancials'][0]) + { + list($response) = $this->listFinancialsWithHttpInfo($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listFinancialsWithHttpInfo + * + * Stock Financials vX + * + * @param string $ticker Query by company ticker. (optional) + * @param string $cik Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number (optional) + * @param string $company_name Query by company name. (optional) + * @param string $sic Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) (optional) + * @param \DateTime $filing_date Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 (optional) + * @param \DateTime $period_of_report_date The period of report for the filing with financials data in YYYY-MM-DD format. (optional) + * @param string $timeframe Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 (optional) + * @param bool $include_sources Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. (optional, default to false) + * @param string $company_name_search Search by company_name. (optional) + * @param \DateTime $filing_date_gte Search by filing_date. (optional) + * @param \DateTime $filing_date_gt Search by filing_date. (optional) + * @param \DateTime $filing_date_lte Search by filing_date. (optional) + * @param \DateTime $filing_date_lt Search by filing_date. (optional) + * @param \DateTime $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 100. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'period_of_report_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFinancials'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListFinancials200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listFinancialsWithHttpInfo($ticker = null, $cik = null, $company_name = null, $sic = null, $filing_date = null, $period_of_report_date = null, $timeframe = null, $include_sources = false, $company_name_search = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $order = null, $limit = 10, $sort = 'period_of_report_date', string $contentType = self::contentTypes['listFinancials'][0]) + { + $request = $this->listFinancialsRequest($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListFinancials200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListFinancials200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListFinancials200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListFinancials200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListFinancials200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listFinancialsAsync + * + * Stock Financials vX + * + * @param string $ticker Query by company ticker. (optional) + * @param string $cik Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number (optional) + * @param string $company_name Query by company name. (optional) + * @param string $sic Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) (optional) + * @param \DateTime $filing_date Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 (optional) + * @param \DateTime $period_of_report_date The period of report for the filing with financials data in YYYY-MM-DD format. (optional) + * @param string $timeframe Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 (optional) + * @param bool $include_sources Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. (optional, default to false) + * @param string $company_name_search Search by company_name. (optional) + * @param \DateTime $filing_date_gte Search by filing_date. (optional) + * @param \DateTime $filing_date_gt Search by filing_date. (optional) + * @param \DateTime $filing_date_lte Search by filing_date. (optional) + * @param \DateTime $filing_date_lt Search by filing_date. (optional) + * @param \DateTime $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 100. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'period_of_report_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFinancials'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFinancialsAsync($ticker = null, $cik = null, $company_name = null, $sic = null, $filing_date = null, $period_of_report_date = null, $timeframe = null, $include_sources = false, $company_name_search = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $order = null, $limit = 10, $sort = 'period_of_report_date', string $contentType = self::contentTypes['listFinancials'][0]) + { + return $this->listFinancialsAsyncWithHttpInfo($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFinancialsAsyncWithHttpInfo + * + * Stock Financials vX + * + * @param string $ticker Query by company ticker. (optional) + * @param string $cik Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number (optional) + * @param string $company_name Query by company name. (optional) + * @param string $sic Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) (optional) + * @param \DateTime $filing_date Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 (optional) + * @param \DateTime $period_of_report_date The period of report for the filing with financials data in YYYY-MM-DD format. (optional) + * @param string $timeframe Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 (optional) + * @param bool $include_sources Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. (optional, default to false) + * @param string $company_name_search Search by company_name. (optional) + * @param \DateTime $filing_date_gte Search by filing_date. (optional) + * @param \DateTime $filing_date_gt Search by filing_date. (optional) + * @param \DateTime $filing_date_lte Search by filing_date. (optional) + * @param \DateTime $filing_date_lt Search by filing_date. (optional) + * @param \DateTime $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 100. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'period_of_report_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFinancials'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFinancialsAsyncWithHttpInfo($ticker = null, $cik = null, $company_name = null, $sic = null, $filing_date = null, $period_of_report_date = null, $timeframe = null, $include_sources = false, $company_name_search = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $order = null, $limit = 10, $sort = 'period_of_report_date', string $contentType = self::contentTypes['listFinancials'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListFinancials200Response'; + $request = $this->listFinancialsRequest($ticker, $cik, $company_name, $sic, $filing_date, $period_of_report_date, $timeframe, $include_sources, $company_name_search, $filing_date_gte, $filing_date_gt, $filing_date_lte, $filing_date_lt, $period_of_report_date_gte, $period_of_report_date_gt, $period_of_report_date_lte, $period_of_report_date_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listFinancials' + * + * @param string $ticker Query by company ticker. (optional) + * @param string $cik Query by central index key (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/edgar/searchedgar/cik.htm\">CIK</a>) Number (optional) + * @param string $company_name Query by company name. (optional) + * @param string $sic Query by standard industrial classification (<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list\">SIC</a>) (optional) + * @param \DateTime $filing_date Query by the date when the filing with financials data was filed in YYYY-MM-DD format. Best used when querying over date ranges to find financials based on filings that happen in a time period. Examples: To get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01 To get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01 (optional) + * @param \DateTime $period_of_report_date The period of report for the filing with financials data in YYYY-MM-DD format. (optional) + * @param string $timeframe Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4 (optional) + * @param bool $include_sources Whether or not to include the `xpath` and `formula` attributes for each financial data point. See the `xpath` and `formula` response attributes for more info. False by default. (optional, default to false) + * @param string $company_name_search Search by company_name. (optional) + * @param \DateTime $filing_date_gte Search by filing_date. (optional) + * @param \DateTime $filing_date_gt Search by filing_date. (optional) + * @param \DateTime $filing_date_lte Search by filing_date. (optional) + * @param \DateTime $filing_date_lt Search by filing_date. (optional) + * @param \DateTime $period_of_report_date_gte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_gt Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lte Search by period_of_report_date. (optional) + * @param \DateTime $period_of_report_date_lt Search by period_of_report_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 100. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'period_of_report_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFinancials'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listFinancialsRequest($ticker = null, $cik = null, $company_name = null, $sic = null, $filing_date = null, $period_of_report_date = null, $timeframe = null, $include_sources = false, $company_name_search = null, $filing_date_gte = null, $filing_date_gt = null, $filing_date_lte = null, $filing_date_lt = null, $period_of_report_date_gte = null, $period_of_report_date_gt = null, $period_of_report_date_lte = null, $period_of_report_date_lt = null, $order = null, $limit = 10, $sort = 'period_of_report_date', string $contentType = self::contentTypes['listFinancials'][0]) + { + + + + + + + + + + + + + + + + + + + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencestocksApi.listFinancials, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencestocksApi.listFinancials, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/vX/reference/financials'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cik, + 'cik', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $company_name, + 'company_name', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sic, + 'sic', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date, + 'filing_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date, + 'period_of_report_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timeframe, + 'timeframe', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_sources, + 'include_sources', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $company_name_search, + 'company_name.search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_gte, + 'filing_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_gt, + 'filing_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_lte, + 'filing_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filing_date_lt, + 'filing_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_gte, + 'period_of_report_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_gt, + 'period_of_report_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_lte, + 'period_of_report_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period_of_report_date_lt, + 'period_of_report_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listStockSplits + * + * Stock Splits v3 + * + * @param string $ticker Return the stock splits that contain this ticker. (optional) + * @param \DateTime $execution_date Query by execution date with the format YYYY-MM-DD. (optional) + * @param bool $reverse_split Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param \DateTime $execution_date_gte Search by execution_date. (optional) + * @param \DateTime $execution_date_gt Search by execution_date. (optional) + * @param \DateTime $execution_date_lte Search by execution_date. (optional) + * @param \DateTime $execution_date_lt Search by execution_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'execution_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listStockSplits'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListStockSplits200Response + */ + public function listStockSplits($ticker = null, $execution_date = null, $reverse_split = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $execution_date_gte = null, $execution_date_gt = null, $execution_date_lte = null, $execution_date_lt = null, $order = null, $limit = 10, $sort = 'execution_date', string $contentType = self::contentTypes['listStockSplits'][0]) + { + list($response) = $this->listStockSplitsWithHttpInfo($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listStockSplitsWithHttpInfo + * + * Stock Splits v3 + * + * @param string $ticker Return the stock splits that contain this ticker. (optional) + * @param \DateTime $execution_date Query by execution date with the format YYYY-MM-DD. (optional) + * @param bool $reverse_split Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param \DateTime $execution_date_gte Search by execution_date. (optional) + * @param \DateTime $execution_date_gt Search by execution_date. (optional) + * @param \DateTime $execution_date_lte Search by execution_date. (optional) + * @param \DateTime $execution_date_lt Search by execution_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'execution_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listStockSplits'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListStockSplits200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listStockSplitsWithHttpInfo($ticker = null, $execution_date = null, $reverse_split = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $execution_date_gte = null, $execution_date_gt = null, $execution_date_lte = null, $execution_date_lt = null, $order = null, $limit = 10, $sort = 'execution_date', string $contentType = self::contentTypes['listStockSplits'][0]) + { + $request = $this->listStockSplitsRequest($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListStockSplits200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListStockSplits200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListStockSplits200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListStockSplits200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListStockSplits200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listStockSplitsAsync + * + * Stock Splits v3 + * + * @param string $ticker Return the stock splits that contain this ticker. (optional) + * @param \DateTime $execution_date Query by execution date with the format YYYY-MM-DD. (optional) + * @param bool $reverse_split Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param \DateTime $execution_date_gte Search by execution_date. (optional) + * @param \DateTime $execution_date_gt Search by execution_date. (optional) + * @param \DateTime $execution_date_lte Search by execution_date. (optional) + * @param \DateTime $execution_date_lt Search by execution_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'execution_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listStockSplits'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listStockSplitsAsync($ticker = null, $execution_date = null, $reverse_split = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $execution_date_gte = null, $execution_date_gt = null, $execution_date_lte = null, $execution_date_lt = null, $order = null, $limit = 10, $sort = 'execution_date', string $contentType = self::contentTypes['listStockSplits'][0]) + { + return $this->listStockSplitsAsyncWithHttpInfo($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listStockSplitsAsyncWithHttpInfo + * + * Stock Splits v3 + * + * @param string $ticker Return the stock splits that contain this ticker. (optional) + * @param \DateTime $execution_date Query by execution date with the format YYYY-MM-DD. (optional) + * @param bool $reverse_split Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param \DateTime $execution_date_gte Search by execution_date. (optional) + * @param \DateTime $execution_date_gt Search by execution_date. (optional) + * @param \DateTime $execution_date_lte Search by execution_date. (optional) + * @param \DateTime $execution_date_lt Search by execution_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'execution_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listStockSplits'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listStockSplitsAsyncWithHttpInfo($ticker = null, $execution_date = null, $reverse_split = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $execution_date_gte = null, $execution_date_gt = null, $execution_date_lte = null, $execution_date_lt = null, $order = null, $limit = 10, $sort = 'execution_date', string $contentType = self::contentTypes['listStockSplits'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListStockSplits200Response'; + $request = $this->listStockSplitsRequest($ticker, $execution_date, $reverse_split, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $execution_date_gte, $execution_date_gt, $execution_date_lte, $execution_date_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listStockSplits' + * + * @param string $ticker Return the stock splits that contain this ticker. (optional) + * @param \DateTime $execution_date Query by execution date with the format YYYY-MM-DD. (optional) + * @param bool $reverse_split Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. (optional) + * @param string $ticker_gte Search by ticker. (optional) + * @param string $ticker_gt Search by ticker. (optional) + * @param string $ticker_lte Search by ticker. (optional) + * @param string $ticker_lt Search by ticker. (optional) + * @param \DateTime $execution_date_gte Search by execution_date. (optional) + * @param \DateTime $execution_date_gt Search by execution_date. (optional) + * @param \DateTime $execution_date_lte Search by execution_date. (optional) + * @param \DateTime $execution_date_lt Search by execution_date. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 10 and max is 1000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'execution_date') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listStockSplits'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listStockSplitsRequest($ticker = null, $execution_date = null, $reverse_split = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $execution_date_gte = null, $execution_date_gt = null, $execution_date_lte = null, $execution_date_lt = null, $order = null, $limit = 10, $sort = 'execution_date', string $contentType = self::contentTypes['listStockSplits'][0]) + { + + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencestocksApi.listStockSplits, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencestocksApi.listStockSplits, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/reference/splits'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $execution_date, + 'execution_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $reverse_split, + 'reverse_split', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $execution_date_gte, + 'execution_date.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $execution_date_gt, + 'execution_date.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $execution_date_lte, + 'execution_date.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $execution_date_lt, + 'execution_date.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencestocksmarketApi.php b/lib/Api/ReferencestocksmarketApi.php new file mode 100644 index 0000000..9fcf0ab --- /dev/null +++ b/lib/Api/ReferencestocksmarketApi.php @@ -0,0 +1,730 @@ + [ + 'application/json', + ], + 'getMarketStatus' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getMarketHolidays + * + * Market Holidays + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketHolidays'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[] + */ + public function getMarketHolidays(string $contentType = self::contentTypes['getMarketHolidays'][0]) + { + list($response) = $this->getMarketHolidaysWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getMarketHolidaysWithHttpInfo + * + * Market Holidays + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketHolidays'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[], HTTP status code, HTTP response headers (array of strings) + */ + public function getMarketHolidaysWithHttpInfo(string $contentType = self::contentTypes['getMarketHolidays'][0]) + { + $request = $this->getMarketHolidaysRequest($contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMarketHolidaysAsync + * + * Market Holidays + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketHolidays'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarketHolidaysAsync(string $contentType = self::contentTypes['getMarketHolidays'][0]) + { + return $this->getMarketHolidaysAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMarketHolidaysAsyncWithHttpInfo + * + * Market Holidays + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketHolidays'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarketHolidaysAsyncWithHttpInfo(string $contentType = self::contentTypes['getMarketHolidays'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetMarketHolidays200ResponseInner[]'; + $request = $this->getMarketHolidaysRequest($contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getMarketHolidays' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketHolidays'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMarketHolidaysRequest(string $contentType = self::contentTypes['getMarketHolidays'][0]) + { + + + $resourcePath = '/v1/marketstatus/upcoming'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMarketStatus + * + * Market Status + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetMarketStatus200Response + */ + public function getMarketStatus(string $contentType = self::contentTypes['getMarketStatus'][0]) + { + list($response) = $this->getMarketStatusWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getMarketStatusWithHttpInfo + * + * Market Status + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetMarketStatus200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMarketStatusWithHttpInfo(string $contentType = self::contentTypes['getMarketStatus'][0]) + { + $request = $this->getMarketStatusRequest($contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\GetMarketStatus200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\GetMarketStatus200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetMarketStatus200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\GetMarketStatus200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetMarketStatus200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMarketStatusAsync + * + * Market Status + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarketStatusAsync(string $contentType = self::contentTypes['getMarketStatus'][0]) + { + return $this->getMarketStatusAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMarketStatusAsyncWithHttpInfo + * + * Market Status + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMarketStatusAsyncWithHttpInfo(string $contentType = self::contentTypes['getMarketStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetMarketStatus200Response'; + $request = $this->getMarketStatusRequest($contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getMarketStatus' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMarketStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMarketStatusRequest(string $contentType = self::contentTypes['getMarketStatus'][0]) + { + + + $resourcePath = '/v1/marketstatus/now'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencetickersgetApi.php b/lib/Api/ReferencetickersgetApi.php new file mode 100644 index 0000000..adf65ce --- /dev/null +++ b/lib/Api/ReferencetickersgetApi.php @@ -0,0 +1,800 @@ + [ + 'application/json', + ], + 'getTicker' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getEvents + * + * Ticker Events + * + * @param string $id Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) (required) + * @param string $types A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvents'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetEvents200Response + */ + public function getEvents($id, $types = null, string $contentType = self::contentTypes['getEvents'][0]) + { + list($response) = $this->getEventsWithHttpInfo($id, $types, $contentType); + return $response; + } + + /** + * Operation getEventsWithHttpInfo + * + * Ticker Events + * + * @param string $id Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) (required) + * @param string $types A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvents'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetEvents200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getEventsWithHttpInfo($id, $types = null, string $contentType = self::contentTypes['getEvents'][0]) + { + $request = $this->getEventsRequest($id, $types, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\GetEvents200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\GetEvents200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetEvents200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\GetEvents200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetEvents200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEventsAsync + * + * Ticker Events + * + * @param string $id Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) (required) + * @param string $types A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEventsAsync($id, $types = null, string $contentType = self::contentTypes['getEvents'][0]) + { + return $this->getEventsAsyncWithHttpInfo($id, $types, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEventsAsyncWithHttpInfo + * + * Ticker Events + * + * @param string $id Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) (required) + * @param string $types A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEventsAsyncWithHttpInfo($id, $types = null, string $contentType = self::contentTypes['getEvents'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetEvents200Response'; + $request = $this->getEventsRequest($id, $types, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getEvents' + * + * @param string $id Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. When given a ticker, we return events for the entity currently represented by that ticker. To find events for entities previously associated with a ticker, find the relevant identifier using the [Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker) (required) + * @param string $types A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type. Leave blank to return all supported event_types. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEventsRequest($id, $types = null, string $contentType = self::contentTypes['getEvents'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getEvents' + ); + } + + + + $resourcePath = '/vX/reference/tickers/{id}/events'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $types, + 'types', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTicker + * + * Ticker Details v3 + * + * @param string $ticker The ticker symbol of the asset. (required) + * @param \DateTime $date Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTicker'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetTicker200Response + */ + public function getTicker($ticker, $date = null, string $contentType = self::contentTypes['getTicker'][0]) + { + list($response) = $this->getTickerWithHttpInfo($ticker, $date, $contentType); + return $response; + } + + /** + * Operation getTickerWithHttpInfo + * + * Ticker Details v3 + * + * @param string $ticker The ticker symbol of the asset. (required) + * @param \DateTime $date Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTicker'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetTicker200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTickerWithHttpInfo($ticker, $date = null, string $contentType = self::contentTypes['getTicker'][0]) + { + $request = $this->getTickerRequest($ticker, $date, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\GetTicker200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\GetTicker200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetTicker200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\GetTicker200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetTicker200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTickerAsync + * + * Ticker Details v3 + * + * @param string $ticker The ticker symbol of the asset. (required) + * @param \DateTime $date Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTicker'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTickerAsync($ticker, $date = null, string $contentType = self::contentTypes['getTicker'][0]) + { + return $this->getTickerAsyncWithHttpInfo($ticker, $date, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTickerAsyncWithHttpInfo + * + * Ticker Details v3 + * + * @param string $ticker The ticker symbol of the asset. (required) + * @param \DateTime $date Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTicker'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTickerAsyncWithHttpInfo($ticker, $date = null, string $contentType = self::contentTypes['getTicker'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetTicker200Response'; + $request = $this->getTickerRequest($ticker, $date, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'getTicker' + * + * @param string $ticker The ticker symbol of the asset. (required) + * @param \DateTime $date Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing. Defaults to the most recent available date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTicker'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTickerRequest($ticker, $date = null, string $contentType = self::contentTypes['getTicker'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling getTicker' + ); + } + + + + $resourcePath = '/v3/reference/tickers/{ticker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencetickerslistApi.php b/lib/Api/ReferencetickerslistApi.php new file mode 100644 index 0000000..9790430 --- /dev/null +++ b/lib/Api/ReferencetickerslistApi.php @@ -0,0 +1,681 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listTickers + * + * Tickers + * + * @param string $ticker Specify a ticker symbol. Defaults to empty string which queries all tickers. (optional) + * @param string $type Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. (optional) + * @param string $market Filter by market type. By default all markets are included. (optional) + * @param string $exchange Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. (optional) + * @param string $cusip Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. (optional) + * @param string $cik Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. (optional) + * @param \DateTime $date Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. (optional) + * @param string $search Search for terms within the ticker and/or company name. (optional) + * @param bool $active Specify if the tickers returned should be actively traded on the queried date. Default is true. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 100 and max is 1000. (optional, default to 100) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListTickers200Response + */ + public function listTickers($ticker = null, $type = null, $market = null, $exchange = null, $cusip = null, $cik = null, $date = null, $search = null, $active = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 100, $sort = 'ticker', string $contentType = self::contentTypes['listTickers'][0]) + { + list($response) = $this->listTickersWithHttpInfo($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation listTickersWithHttpInfo + * + * Tickers + * + * @param string $ticker Specify a ticker symbol. Defaults to empty string which queries all tickers. (optional) + * @param string $type Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. (optional) + * @param string $market Filter by market type. By default all markets are included. (optional) + * @param string $exchange Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. (optional) + * @param string $cusip Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. (optional) + * @param string $cik Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. (optional) + * @param \DateTime $date Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. (optional) + * @param string $search Search for terms within the ticker and/or company name. (optional) + * @param bool $active Specify if the tickers returned should be actively traded on the queried date. Default is true. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 100 and max is 1000. (optional, default to 100) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListTickers200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listTickersWithHttpInfo($ticker = null, $type = null, $market = null, $exchange = null, $cusip = null, $cik = null, $date = null, $search = null, $active = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 100, $sort = 'ticker', string $contentType = self::contentTypes['listTickers'][0]) + { + $request = $this->listTickersRequest($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListTickers200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListTickers200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListTickers200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListTickers200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListTickers200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listTickersAsync + * + * Tickers + * + * @param string $ticker Specify a ticker symbol. Defaults to empty string which queries all tickers. (optional) + * @param string $type Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. (optional) + * @param string $market Filter by market type. By default all markets are included. (optional) + * @param string $exchange Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. (optional) + * @param string $cusip Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. (optional) + * @param string $cik Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. (optional) + * @param \DateTime $date Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. (optional) + * @param string $search Search for terms within the ticker and/or company name. (optional) + * @param bool $active Specify if the tickers returned should be actively traded on the queried date. Default is true. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 100 and max is 1000. (optional, default to 100) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickersAsync($ticker = null, $type = null, $market = null, $exchange = null, $cusip = null, $cik = null, $date = null, $search = null, $active = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 100, $sort = 'ticker', string $contentType = self::contentTypes['listTickers'][0]) + { + return $this->listTickersAsyncWithHttpInfo($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listTickersAsyncWithHttpInfo + * + * Tickers + * + * @param string $ticker Specify a ticker symbol. Defaults to empty string which queries all tickers. (optional) + * @param string $type Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. (optional) + * @param string $market Filter by market type. By default all markets are included. (optional) + * @param string $exchange Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. (optional) + * @param string $cusip Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. (optional) + * @param string $cik Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. (optional) + * @param \DateTime $date Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. (optional) + * @param string $search Search for terms within the ticker and/or company name. (optional) + * @param bool $active Specify if the tickers returned should be actively traded on the queried date. Default is true. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 100 and max is 1000. (optional, default to 100) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickersAsyncWithHttpInfo($ticker = null, $type = null, $market = null, $exchange = null, $cusip = null, $cik = null, $date = null, $search = null, $active = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 100, $sort = 'ticker', string $contentType = self::contentTypes['listTickers'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListTickers200Response'; + $request = $this->listTickersRequest($ticker, $type, $market, $exchange, $cusip, $cik, $date, $search, $active, $ticker_gte, $ticker_gt, $ticker_lte, $ticker_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listTickers' + * + * @param string $ticker Specify a ticker symbol. Defaults to empty string which queries all tickers. (optional) + * @param string $type Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). Defaults to empty string which queries all types. (optional) + * @param string $market Filter by market type. By default all markets are included. (optional) + * @param string $exchange Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes). Defaults to empty string which queries all exchanges. (optional) + * @param string $cusip Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP). Defaults to empty string which queries all CUSIPs. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. (optional) + * @param string $cik Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm). Defaults to empty string which queries all CIKs. (optional) + * @param \DateTime $date Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. (optional) + * @param string $search Search for terms within the ticker and/or company name. (optional) + * @param bool $active Specify if the tickers returned should be actively traded on the queried date. Default is true. (optional) + * @param string $ticker_gte Range by ticker. (optional) + * @param string $ticker_gt Range by ticker. (optional) + * @param string $ticker_lte Range by ticker. (optional) + * @param string $ticker_lt Range by ticker. (optional) + * @param string $order Order results based on the `sort` field. (optional) + * @param int $limit Limit the number of results returned, default is 100 and max is 1000. (optional, default to 100) + * @param string $sort Sort field used for ordering. (optional, default to 'ticker') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listTickersRequest($ticker = null, $type = null, $market = null, $exchange = null, $cusip = null, $cik = null, $date = null, $search = null, $active = null, $ticker_gte = null, $ticker_gt = null, $ticker_lte = null, $ticker_lt = null, $order = null, $limit = 100, $sort = 'ticker', string $contentType = self::contentTypes['listTickers'][0]) + { + + + + + + + + + + + + + + + + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencetickerslistApi.listTickers, must be smaller than or equal to 1000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReferencetickerslistApi.listTickers, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/reference/tickers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker, + 'ticker', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $market, + 'market', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $exchange, + 'exchange', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cusip, + 'cusip', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cik, + 'cik', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $active, + 'active', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gte, + 'ticker.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_gt, + 'ticker.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lte, + 'ticker.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ticker_lt, + 'ticker.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReferencetickerstypesApi.php b/lib/Api/ReferencetickerstypesApi.php new file mode 100644 index 0000000..49b0481 --- /dev/null +++ b/lib/Api/ReferencetickerstypesApi.php @@ -0,0 +1,535 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listTickerTypes + * + * Ticker Types + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTypes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ListTickerTypes200Response|\OpenAPI\Client\Model\ListExchanges400Response|\OpenAPI\Client\Model\ListExchanges400Response + */ + public function listTickerTypes($asset_class = null, $locale = null, string $contentType = self::contentTypes['listTickerTypes'][0]) + { + list($response) = $this->listTickerTypesWithHttpInfo($asset_class, $locale, $contentType); + return $response; + } + + /** + * Operation listTickerTypesWithHttpInfo + * + * Ticker Types + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTypes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ListTickerTypes200Response|\OpenAPI\Client\Model\ListExchanges400Response|\OpenAPI\Client\Model\ListExchanges400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listTickerTypesWithHttpInfo($asset_class = null, $locale = null, string $contentType = self::contentTypes['listTickerTypes'][0]) + { + $request = $this->listTickerTypesRequest($asset_class, $locale, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\ListTickerTypes200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListTickerTypes200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListTickerTypes200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\OpenAPI\Client\Model\ListExchanges400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListExchanges400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListExchanges400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ListExchanges400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ListExchanges400Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ListExchanges400Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ListTickerTypes200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListTickerTypes200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListExchanges400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ListExchanges400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listTickerTypesAsync + * + * Ticker Types + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTypes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTypesAsync($asset_class = null, $locale = null, string $contentType = self::contentTypes['listTickerTypes'][0]) + { + return $this->listTickerTypesAsyncWithHttpInfo($asset_class, $locale, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listTickerTypesAsyncWithHttpInfo + * + * Ticker Types + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTypes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTickerTypesAsyncWithHttpInfo($asset_class = null, $locale = null, string $contentType = self::contentTypes['listTickerTypes'][0]) + { + $returnType = '\OpenAPI\Client\Model\ListTickerTypes200Response'; + $request = $this->listTickerTypesRequest($asset_class, $locale, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'listTickerTypes' + * + * @param string $asset_class Filter by asset class. (optional) + * @param string $locale Filter by locale. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTickerTypes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listTickerTypesRequest($asset_class = null, $locale = null, string $contentType = self::contentTypes['listTickerTypes'][0]) + { + + + + + $resourcePath = '/v3/reference/tickers/types'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $asset_class, + 'asset_class', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StocksaggregatesApi.php b/lib/Api/StocksaggregatesApi.php new file mode 100644 index 0000000..73e8d7a --- /dev/null +++ b/lib/Api/StocksaggregatesApi.php @@ -0,0 +1,3277 @@ + [ + 'application/json', + ], + 'mACD' => [ + 'application/json', + ], + 'rSI' => [ + 'application/json', + ], + 'sMA' => [ + 'application/json', + ], + 'v2AggsGroupedLocaleUsMarketStocksDateGet' => [ + 'application/json', + ], + 'v2AggsTickerStocksTickerPrevGet' => [ + 'application/json', + ], + 'v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation eMA + * + * Exponential Moving Average (EMA) + * + * @param string $stock_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['eMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoEMA200Response + */ + public function eMA($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['eMA'][0]) + { + list($response) = $this->eMAWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation eMAWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $stock_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['eMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoEMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function eMAWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['eMA'][0]) + { + $request = $this->eMARequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoEMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoEMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoEMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoEMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation eMAAsync + * + * Exponential Moving Average (EMA) + * + * @param string $stock_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['eMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function eMAAsync($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['eMA'][0]) + { + return $this->eMAAsyncWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation eMAAsyncWithHttpInfo + * + * Exponential Moving Average (EMA) + * + * @param string $stock_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['eMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function eMAAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['eMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoEMA200Response'; + $request = $this->eMARequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'eMA' + * + * @param string $stock_ticker The ticker symbol for which to get exponential moving average (EMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to calculate the exponential moving average (EMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['eMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function eMARequest($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['eMA'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling eMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksaggregatesApi.eMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/ema/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation mACD + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $stock_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoMACD200Response + */ + public function mACD($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['mACD'][0]) + { + list($response) = $this->mACDWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation mACDWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $stock_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mACD'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoMACD200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function mACDWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['mACD'][0]) + { + $request = $this->mACDRequest($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoMACD200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoMACD200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoMACD200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoMACD200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mACDAsync + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $stock_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mACDAsync($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['mACD'][0]) + { + return $this->mACDAsyncWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mACDAsyncWithHttpInfo + * + * Moving Average Convergence/Divergence (MACD) + * + * @param string $stock_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mACDAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['mACD'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoMACD200Response'; + $request = $this->mACDRequest($stock_ticker, $timestamp, $timespan, $adjusted, $short_window, $long_window, $signal_window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'mACD' + * + * @param string $stock_ticker The ticker symbol for which to get MACD data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $short_window The short window size used to calculate MACD data. (optional, default to 12) + * @param int $long_window The long window size used to calculate MACD data. (optional, default to 26) + * @param int $signal_window The window size used to calculate the MACD signal line. (optional, default to 9) + * @param string $series_type The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to calculate the MACD. (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mACD'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function mACDRequest($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $short_window = 12, $long_window = 26, $signal_window = 9, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['mACD'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling mACD' + ); + } + + + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksaggregatesApi.mACD, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/macd/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $short_window, + 'short_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $long_window, + 'long_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signal_window, + 'signal_window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation rSI + * + * Relative Strength Index (RSI) + * + * @param string $stock_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoRSI200Response + */ + public function rSI($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['rSI'][0]) + { + list($response) = $this->rSIWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation rSIWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $stock_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rSI'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoRSI200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function rSIWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['rSI'][0]) + { + $request = $this->rSIRequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoRSI200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoRSI200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoRSI200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoRSI200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation rSIAsync + * + * Relative Strength Index (RSI) + * + * @param string $stock_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function rSIAsync($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['rSI'][0]) + { + return $this->rSIAsyncWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation rSIAsyncWithHttpInfo + * + * Relative Strength Index (RSI) + * + * @param string $stock_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function rSIAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['rSI'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoRSI200Response'; + $request = $this->rSIRequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'rSI' + * + * @param string $stock_ticker The ticker symbol for which to get relative strength index (RSI) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the relative strength index (RSI). (optional, default to 14) + * @param string $series_type The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to calculate the relative strength index (RSI). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rSI'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function rSIRequest($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 14, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['rSI'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling rSI' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksaggregatesApi.rSI, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/rsi/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sMA + * + * Simple Moving Average (SMA) + * + * @param string $stock_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\CryptoSMA200Response + */ + public function sMA($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['sMA'][0]) + { + list($response) = $this->sMAWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + return $response; + } + + /** + * Operation sMAWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $stock_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sMA'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\CryptoSMA200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function sMAWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['sMA'][0]) + { + $request = $this->sMARequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\CryptoSMA200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CryptoSMA200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CryptoSMA200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\CryptoSMA200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sMAAsync + * + * Simple Moving Average (SMA) + * + * @param string $stock_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sMAAsync($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['sMA'][0]) + { + return $this->sMAAsyncWithHttpInfo($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sMAAsyncWithHttpInfo + * + * Simple Moving Average (SMA) + * + * @param string $stock_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sMAAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['sMA'][0]) + { + $returnType = '\OpenAPI\Client\Model\CryptoSMA200Response'; + $request = $this->sMARequest($stock_ticker, $timestamp, $timespan, $adjusted, $window, $series_type, $expand_underlying, $order, $limit, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'sMA' + * + * @param string $stock_ticker The ticker symbol for which to get simple moving average (SMA) data. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (optional) + * @param string $timespan The size of the aggregate time window. (optional, default to 'day') + * @param bool $adjusted Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional, default to true) + * @param int $window The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average. (optional, default to 50) + * @param string $series_type The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA). (optional, default to 'close') + * @param bool $expand_underlying Whether or not to include the aggregates used to calculate this indicator in the response. (optional, default to false) + * @param string $order The order in which to return the results, ordered by timestamp. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 5000 (optional, default to 10) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sMA'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sMARequest($stock_ticker, $timestamp = null, $timespan = 'day', $adjusted = true, $window = 50, $series_type = 'close', $expand_underlying = false, $order = 'desc', $limit = 10, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, string $contentType = self::contentTypes['sMA'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling sMA' + ); + } + + + + + + + + + if ($limit !== null && $limit > 5000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksaggregatesApi.sMA, must be smaller than or equal to 5000.'); + } + + + + + + + $resourcePath = '/v1/indicators/sma/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timespan, + 'timespan', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $window, + 'window', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $series_type, + 'series_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $expand_underlying, + 'expand_underlying', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsGroupedLocaleUsMarketStocksDateGet + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response + */ + public function v2AggsGroupedLocaleUsMarketStocksDateGet($date, $adjusted = null, $include_otc = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'][0]) + { + list($response) = $this->v2AggsGroupedLocaleUsMarketStocksDateGetWithHttpInfo($date, $adjusted, $include_otc, $contentType); + return $response; + } + + /** + * Operation v2AggsGroupedLocaleUsMarketStocksDateGetWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsGroupedLocaleUsMarketStocksDateGetWithHttpInfo($date, $adjusted = null, $include_otc = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'][0]) + { + $request = $this->v2AggsGroupedLocaleUsMarketStocksDateGetRequest($date, $adjusted, $include_otc, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsGroupedLocaleUsMarketStocksDateGetAsync + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleUsMarketStocksDateGetAsync($date, $adjusted = null, $include_otc = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'][0]) + { + return $this->v2AggsGroupedLocaleUsMarketStocksDateGetAsyncWithHttpInfo($date, $adjusted, $include_otc, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsGroupedLocaleUsMarketStocksDateGetAsyncWithHttpInfo + * + * Grouped Daily (Bars) + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsGroupedLocaleUsMarketStocksDateGetAsyncWithHttpInfo($date, $adjusted = null, $include_otc = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200Response'; + $request = $this->v2AggsGroupedLocaleUsMarketStocksDateGetRequest($date, $adjusted, $include_otc, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsGroupedLocaleUsMarketStocksDateGet' + * + * @param string $date The beginning date for the aggregate window. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsGroupedLocaleUsMarketStocksDateGetRequest($date, $adjusted = null, $include_otc = null, string $contentType = self::contentTypes['v2AggsGroupedLocaleUsMarketStocksDateGet'][0]) + { + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v2AggsGroupedLocaleUsMarketStocksDateGet' + ); + } + + + + + $resourcePath = '/v2/aggs/grouped/locale/us/market/stocks/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_otc, + 'include_otc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerStocksTickerPrevGet + * + * Previous Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerStocksTickerPrevGet($stocks_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerPrevGet'][0]) + { + list($response) = $this->v2AggsTickerStocksTickerPrevGetWithHttpInfo($stocks_ticker, $adjusted, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerStocksTickerPrevGetWithHttpInfo + * + * Previous Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerPrevGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerStocksTickerPrevGetWithHttpInfo($stocks_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerPrevGet'][0]) + { + $request = $this->v2AggsTickerStocksTickerPrevGetRequest($stocks_ticker, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerStocksTickerPrevGetAsync + * + * Previous Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerStocksTickerPrevGetAsync($stocks_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerPrevGet'][0]) + { + return $this->v2AggsTickerStocksTickerPrevGetAsyncWithHttpInfo($stocks_ticker, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerStocksTickerPrevGetAsyncWithHttpInfo + * + * Previous Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerStocksTickerPrevGetAsyncWithHttpInfo($stocks_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerPrevGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerStocksTickerPrevGetRequest($stocks_ticker, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerStocksTickerPrevGet' + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerPrevGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerStocksTickerPrevGetRequest($stocks_ticker, $adjusted = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerPrevGet'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling v2AggsTickerStocksTickerPrevGet' + ); + } + + + + $resourcePath = '/v2/aggs/ticker/{stocksTicker}/prev'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars) + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response + */ + public function v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'][0]) + { + list($response) = $this->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetWithHttpInfo($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + return $response; + } + + /** + * Operation v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetWithHttpInfo($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'][0]) + { + $request = $this->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetRequest($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetAsync + * + * Aggregates (Bars) + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetAsync($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'][0]) + { + return $this->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo + * + * Aggregates (Bars) + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetAsyncWithHttpInfo($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response'; + $request = $this->v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetRequest($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted, $sort, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param int $multiplier The size of the timespan multiplier. (required) + * @param string $timespan The size of the time window. (required) + * @param string $from The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param string $to The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $sort Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top). (optional) + * @param int $limit Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on <a href=\"https://polygon.io/blog/aggs-api-updates/\" target=\"_blank\" alt=\"Aggregate Data API Improvements\">Aggregate Data API Improvements</a>. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGetRequest($stocks_ticker, $multiplier, $timespan, $from, $to, $adjusted = null, $sort = null, $limit = null, string $contentType = self::contentTypes['v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'multiplier' is set + if ($multiplier === null || (is_array($multiplier) && count($multiplier) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multiplier when calling v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + ); + } + + // verify the required parameter 'timespan' is set + if ($timespan === null || (is_array($timespan) && count($timespan) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timespan when calling v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + ); + } + + // 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 v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet' + ); + } + + + + + + $resourcePath = '/v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + // path params + if ($multiplier !== null) { + $resourcePath = str_replace( + '{' . 'multiplier' . '}', + ObjectSerializer::toPathValue($multiplier), + $resourcePath + ); + } + // path params + if ($timespan !== null) { + $resourcePath = str_replace( + '{' . 'timespan' . '}', + ObjectSerializer::toPathValue($timespan), + $resourcePath + ); + } + // path params + if ($from !== null) { + $resourcePath = str_replace( + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), + $resourcePath + ); + } + // path params + if ($to !== null) { + $resourcePath = str_replace( + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StockslastquoteApi.php b/lib/Api/StockslastquoteApi.php new file mode 100644 index 0000000..b1e47c2 --- /dev/null +++ b/lib/Api/StockslastquoteApi.php @@ -0,0 +1,455 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation lastQuote + * + * Last Quote + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuote'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\LastQuote200Response + */ + public function lastQuote($stocks_ticker, string $contentType = self::contentTypes['lastQuote'][0]) + { + list($response) = $this->lastQuoteWithHttpInfo($stocks_ticker, $contentType); + return $response; + } + + /** + * Operation lastQuoteWithHttpInfo + * + * Last Quote + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuote'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\LastQuote200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function lastQuoteWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['lastQuote'][0]) + { + $request = $this->lastQuoteRequest($stocks_ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\LastQuote200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LastQuote200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LastQuote200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\LastQuote200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\LastQuote200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastQuoteAsync + * + * Last Quote + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastQuoteAsync($stocks_ticker, string $contentType = self::contentTypes['lastQuote'][0]) + { + return $this->lastQuoteAsyncWithHttpInfo($stocks_ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastQuoteAsyncWithHttpInfo + * + * Last Quote + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastQuoteAsyncWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['lastQuote'][0]) + { + $returnType = '\OpenAPI\Client\Model\LastQuote200Response'; + $request = $this->lastQuoteRequest($stocks_ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'lastQuote' + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastQuote'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastQuoteRequest($stocks_ticker, string $contentType = self::contentTypes['lastQuote'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling lastQuote' + ); + } + + + $resourcePath = '/v2/last/nbbo/{stocksTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StockslasttradeApi.php b/lib/Api/StockslasttradeApi.php new file mode 100644 index 0000000..145da42 --- /dev/null +++ b/lib/Api/StockslasttradeApi.php @@ -0,0 +1,455 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation lastTrade + * + * Last Trade + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTrade'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\LastTradeOptions200Response + */ + public function lastTrade($stocks_ticker, string $contentType = self::contentTypes['lastTrade'][0]) + { + list($response) = $this->lastTradeWithHttpInfo($stocks_ticker, $contentType); + return $response; + } + + /** + * Operation lastTradeWithHttpInfo + * + * Last Trade + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTrade'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\LastTradeOptions200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function lastTradeWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['lastTrade'][0]) + { + $request = $this->lastTradeRequest($stocks_ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\LastTradeOptions200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LastTradeOptions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LastTradeOptions200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\LastTradeOptions200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\LastTradeOptions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastTradeAsync + * + * Last Trade + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTrade'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeAsync($stocks_ticker, string $contentType = self::contentTypes['lastTrade'][0]) + { + return $this->lastTradeAsyncWithHttpInfo($stocks_ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastTradeAsyncWithHttpInfo + * + * Last Trade + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTrade'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function lastTradeAsyncWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['lastTrade'][0]) + { + $returnType = '\OpenAPI\Client\Model\LastTradeOptions200Response'; + $request = $this->lastTradeRequest($stocks_ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'lastTrade' + * + * @param string $stocks_ticker The ticker symbol of the stock/equity. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastTrade'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastTradeRequest($stocks_ticker, string $contentType = self::contentTypes['lastTrade'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling lastTrade' + ); + } + + + $resourcePath = '/v2/last/trade/{stocksTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StocksopenCloseApi.php b/lib/Api/StocksopenCloseApi.php new file mode 100644 index 0000000..d2330d8 --- /dev/null +++ b/lib/Api/StocksopenCloseApi.php @@ -0,0 +1,825 @@ + [ + 'application/json', + ], + 'v1OpenCloseStocksTickerDateGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v1OpenCloseIndicesTickerDateGet + * + * Daily Open/Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseIndicesTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response + */ + public function v1OpenCloseIndicesTickerDateGet($indices_ticker, $date, string $contentType = self::contentTypes['v1OpenCloseIndicesTickerDateGet'][0]) + { + list($response) = $this->v1OpenCloseIndicesTickerDateGetWithHttpInfo($indices_ticker, $date, $contentType); + return $response; + } + + /** + * Operation v1OpenCloseIndicesTickerDateGetWithHttpInfo + * + * Daily Open/Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseIndicesTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1OpenCloseIndicesTickerDateGetWithHttpInfo($indices_ticker, $date, string $contentType = self::contentTypes['v1OpenCloseIndicesTickerDateGet'][0]) + { + $request = $this->v1OpenCloseIndicesTickerDateGetRequest($indices_ticker, $date, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1OpenCloseIndicesTickerDateGetAsync + * + * Daily Open/Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseIndicesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseIndicesTickerDateGetAsync($indices_ticker, $date, string $contentType = self::contentTypes['v1OpenCloseIndicesTickerDateGet'][0]) + { + return $this->v1OpenCloseIndicesTickerDateGetAsyncWithHttpInfo($indices_ticker, $date, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1OpenCloseIndicesTickerDateGetAsyncWithHttpInfo + * + * Daily Open/Close + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseIndicesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseIndicesTickerDateGetAsyncWithHttpInfo($indices_ticker, $date, string $contentType = self::contentTypes['v1OpenCloseIndicesTickerDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1OpenCloseIndicesTickerDateGet200Response'; + $request = $this->v1OpenCloseIndicesTickerDateGetRequest($indices_ticker, $date, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1OpenCloseIndicesTickerDateGet' + * + * @param string $indices_ticker The ticker symbol of Index. (required) + * @param string $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseIndicesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1OpenCloseIndicesTickerDateGetRequest($indices_ticker, $date, string $contentType = self::contentTypes['v1OpenCloseIndicesTickerDateGet'][0]) + { + + // verify the required parameter 'indices_ticker' is set + if ($indices_ticker === null || (is_array($indices_ticker) && count($indices_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indices_ticker when calling v1OpenCloseIndicesTickerDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1OpenCloseIndicesTickerDateGet' + ); + } + + + $resourcePath = '/v1/open-close/{indicesTicker}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($indices_ticker !== null) { + $resourcePath = str_replace( + '{' . 'indicesTicker' . '}', + ObjectSerializer::toPathValue($indices_ticker), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v1OpenCloseStocksTickerDateGet + * + * Daily Open/Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseStocksTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response + */ + public function v1OpenCloseStocksTickerDateGet($stocks_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseStocksTickerDateGet'][0]) + { + list($response) = $this->v1OpenCloseStocksTickerDateGetWithHttpInfo($stocks_ticker, $date, $adjusted, $contentType); + return $response; + } + + /** + * Operation v1OpenCloseStocksTickerDateGetWithHttpInfo + * + * Daily Open/Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseStocksTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v1OpenCloseStocksTickerDateGetWithHttpInfo($stocks_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseStocksTickerDateGet'][0]) + { + $request = $this->v1OpenCloseStocksTickerDateGetRequest($stocks_ticker, $date, $adjusted, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v1OpenCloseStocksTickerDateGetAsync + * + * Daily Open/Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseStocksTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseStocksTickerDateGetAsync($stocks_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseStocksTickerDateGet'][0]) + { + return $this->v1OpenCloseStocksTickerDateGetAsyncWithHttpInfo($stocks_ticker, $date, $adjusted, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v1OpenCloseStocksTickerDateGetAsyncWithHttpInfo + * + * Daily Open/Close + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseStocksTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v1OpenCloseStocksTickerDateGetAsyncWithHttpInfo($stocks_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseStocksTickerDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V1OpenCloseOptionsTickerDateGet200Response'; + $request = $this->v1OpenCloseStocksTickerDateGetRequest($stocks_ticker, $date, $adjusted, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v1OpenCloseStocksTickerDateGet' + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param \DateTime $date The date of the requested open/close in the format YYYY-MM-DD. (required) + * @param bool $adjusted Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1OpenCloseStocksTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v1OpenCloseStocksTickerDateGetRequest($stocks_ticker, $date, $adjusted = null, string $contentType = self::contentTypes['v1OpenCloseStocksTickerDateGet'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling v1OpenCloseStocksTickerDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v1OpenCloseStocksTickerDateGet' + ); + } + + + + $resourcePath = '/v1/open-close/{stocksTicker}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $adjusted, + 'adjusted', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StocksquotesApi.php b/lib/Api/StocksquotesApi.php new file mode 100644 index 0000000..c43275d --- /dev/null +++ b/lib/Api/StocksquotesApi.php @@ -0,0 +1,976 @@ + [ + 'application/json', + ], + 'v2TicksStocksNbboTickerDateGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation quotes + * + * Quotes (NBBO) + * + * @param string $stock_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\Quotes200Response + */ + public function quotes($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotes'][0]) + { + list($response) = $this->quotesWithHttpInfo($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation quotesWithHttpInfo + * + * Quotes (NBBO) + * + * @param string $stock_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\Quotes200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function quotesWithHttpInfo($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotes'][0]) + { + $request = $this->quotesRequest($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\Quotes200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Quotes200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Quotes200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Quotes200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\Quotes200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation quotesAsync + * + * Quotes (NBBO) + * + * @param string $stock_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesAsync($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotes'][0]) + { + return $this->quotesAsyncWithHttpInfo($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation quotesAsyncWithHttpInfo + * + * Quotes (NBBO) + * + * @param string $stock_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function quotesAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotes'][0]) + { + $returnType = '\OpenAPI\Client\Model\Quotes200Response'; + $request = $this->quotesRequest($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'quotes' + * + * @param string $stock_ticker The ticker symbol to get quotes for. (required) + * @param string $timestamp Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['quotes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function quotesRequest($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['quotes'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling quotes' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksquotesApi.quotes, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksquotesApi.quotes, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/quotes/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2TicksStocksNbboTickerDateGet + * + * Quotes (NBBO) + * + * @param string $ticker The ticker symbol we want quotes for. (required) + * @param \DateTime $date The date/day of the quotes to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksNbboTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response + */ + public function v2TicksStocksNbboTickerDateGet($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksNbboTickerDateGet'][0]) + { + list($response) = $this->v2TicksStocksNbboTickerDateGetWithHttpInfo($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + return $response; + } + + /** + * Operation v2TicksStocksNbboTickerDateGetWithHttpInfo + * + * Quotes (NBBO) + * + * @param string $ticker The ticker symbol we want quotes for. (required) + * @param \DateTime $date The date/day of the quotes to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksNbboTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2TicksStocksNbboTickerDateGetWithHttpInfo($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksNbboTickerDateGet'][0]) + { + $request = $this->v2TicksStocksNbboTickerDateGetRequest($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2TicksStocksNbboTickerDateGetAsync + * + * Quotes (NBBO) + * + * @param string $ticker The ticker symbol we want quotes for. (required) + * @param \DateTime $date The date/day of the quotes to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksNbboTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2TicksStocksNbboTickerDateGetAsync($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksNbboTickerDateGet'][0]) + { + return $this->v2TicksStocksNbboTickerDateGetAsyncWithHttpInfo($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2TicksStocksNbboTickerDateGetAsyncWithHttpInfo + * + * Quotes (NBBO) + * + * @param string $ticker The ticker symbol we want quotes for. (required) + * @param \DateTime $date The date/day of the quotes to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksNbboTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2TicksStocksNbboTickerDateGetAsyncWithHttpInfo($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksNbboTickerDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200Response'; + $request = $this->v2TicksStocksNbboTickerDateGetRequest($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2TicksStocksNbboTickerDateGet' + * + * @param string $ticker The ticker symbol we want quotes for. (required) + * @param \DateTime $date The date/day of the quotes to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksNbboTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2TicksStocksNbboTickerDateGetRequest($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksNbboTickerDateGet'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling v2TicksStocksNbboTickerDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v2TicksStocksNbboTickerDateGet' + ); + } + + + + + + + $resourcePath = '/v2/ticks/stocks/nbbo/{ticker}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_limit, + 'timestampLimit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $reverse, + 'reverse', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StockssnapshotApi.php b/lib/Api/StockssnapshotApi.php new file mode 100644 index 0000000..fdc404f --- /dev/null +++ b/lib/Api/StockssnapshotApi.php @@ -0,0 +1,1110 @@ + [ + 'application/json', + ], + 'v2SnapshotLocaleUsMarketsStocksTickersGet' => [ + 'application/json', + ], + 'v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksDirectionGet + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response + */ + public function v2SnapshotLocaleUsMarketsStocksDirectionGet($direction, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'][0]) + { + list($response) = $this->v2SnapshotLocaleUsMarketsStocksDirectionGetWithHttpInfo($direction, $include_otc, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksDirectionGetWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleUsMarketsStocksDirectionGetWithHttpInfo($direction, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'][0]) + { + $request = $this->v2SnapshotLocaleUsMarketsStocksDirectionGetRequest($direction, $include_otc, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksDirectionGetAsync + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksDirectionGetAsync($direction, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'][0]) + { + return $this->v2SnapshotLocaleUsMarketsStocksDirectionGetAsyncWithHttpInfo($direction, $include_otc, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksDirectionGetAsyncWithHttpInfo + * + * Gainers/Losers + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksDirectionGetAsyncWithHttpInfo($direction, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksDirectionGet200Response'; + $request = $this->v2SnapshotLocaleUsMarketsStocksDirectionGetRequest($direction, $include_otc, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleUsMarketsStocksDirectionGet' + * + * @param string $direction The direction of the snapshot results to return. (required) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleUsMarketsStocksDirectionGetRequest($direction, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksDirectionGet'][0]) + { + + // verify the required parameter 'direction' is set + if ($direction === null || (is_array($direction) && count($direction) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $direction when calling v2SnapshotLocaleUsMarketsStocksDirectionGet' + ); + } + + + + $resourcePath = '/v2/snapshot/locale/us/markets/stocks/{direction}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_otc, + 'include_otc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($direction !== null) { + $resourcePath = str_replace( + '{' . 'direction' . '}', + ObjectSerializer::toPathValue($direction), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersGet + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response + */ + public function v2SnapshotLocaleUsMarketsStocksTickersGet($tickers = null, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'][0]) + { + list($response) = $this->v2SnapshotLocaleUsMarketsStocksTickersGetWithHttpInfo($tickers, $include_otc, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersGetWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleUsMarketsStocksTickersGetWithHttpInfo($tickers = null, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'][0]) + { + $request = $this->v2SnapshotLocaleUsMarketsStocksTickersGetRequest($tickers, $include_otc, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersGetAsync + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksTickersGetAsync($tickers = null, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'][0]) + { + return $this->v2SnapshotLocaleUsMarketsStocksTickersGetAsyncWithHttpInfo($tickers, $include_otc, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersGetAsyncWithHttpInfo + * + * All Tickers + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksTickersGetAsyncWithHttpInfo($tickers = null, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200Response'; + $request = $this->v2SnapshotLocaleUsMarketsStocksTickersGetRequest($tickers, $include_otc, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleUsMarketsStocksTickersGet' + * + * @param string[] $tickers A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers. (optional) + * @param bool $include_otc Include OTC securities in the response. Default is false (don't include OTC securities). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleUsMarketsStocksTickersGetRequest($tickers = null, $include_otc = null, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersGet'][0]) + { + + + + + $resourcePath = '/v2/snapshot/locale/us/markets/stocks/tickers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tickers, + 'tickers', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_otc, + 'include_otc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet + * + * Ticker + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response + */ + public function v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet($stocks_ticker, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'][0]) + { + list($response) = $this->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetWithHttpInfo($stocks_ticker, $contentType); + return $response; + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetWithHttpInfo + * + * Ticker + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'][0]) + { + $request = $this->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetRequest($stocks_ticker, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetAsync + * + * Ticker + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetAsync($stocks_ticker, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'][0]) + { + return $this->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetAsyncWithHttpInfo($stocks_ticker, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetAsyncWithHttpInfo + * + * Ticker + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetAsyncWithHttpInfo($stocks_ticker, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response'; + $request = $this->v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetRequest($stocks_ticker, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet' + * + * @param string $stocks_ticker Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGetRequest($stocks_ticker, string $contentType = self::contentTypes['v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet'][0]) + { + + // verify the required parameter 'stocks_ticker' is set + if ($stocks_ticker === null || (is_array($stocks_ticker) && count($stocks_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stocks_ticker when calling v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet' + ); + } + + + $resourcePath = '/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($stocks_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stocksTicker' . '}', + ObjectSerializer::toPathValue($stocks_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StockstradesApi.php b/lib/Api/StockstradesApi.php new file mode 100644 index 0000000..27bee60 --- /dev/null +++ b/lib/Api/StockstradesApi.php @@ -0,0 +1,976 @@ + [ + 'application/json', + ], + 'v2TicksStocksTradesTickerDateGet' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation trades + * + * Trades + * + * @param string $stock_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['trades'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\Trades200Response + */ + public function trades($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['trades'][0]) + { + list($response) = $this->tradesWithHttpInfo($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + return $response; + } + + /** + * Operation tradesWithHttpInfo + * + * Trades + * + * @param string $stock_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['trades'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\Trades200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function tradesWithHttpInfo($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['trades'][0]) + { + $request = $this->tradesRequest($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\Trades200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Trades200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Trades200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Trades200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\Trades200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation tradesAsync + * + * Trades + * + * @param string $stock_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['trades'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesAsync($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['trades'][0]) + { + return $this->tradesAsyncWithHttpInfo($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tradesAsyncWithHttpInfo + * + * Trades + * + * @param string $stock_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['trades'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tradesAsyncWithHttpInfo($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['trades'][0]) + { + $returnType = '\OpenAPI\Client\Model\Trades200Response'; + $request = $this->tradesRequest($stock_ticker, $timestamp, $timestamp_gte, $timestamp_gt, $timestamp_lte, $timestamp_lt, $order, $limit, $sort, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'trades' + * + * @param string $stock_ticker The ticker symbol to get trades for. (required) + * @param string $timestamp Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. (optional) + * @param string $timestamp_gte Range by timestamp. (optional) + * @param string $timestamp_gt Range by timestamp. (optional) + * @param string $timestamp_lte Range by timestamp. (optional) + * @param string $timestamp_lt Range by timestamp. (optional) + * @param string $order Order results based on the `sort` field. (optional, default to 'desc') + * @param int $limit Limit the number of results returned, default is 10 and max is 50000. (optional, default to 10) + * @param string $sort Sort field used for ordering. (optional, default to 'timestamp') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['trades'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tradesRequest($stock_ticker, $timestamp = null, $timestamp_gte = null, $timestamp_gt = null, $timestamp_lte = null, $timestamp_lt = null, $order = 'desc', $limit = 10, $sort = 'timestamp', string $contentType = self::contentTypes['trades'][0]) + { + + // verify the required parameter 'stock_ticker' is set + if ($stock_ticker === null || (is_array($stock_ticker) && count($stock_ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $stock_ticker when calling trades' + ); + } + + + + + + + + if ($limit !== null && $limit > 50000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StockstradesApi.trades, must be smaller than or equal to 50000.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StockstradesApi.trades, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v3/trades/{stockTicker}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gte, + 'timestamp.gte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_gt, + 'timestamp.gt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lte, + 'timestamp.lte', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_lt, + 'timestamp.lt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order, + 'order', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($stock_ticker !== null) { + $resourcePath = str_replace( + '{' . 'stockTicker' . '}', + ObjectSerializer::toPathValue($stock_ticker), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation v2TicksStocksTradesTickerDateGet + * + * Trades + * + * @param string $ticker The ticker symbol we want trades for. (required) + * @param \DateTime $date The date/day of the trades to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksTradesTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response + */ + public function v2TicksStocksTradesTickerDateGet($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksTradesTickerDateGet'][0]) + { + list($response) = $this->v2TicksStocksTradesTickerDateGetWithHttpInfo($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + return $response; + } + + /** + * Operation v2TicksStocksTradesTickerDateGetWithHttpInfo + * + * Trades + * + * @param string $ticker The ticker symbol we want trades for. (required) + * @param \DateTime $date The date/day of the trades to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksTradesTickerDateGet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function v2TicksStocksTradesTickerDateGetWithHttpInfo($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksTradesTickerDateGet'][0]) + { + $request = $this->v2TicksStocksTradesTickerDateGetRequest($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + + 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 + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + 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 ('\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation v2TicksStocksTradesTickerDateGetAsync + * + * Trades + * + * @param string $ticker The ticker symbol we want trades for. (required) + * @param \DateTime $date The date/day of the trades to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksTradesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2TicksStocksTradesTickerDateGetAsync($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksTradesTickerDateGet'][0]) + { + return $this->v2TicksStocksTradesTickerDateGetAsyncWithHttpInfo($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation v2TicksStocksTradesTickerDateGetAsyncWithHttpInfo + * + * Trades + * + * @param string $ticker The ticker symbol we want trades for. (required) + * @param \DateTime $date The date/day of the trades to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksTradesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function v2TicksStocksTradesTickerDateGetAsyncWithHttpInfo($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksTradesTickerDateGet'][0]) + { + $returnType = '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200Response'; + $request = $this->v2TicksStocksTradesTickerDateGetRequest($ticker, $date, $timestamp, $timestamp_limit, $reverse, $limit, $contentType); + + 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(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + 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 'v2TicksStocksTradesTickerDateGet' + * + * @param string $ticker The ticker symbol we want trades for. (required) + * @param \DateTime $date The date/day of the trades to retrieve in the format YYYY-MM-DD. (required) + * @param int $timestamp The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results. (optional) + * @param int $timestamp_limit The maximum timestamp allowed in the results. (optional) + * @param bool $reverse Reverse the order of the results. (optional) + * @param int $limit Limit the size of the response, max 50000 and default 5000. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v2TicksStocksTradesTickerDateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function v2TicksStocksTradesTickerDateGetRequest($ticker, $date, $timestamp = null, $timestamp_limit = null, $reverse = null, $limit = null, string $contentType = self::contentTypes['v2TicksStocksTradesTickerDateGet'][0]) + { + + // verify the required parameter 'ticker' is set + if ($ticker === null || (is_array($ticker) && count($ticker) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ticker when calling v2TicksStocksTradesTickerDateGet' + ); + } + + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling v2TicksStocksTradesTickerDateGet' + ); + } + + + + + + + $resourcePath = '/v2/ticks/stocks/trades/{ticker}/{date}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp, + 'timestamp', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_limit, + 'timestampLimit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $reverse, + 'reverse', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($ticker !== null) { + $resourcePath = str_replace( + '{' . 'ticker' . '}', + ObjectSerializer::toPathValue($ticker), + $resourcePath + ); + } + // path params + if ($date !== null) { + $resourcePath = str_replace( + '{' . 'date' . '}', + ObjectSerializer::toPathValue($date), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // 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 (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); + if ($apiKey !== null) { + $queryParams['apiKey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/ApiException.php b/lib/ApiException.php new file mode 100644 index 0000000..f3d94f1 --- /dev/null +++ b/lib/ApiException.php @@ -0,0 +1,119 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/lib/Configuration.php b/lib/Configuration.php new file mode 100644 index 0000000..e90eb6f --- /dev/null +++ b/lib/Configuration.php @@ -0,0 +1,535 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; + $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 .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "https://api.polygon.io", + "description" => "Polygon Platform API", + ], + [ + "url" => "https://api.staging.polygon.io", + "description" => "Polygon Platform API (Staging)", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + } + + $host = $hostSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php new file mode 100644 index 0000000..e088ee1 --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,245 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/lib/Model/AskExchangeId.php b/lib/Model/AskExchangeId.php new file mode 100644 index 0000000..66ec7d1 --- /dev/null +++ b/lib/Model/AskExchangeId.php @@ -0,0 +1,381 @@ + + */ +class AskExchangeId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AskExchangeId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/BidExchangeId.php b/lib/Model/BidExchangeId.php new file mode 100644 index 0000000..1169647 --- /dev/null +++ b/lib/Model/BidExchangeId.php @@ -0,0 +1,381 @@ + + */ +class BidExchangeId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BidExchangeId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Company.php b/lib/Model/Company.php new file mode 100644 index 0000000..b1711f0 --- /dev/null +++ b/lib/Model/Company.php @@ -0,0 +1,1327 @@ + + */ +class Company implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Company'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active' => 'bool', + 'bloomberg' => 'string', + 'ceo' => 'string', + 'cik' => 'string', + 'country' => 'string', + 'description' => 'string', + 'employees' => 'int', + 'exchange' => 'string', + 'exchange_symbol' => 'string', + 'figi' => 'string', + 'hq_address' => 'string', + 'hq_country' => 'string', + 'hq_state' => 'string', + 'industry' => 'string', + 'lei' => 'string', + 'listdate' => '\DateTime', + 'logo' => 'string', + 'marketcap' => 'int', + 'name' => 'string', + 'phone' => 'string', + 'sector' => 'string', + 'sic' => 'int', + 'similar' => 'string[]', + 'symbol' => 'string', + 'tags' => 'string[]', + 'type' => 'string', + 'updated' => '\DateTime', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active' => null, + 'bloomberg' => null, + 'ceo' => null, + 'cik' => null, + 'country' => null, + 'description' => null, + 'employees' => null, + 'exchange' => null, + 'exchange_symbol' => null, + 'figi' => null, + 'hq_address' => null, + 'hq_country' => null, + 'hq_state' => null, + 'industry' => null, + 'lei' => null, + 'listdate' => 'date', + 'logo' => null, + 'marketcap' => null, + 'name' => null, + 'phone' => null, + 'sector' => null, + 'sic' => null, + 'similar' => null, + 'symbol' => null, + 'tags' => null, + 'type' => null, + 'updated' => 'date', + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'active' => false, + 'bloomberg' => false, + 'ceo' => false, + 'cik' => false, + 'country' => false, + 'description' => false, + 'employees' => false, + 'exchange' => false, + 'exchange_symbol' => false, + 'figi' => false, + 'hq_address' => false, + 'hq_country' => false, + 'hq_state' => false, + 'industry' => false, + 'lei' => false, + 'listdate' => false, + 'logo' => false, + 'marketcap' => false, + 'name' => false, + 'phone' => false, + 'sector' => false, + 'sic' => false, + 'similar' => false, + 'symbol' => false, + 'tags' => false, + 'type' => false, + 'updated' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'bloomberg' => 'bloomberg', + 'ceo' => 'ceo', + 'cik' => 'cik', + 'country' => 'country', + 'description' => 'description', + 'employees' => 'employees', + 'exchange' => 'exchange', + 'exchange_symbol' => 'exchangeSymbol', + 'figi' => 'figi', + 'hq_address' => 'hq_address', + 'hq_country' => 'hq_country', + 'hq_state' => 'hq_state', + 'industry' => 'industry', + 'lei' => 'lei', + 'listdate' => 'listdate', + 'logo' => 'logo', + 'marketcap' => 'marketcap', + 'name' => 'name', + 'phone' => 'phone', + 'sector' => 'sector', + 'sic' => 'sic', + 'similar' => 'similar', + 'symbol' => 'symbol', + 'tags' => 'tags', + 'type' => 'type', + 'updated' => 'updated', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'bloomberg' => 'setBloomberg', + 'ceo' => 'setCeo', + 'cik' => 'setCik', + 'country' => 'setCountry', + 'description' => 'setDescription', + 'employees' => 'setEmployees', + 'exchange' => 'setExchange', + 'exchange_symbol' => 'setExchangeSymbol', + 'figi' => 'setFigi', + 'hq_address' => 'setHqAddress', + 'hq_country' => 'setHqCountry', + 'hq_state' => 'setHqState', + 'industry' => 'setIndustry', + 'lei' => 'setLei', + 'listdate' => 'setListdate', + 'logo' => 'setLogo', + 'marketcap' => 'setMarketcap', + 'name' => 'setName', + 'phone' => 'setPhone', + 'sector' => 'setSector', + 'sic' => 'setSic', + 'similar' => 'setSimilar', + 'symbol' => 'setSymbol', + 'tags' => 'setTags', + 'type' => 'setType', + 'updated' => 'setUpdated', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'bloomberg' => 'getBloomberg', + 'ceo' => 'getCeo', + 'cik' => 'getCik', + 'country' => 'getCountry', + 'description' => 'getDescription', + 'employees' => 'getEmployees', + 'exchange' => 'getExchange', + 'exchange_symbol' => 'getExchangeSymbol', + 'figi' => 'getFigi', + 'hq_address' => 'getHqAddress', + 'hq_country' => 'getHqCountry', + 'hq_state' => 'getHqState', + 'industry' => 'getIndustry', + 'lei' => 'getLei', + 'listdate' => 'getListdate', + 'logo' => 'getLogo', + 'marketcap' => 'getMarketcap', + 'name' => 'getName', + 'phone' => 'getPhone', + 'sector' => 'getSector', + 'sic' => 'getSic', + 'similar' => 'getSimilar', + 'symbol' => 'getSymbol', + 'tags' => 'getTags', + 'type' => 'getType', + 'updated' => 'getUpdated', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('bloomberg', $data ?? [], null); + $this->setIfExists('ceo', $data ?? [], null); + $this->setIfExists('cik', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('employees', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('exchange_symbol', $data ?? [], null); + $this->setIfExists('figi', $data ?? [], null); + $this->setIfExists('hq_address', $data ?? [], null); + $this->setIfExists('hq_country', $data ?? [], null); + $this->setIfExists('hq_state', $data ?? [], null); + $this->setIfExists('industry', $data ?? [], null); + $this->setIfExists('lei', $data ?? [], null); + $this->setIfExists('listdate', $data ?? [], null); + $this->setIfExists('logo', $data ?? [], null); + $this->setIfExists('marketcap', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('sector', $data ?? [], null); + $this->setIfExists('sic', $data ?? [], null); + $this->setIfExists('similar', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates if the security is actively listed. If false, this means the company is no longer listed and cannot be traded. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets bloomberg + * + * @return string|null + */ + public function getBloomberg() + { + return $this->container['bloomberg']; + } + + /** + * Sets bloomberg + * + * @param string|null $bloomberg The Bloomberg guid for the symbol. + * + * @return self + */ + public function setBloomberg($bloomberg) + { + if (is_null($bloomberg)) { + throw new \InvalidArgumentException('non-nullable bloomberg cannot be null'); + } + $this->container['bloomberg'] = $bloomberg; + + return $this; + } + + /** + * Gets ceo + * + * @return string|null + */ + public function getCeo() + { + return $this->container['ceo']; + } + + /** + * Sets ceo + * + * @param string|null $ceo The name of the company's current CEO. + * + * @return self + */ + public function setCeo($ceo) + { + if (is_null($ceo)) { + throw new \InvalidArgumentException('non-nullable ceo cannot be null'); + } + $this->container['ceo'] = $ceo; + + return $this; + } + + /** + * Gets cik + * + * @return string|null + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string|null $cik The official CIK guid used for SEC database/filings. + * + * @return self + */ + public function setCik($cik) + { + if (is_null($cik)) { + throw new \InvalidArgumentException('non-nullable cik cannot be null'); + } + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The country in which the company is registered. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the company and what they do/offer. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets employees + * + * @return int|null + */ + public function getEmployees() + { + return $this->container['employees']; + } + + /** + * Sets employees + * + * @param int|null $employees The approximate number of employees for the company. + * + * @return self + */ + public function setEmployees($employees) + { + if (is_null($employees)) { + throw new \InvalidArgumentException('non-nullable employees cannot be null'); + } + $this->container['employees'] = $employees; + + return $this; + } + + /** + * Gets exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange The symbol's primary exchange. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets exchange_symbol + * + * @return string|null + */ + public function getExchangeSymbol() + { + return $this->container['exchange_symbol']; + } + + /** + * Sets exchange_symbol + * + * @param string|null $exchange_symbol The exchange code (id) of the symbol's primary exchange. + * + * @return self + */ + public function setExchangeSymbol($exchange_symbol) + { + if (is_null($exchange_symbol)) { + throw new \InvalidArgumentException('non-nullable exchange_symbol cannot be null'); + } + $this->container['exchange_symbol'] = $exchange_symbol; + + return $this; + } + + /** + * Gets figi + * + * @return string|null + */ + public function getFigi() + { + return $this->container['figi']; + } + + /** + * Sets figi + * + * @param string|null $figi The OpenFigi project guid for the symbol. (https://openfigi.com/) + * + * @return self + */ + public function setFigi($figi) + { + if (is_null($figi)) { + throw new \InvalidArgumentException('non-nullable figi cannot be null'); + } + $this->container['figi'] = $figi; + + return $this; + } + + /** + * Gets hq_address + * + * @return string|null + */ + public function getHqAddress() + { + return $this->container['hq_address']; + } + + /** + * Sets hq_address + * + * @param string|null $hq_address The street address for the company's headquarters. + * + * @return self + */ + public function setHqAddress($hq_address) + { + if (is_null($hq_address)) { + throw new \InvalidArgumentException('non-nullable hq_address cannot be null'); + } + $this->container['hq_address'] = $hq_address; + + return $this; + } + + /** + * Gets hq_country + * + * @return string|null + */ + public function getHqCountry() + { + return $this->container['hq_country']; + } + + /** + * Sets hq_country + * + * @param string|null $hq_country The country in which the company's headquarters is located. + * + * @return self + */ + public function setHqCountry($hq_country) + { + if (is_null($hq_country)) { + throw new \InvalidArgumentException('non-nullable hq_country cannot be null'); + } + $this->container['hq_country'] = $hq_country; + + return $this; + } + + /** + * Gets hq_state + * + * @return string|null + */ + public function getHqState() + { + return $this->container['hq_state']; + } + + /** + * Sets hq_state + * + * @param string|null $hq_state The state in which the company's headquarters is located. + * + * @return self + */ + public function setHqState($hq_state) + { + if (is_null($hq_state)) { + throw new \InvalidArgumentException('non-nullable hq_state cannot be null'); + } + $this->container['hq_state'] = $hq_state; + + return $this; + } + + /** + * Gets industry + * + * @return string|null + */ + public function getIndustry() + { + return $this->container['industry']; + } + + /** + * Sets industry + * + * @param string|null $industry The industry in which the company operates. + * + * @return self + */ + public function setIndustry($industry) + { + if (is_null($industry)) { + throw new \InvalidArgumentException('non-nullable industry cannot be null'); + } + $this->container['industry'] = $industry; + + return $this; + } + + /** + * Gets lei + * + * @return string|null + */ + public function getLei() + { + return $this->container['lei']; + } + + /** + * Sets lei + * + * @param string|null $lei The Legal Entity Identifier (LEI) guid for the symbol. (https://en.wikipedia.org/wiki/Legal_Entity_Identifier) + * + * @return self + */ + public function setLei($lei) + { + if (is_null($lei)) { + throw new \InvalidArgumentException('non-nullable lei cannot be null'); + } + $this->container['lei'] = $lei; + + return $this; + } + + /** + * Gets listdate + * + * @return \DateTime|null + */ + public function getListdate() + { + return $this->container['listdate']; + } + + /** + * Sets listdate + * + * @param \DateTime|null $listdate The date that the symbol was listed on the exchange. + * + * @return self + */ + public function setListdate($listdate) + { + if (is_null($listdate)) { + throw new \InvalidArgumentException('non-nullable listdate cannot be null'); + } + $this->container['listdate'] = $listdate; + + return $this; + } + + /** + * Gets logo + * + * @return string|null + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string|null $logo The URL of the entity's logo. + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * Gets marketcap + * + * @return int|null + */ + public function getMarketcap() + { + return $this->container['marketcap']; + } + + /** + * Sets marketcap + * + * @param int|null $marketcap The current market cap for the company. + * + * @return self + */ + public function setMarketcap($marketcap) + { + if (is_null($marketcap)) { + throw new \InvalidArgumentException('non-nullable marketcap cannot be null'); + } + $this->container['marketcap'] = $marketcap; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the company/entity. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone The phone number for the company. This is usually a corporate contact number. + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets sector + * + * @return string|null + */ + public function getSector() + { + return $this->container['sector']; + } + + /** + * Sets sector + * + * @param string|null $sector The sector of the indsutry in which the symbol operates. + * + * @return self + */ + public function setSector($sector) + { + if (is_null($sector)) { + throw new \InvalidArgumentException('non-nullable sector cannot be null'); + } + $this->container['sector'] = $sector; + + return $this; + } + + /** + * Gets sic + * + * @return int|null + */ + public function getSic() + { + return $this->container['sic']; + } + + /** + * Sets sic + * + * @param int|null $sic Standard Industrial Classification (SIC) id for the symbol. (https://en.wikipedia.org/wiki/Legal_Entity_Identifier) + * + * @return self + */ + public function setSic($sic) + { + if (is_null($sic)) { + throw new \InvalidArgumentException('non-nullable sic cannot be null'); + } + $this->container['sic'] = $sic; + + return $this; + } + + /** + * Gets similar + * + * @return string[]|null + */ + public function getSimilar() + { + return $this->container['similar']; + } + + /** + * Sets similar + * + * @param string[]|null $similar A list of ticker symbols for similar companies. + * + * @return self + */ + public function setSimilar($similar) + { + if (is_null($similar)) { + throw new \InvalidArgumentException('non-nullable similar cannot be null'); + } + $this->container['similar'] = $similar; + + return $this; + } + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type or class of the security. (Full List of Ticker Types) + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets updated + * + * @return \DateTime|null + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param \DateTime|null $updated The last time this company record was updated. + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL of the company's website + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ConditionTypeMap.php b/lib/Model/ConditionTypeMap.php new file mode 100644 index 0000000..c2582e8 --- /dev/null +++ b/lib/Model/ConditionTypeMap.php @@ -0,0 +1,409 @@ + + */ +class ConditionTypeMap implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConditionTypeMap'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'condition' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'condition' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'condition' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'condition' => 'condition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'condition' => 'setCondition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'condition' => 'getCondition' + ]; + + /** + * 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->setIfExists('condition', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 condition + * + * @return string|null + */ + public function getCondition() + { + return $this->container['condition']; + } + + /** + * Sets condition + * + * @param string|null $condition Polygon.io's mapping for condition codes. For more information, see our Trade Conditions Glossary. + * + * @return self + */ + public function setCondition($condition) + { + if (is_null($condition)) { + throw new \InvalidArgumentException('non-nullable condition cannot be null'); + } + $this->container['condition'] = $condition; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoEMA200Response.php b/lib/Model/CryptoEMA200Response.php new file mode 100644 index 0000000..2d2692e --- /dev/null +++ b/lib/Model/CryptoEMA200Response.php @@ -0,0 +1,511 @@ + + */ +class CryptoEMA200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoEMA_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoEMA200ResponseResults.php b/lib/Model/CryptoEMA200ResponseResults.php new file mode 100644 index 0000000..30639ba --- /dev/null +++ b/lib/Model/CryptoEMA200ResponseResults.php @@ -0,0 +1,443 @@ + + */ +class CryptoEMA200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoEMA_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'underlying' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying', + 'values' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'underlying' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'underlying' => false, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'underlying' => 'underlying', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'underlying' => 'setUnderlying', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'underlying' => 'getUnderlying', + 'values' => 'getValues' + ]; + + /** + * 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->setIfExists('underlying', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 underlying + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null $underlying underlying + * + * @return self + */ + public function setUnderlying($underlying) + { + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + } + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets values + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoEMA200ResponseResultsUnderlying.php b/lib/Model/CryptoEMA200ResponseResultsUnderlying.php new file mode 100644 index 0000000..dd11b09 --- /dev/null +++ b/lib/Model/CryptoEMA200ResponseResultsUnderlying.php @@ -0,0 +1,443 @@ + + */ +class CryptoEMA200ResponseResultsUnderlying implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoEMA_200_response_results_underlying'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'aggregates' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlyingAggregatesInner[]', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'aggregates' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'aggregates' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'aggregates' => 'aggregates', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aggregates' => 'setAggregates', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aggregates' => 'getAggregates', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('aggregates', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 aggregates + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlyingAggregatesInner[]|null + */ + public function getAggregates() + { + return $this->container['aggregates']; + } + + /** + * Sets aggregates + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlyingAggregatesInner[]|null $aggregates aggregates + * + * @return self + */ + public function setAggregates($aggregates) + { + if (is_null($aggregates)) { + throw new \InvalidArgumentException('non-nullable aggregates cannot be null'); + } + $this->container['aggregates'] = $aggregates; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL which can be used to request the underlying aggregates used in this request. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.php b/lib/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.php new file mode 100644 index 0000000..bf86979 --- /dev/null +++ b/lib/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInner.php @@ -0,0 +1,705 @@ + + */ +class CryptoEMA200ResponseResultsUnderlyingAggregatesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoEMA_200_response_results_underlying_aggregates_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 'otc' => 'bool', + 't' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => null, + 'o' => 'float', + 'otc' => null, + 't' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 'otc' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 'otc' => 'otc', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 'otc' => 'setOtc', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 'otc' => 'getOtc', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets t + * + * @return float + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param float $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoEMA200ResponseResultsValuesInner.php b/lib/Model/CryptoEMA200ResponseResultsValuesInner.php new file mode 100644 index 0000000..9b5bf40 --- /dev/null +++ b/lib/Model/CryptoEMA200ResponseResultsValuesInner.php @@ -0,0 +1,443 @@ + + */ +class CryptoEMA200ResponseResultsValuesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoEMA_200_response_results_values_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'timestamp' => 'int', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'timestamp' => 'int64', + 'value' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'timestamp' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timestamp' => 'timestamp', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 timestamp + * + * @return int|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int|null $timestamp The Unix Msec timestamp from the last aggregate used in this calculation. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The indicator value for this period. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoExchangeInner.php b/lib/Model/CryptoExchangeInner.php new file mode 100644 index 0000000..481da28 --- /dev/null +++ b/lib/Model/CryptoExchangeInner.php @@ -0,0 +1,560 @@ + + */ +class CryptoExchangeInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoExchange_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'market' => 'string', + 'name' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'market' => null, + 'name' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'market' => false, + 'name' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'market' => 'market', + 'name' => 'name', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'market' => 'setMarket', + 'name' => 'setName', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'market' => 'getMarket', + 'name' => 'getName', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['market'] === null) { + $invalidProperties[] = "'market' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets market + * + * @return string + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string $market Market data type this exchange contains ( crypto only currently ) + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the exchange + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of exchange feed + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL of this exchange + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoGroupedResults.php b/lib/Model/CryptoGroupedResults.php new file mode 100644 index 0000000..2afd19c --- /dev/null +++ b/lib/Model/CryptoGroupedResults.php @@ -0,0 +1,409 @@ + + */ +class CryptoGroupedResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoGroupedResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoHistoricTrades.php b/lib/Model/CryptoHistoricTrades.php new file mode 100644 index 0000000..050916d --- /dev/null +++ b/lib/Model/CryptoHistoricTrades.php @@ -0,0 +1,560 @@ + + */ +class CryptoHistoricTrades implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoHistoricTrades'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\DateTime', + 'map' => 'object', + 'ms_latency' => 'int', + 'symbol' => 'string', + 'ticks' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => 'date', + 'map' => null, + 'ms_latency' => null, + 'symbol' => null, + 'ticks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'map' => false, + 'ms_latency' => false, + 'symbol' => false, + 'ticks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'map' => 'map', + 'ms_latency' => 'msLatency', + 'symbol' => 'symbol', + 'ticks' => 'ticks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'map' => 'setMap', + 'ms_latency' => 'setMsLatency', + 'symbol' => 'setSymbol', + 'ticks' => 'setTicks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'map' => 'getMap', + 'ms_latency' => 'getMsLatency', + 'symbol' => 'getSymbol', + 'ticks' => 'getTicks' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('map', $data ?? [], null); + $this->setIfExists('ms_latency', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('ticks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['map'] === null) { + $invalidProperties[] = "'map' can't be null"; + } + if ($this->container['ms_latency'] === null) { + $invalidProperties[] = "'ms_latency' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + if ($this->container['ticks'] === null) { + $invalidProperties[] = "'ticks' can't be null"; + } + 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 day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date that was evaluated from the request. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets map + * + * @return object + */ + public function getMap() + { + return $this->container['map']; + } + + /** + * Sets map + * + * @param object $map A map for shortened result keys. + * + * @return self + */ + public function setMap($map) + { + if (is_null($map)) { + throw new \InvalidArgumentException('non-nullable map cannot be null'); + } + $this->container['map'] = $map; + + return $this; + } + + /** + * Gets ms_latency + * + * @return int + */ + public function getMsLatency() + { + return $this->container['ms_latency']; + } + + /** + * Sets ms_latency + * + * @param int $ms_latency The milliseconds of latency for the query results. + * + * @return self + */ + public function setMsLatency($ms_latency) + { + if (is_null($ms_latency)) { + throw new \InvalidArgumentException('non-nullable ms_latency cannot be null'); + } + $this->container['ms_latency'] = $ms_latency; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets ticks + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getTicks() + { + return $this->container['ticks']; + } + + /** + * Sets ticks + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $ticks ticks + * + * @return self + */ + public function setTicks($ticks) + { + if (is_null($ticks)) { + throw new \InvalidArgumentException('non-nullable ticks cannot be null'); + } + $this->container['ticks'] = $ticks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoLastTrade.php b/lib/Model/CryptoLastTrade.php new file mode 100644 index 0000000..6bf352e --- /dev/null +++ b/lib/Model/CryptoLastTrade.php @@ -0,0 +1,446 @@ + + */ +class CryptoLastTrade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoLastTrade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'last' => '\OpenAPI\Client\Model\CryptoLastTradeLast', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'last' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last' => 'last', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last' => 'setLast', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last' => 'getLast', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 last + * + * @return \OpenAPI\Client\Model\CryptoLastTradeLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\CryptoLastTradeLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoLastTradeLast.php b/lib/Model/CryptoLastTradeLast.php new file mode 100644 index 0000000..7f3e9ff --- /dev/null +++ b/lib/Model/CryptoLastTradeLast.php @@ -0,0 +1,560 @@ + + */ +class CryptoLastTradeLast implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoLastTrade_last'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'exchange' => 'int', + 'price' => 'float', + 'size' => 'float', + 'timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null, + 'exchange' => null, + 'price' => 'double', + 'size' => 'double', + 'timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'exchange' => false, + 'price' => false, + 'size' => false, + 'timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'exchange' => 'exchange', + 'price' => 'price', + 'size' => 'size', + 'timestamp' => 'timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'exchange' => 'setExchange', + 'price' => 'setPrice', + 'size' => 'setSize', + 'timestamp' => 'setTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'exchange' => 'getExchange', + 'price' => 'getPrice', + 'size' => 'getSize', + 'timestamp' => 'getTimestamp' + ]; + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['conditions'] === null) { + $invalidProperties[] = "'conditions' can't be null"; + } + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + 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 conditions + * + * @return int[] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[] $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange that this crypto trade happened on. See Exchanges for a mapping of exchanges to IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoMACD200Response.php b/lib/Model/CryptoMACD200Response.php new file mode 100644 index 0000000..e3233aa --- /dev/null +++ b/lib/Model/CryptoMACD200Response.php @@ -0,0 +1,511 @@ + + */ +class CryptoMACD200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoMACD_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\CryptoMACD200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\CryptoMACD200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\CryptoMACD200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoMACD200ResponseResults.php b/lib/Model/CryptoMACD200ResponseResults.php new file mode 100644 index 0000000..7f4307a --- /dev/null +++ b/lib/Model/CryptoMACD200ResponseResults.php @@ -0,0 +1,443 @@ + + */ +class CryptoMACD200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoMACD_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'underlying' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying', + 'values' => '\OpenAPI\Client\Model\CryptoMACD200ResponseResultsValuesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'underlying' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'underlying' => false, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'underlying' => 'underlying', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'underlying' => 'setUnderlying', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'underlying' => 'getUnderlying', + 'values' => 'getValues' + ]; + + /** + * 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->setIfExists('underlying', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 underlying + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null $underlying underlying + * + * @return self + */ + public function setUnderlying($underlying) + { + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + } + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets values + * + * @return \OpenAPI\Client\Model\CryptoMACD200ResponseResultsValuesInner[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \OpenAPI\Client\Model\CryptoMACD200ResponseResultsValuesInner[]|null $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoMACD200ResponseResultsValuesInner.php b/lib/Model/CryptoMACD200ResponseResultsValuesInner.php new file mode 100644 index 0000000..14e64af --- /dev/null +++ b/lib/Model/CryptoMACD200ResponseResultsValuesInner.php @@ -0,0 +1,511 @@ + + */ +class CryptoMACD200ResponseResultsValuesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoMACD_200_response_results_values_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'histogram' => 'float', + 'signal' => 'float', + 'timestamp' => 'int', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'histogram' => 'float', + 'signal' => 'float', + 'timestamp' => 'int64', + 'value' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'histogram' => false, + 'signal' => false, + 'timestamp' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'histogram' => 'histogram', + 'signal' => 'signal', + 'timestamp' => 'timestamp', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'histogram' => 'setHistogram', + 'signal' => 'setSignal', + 'timestamp' => 'setTimestamp', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'histogram' => 'getHistogram', + 'signal' => 'getSignal', + 'timestamp' => 'getTimestamp', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('histogram', $data ?? [], null); + $this->setIfExists('signal', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 histogram + * + * @return float|null + */ + public function getHistogram() + { + return $this->container['histogram']; + } + + /** + * Sets histogram + * + * @param float|null $histogram The indicator value for this period. + * + * @return self + */ + public function setHistogram($histogram) + { + if (is_null($histogram)) { + throw new \InvalidArgumentException('non-nullable histogram cannot be null'); + } + $this->container['histogram'] = $histogram; + + return $this; + } + + /** + * Gets signal + * + * @return float|null + */ + public function getSignal() + { + return $this->container['signal']; + } + + /** + * Sets signal + * + * @param float|null $signal The indicator value for this period. + * + * @return self + */ + public function setSignal($signal) + { + if (is_null($signal)) { + throw new \InvalidArgumentException('non-nullable signal cannot be null'); + } + $this->container['signal'] = $signal; + + return $this; + } + + /** + * Gets timestamp + * + * @return int|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int|null $timestamp The Unix Msec timestamp from the last aggregate used in this calculation. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The indicator value for this period. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoOpenClose.php b/lib/Model/CryptoOpenClose.php new file mode 100644 index 0000000..ae2b128 --- /dev/null +++ b/lib/Model/CryptoOpenClose.php @@ -0,0 +1,634 @@ + + */ +class CryptoOpenClose implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoOpenClose'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'close' => 'float', + 'closing_trades' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]', + 'day' => '\DateTime', + 'is_utc' => 'bool', + 'open' => 'float', + 'open_trades' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'close' => 'double', + 'closing_trades' => null, + 'day' => 'date', + 'is_utc' => null, + 'open' => 'double', + 'open_trades' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'close' => false, + 'closing_trades' => false, + 'day' => false, + 'is_utc' => false, + 'open' => false, + 'open_trades' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'close' => 'close', + 'closing_trades' => 'closingTrades', + 'day' => 'day', + 'is_utc' => 'isUTC', + 'open' => 'open', + 'open_trades' => 'openTrades', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'close' => 'setClose', + 'closing_trades' => 'setClosingTrades', + 'day' => 'setDay', + 'is_utc' => 'setIsUtc', + 'open' => 'setOpen', + 'open_trades' => 'setOpenTrades', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'close' => 'getClose', + 'closing_trades' => 'getClosingTrades', + 'day' => 'getDay', + 'is_utc' => 'getIsUtc', + 'open' => 'getOpen', + 'open_trades' => 'getOpenTrades', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('closing_trades', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('is_utc', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('open_trades', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['closing_trades'] === null) { + $invalidProperties[] = "'closing_trades' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['is_utc'] === null) { + $invalidProperties[] = "'is_utc' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['open_trades'] === null) { + $invalidProperties[] = "'open_trades' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close price for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets closing_trades + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getClosingTrades() + { + return $this->container['closing_trades']; + } + + /** + * Sets closing_trades + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $closing_trades closing_trades + * + * @return self + */ + public function setClosingTrades($closing_trades) + { + if (is_null($closing_trades)) { + throw new \InvalidArgumentException('non-nullable closing_trades cannot be null'); + } + $this->container['closing_trades'] = $closing_trades; + + return $this; + } + + /** + * Gets day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date requested. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets is_utc + * + * @return bool + */ + public function getIsUtc() + { + return $this->container['is_utc']; + } + + /** + * Sets is_utc + * + * @param bool $is_utc Whether or not the timestamps are in UTC timezone. + * + * @return self + */ + public function setIsUtc($is_utc) + { + if (is_null($is_utc)) { + throw new \InvalidArgumentException('non-nullable is_utc cannot be null'); + } + $this->container['is_utc'] = $is_utc; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets open_trades + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getOpenTrades() + { + return $this->container['open_trades']; + } + + /** + * Sets open_trades + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $open_trades open_trades + * + * @return self + */ + public function setOpenTrades($open_trades) + { + if (is_null($open_trades)) { + throw new \InvalidArgumentException('non-nullable open_trades cannot be null'); + } + $this->container['open_trades'] = $open_trades; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoRSI200Response.php b/lib/Model/CryptoRSI200Response.php new file mode 100644 index 0000000..32626a4 --- /dev/null +++ b/lib/Model/CryptoRSI200Response.php @@ -0,0 +1,511 @@ + + */ +class CryptoRSI200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoRSI_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\CryptoRSI200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\CryptoRSI200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\CryptoRSI200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoRSI200ResponseResults.php b/lib/Model/CryptoRSI200ResponseResults.php new file mode 100644 index 0000000..c093688 --- /dev/null +++ b/lib/Model/CryptoRSI200ResponseResults.php @@ -0,0 +1,443 @@ + + */ +class CryptoRSI200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoRSI_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'underlying' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying', + 'values' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'underlying' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'underlying' => false, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'underlying' => 'underlying', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'underlying' => 'setUnderlying', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'underlying' => 'getUnderlying', + 'values' => 'getValues' + ]; + + /** + * 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->setIfExists('underlying', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 underlying + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null $underlying underlying + * + * @return self + */ + public function setUnderlying($underlying) + { + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + } + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets values + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSMA200Response.php b/lib/Model/CryptoSMA200Response.php new file mode 100644 index 0000000..10f6965 --- /dev/null +++ b/lib/Model/CryptoSMA200Response.php @@ -0,0 +1,511 @@ + + */ +class CryptoSMA200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSMA_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\CryptoSMA200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\CryptoSMA200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\CryptoSMA200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSMA200ResponseResults.php b/lib/Model/CryptoSMA200ResponseResults.php new file mode 100644 index 0000000..4bd339c --- /dev/null +++ b/lib/Model/CryptoSMA200ResponseResults.php @@ -0,0 +1,443 @@ + + */ +class CryptoSMA200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSMA_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'underlying' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying', + 'values' => '\OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'underlying' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'underlying' => false, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'underlying' => 'underlying', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'underlying' => 'setUnderlying', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'underlying' => 'getUnderlying', + 'values' => 'getValues' + ]; + + /** + * 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->setIfExists('underlying', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 underlying + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsUnderlying|null $underlying underlying + * + * @return self + */ + public function setUnderlying($underlying) + { + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + } + $this->container['underlying'] = $underlying; + + return $this; + } + + /** + * Gets values + * + * @return \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \OpenAPI\Client\Model\CryptoEMA200ResponseResultsValuesInner[]|null $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSnapshotMinute.php b/lib/Model/CryptoSnapshotMinute.php new file mode 100644 index 0000000..a136b6e --- /dev/null +++ b/lib/Model/CryptoSnapshotMinute.php @@ -0,0 +1,671 @@ + + */ +class CryptoSnapshotMinute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSnapshotMinute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSnapshotTicker.php b/lib/Model/CryptoSnapshotTicker.php new file mode 100644 index 0000000..48eb4e1 --- /dev/null +++ b/lib/Model/CryptoSnapshotTicker.php @@ -0,0 +1,409 @@ + + */ +class CryptoSnapshotTicker implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSnapshotTicker'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSnapshotTickerFullBook.php b/lib/Model/CryptoSnapshotTickerFullBook.php new file mode 100644 index 0000000..a9ca730 --- /dev/null +++ b/lib/Model/CryptoSnapshotTickerFullBook.php @@ -0,0 +1,409 @@ + + */ +class CryptoSnapshotTickerFullBook implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSnapshotTickerFullBook'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 data + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoSnapshotTickers.php b/lib/Model/CryptoSnapshotTickers.php new file mode 100644 index 0000000..344ce56 --- /dev/null +++ b/lib/Model/CryptoSnapshotTickers.php @@ -0,0 +1,409 @@ + + */ +class CryptoSnapshotTickers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoSnapshotTickers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/CryptoTick.php b/lib/Model/CryptoTick.php new file mode 100644 index 0000000..575c7e2 --- /dev/null +++ b/lib/Model/CryptoTick.php @@ -0,0 +1,597 @@ + + */ +class CryptoTick implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CryptoTick'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'int[]', + 'i' => 'string', + 'p' => 'float', + 's' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => 'double', + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return float + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float $s The size of a trade (also known as volume). + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange that this crypto trade happened on. See Exchanges for a mapping of exchanges to IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Date.php b/lib/Model/Date.php new file mode 100644 index 0000000..2ce8afc --- /dev/null +++ b/lib/Model/Date.php @@ -0,0 +1,381 @@ + + */ +class Date implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Date'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ExchangeInner.php b/lib/Model/ExchangeInner.php new file mode 100644 index 0000000..919705d --- /dev/null +++ b/lib/Model/ExchangeInner.php @@ -0,0 +1,613 @@ + + */ +class ExchangeInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Exchange_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'id' => 'float', + 'market' => 'string', + 'mic' => 'string', + 'name' => 'string', + 'tape' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'id' => null, + 'market' => null, + 'mic' => null, + 'name' => null, + 'tape' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'id' => false, + 'market' => false, + 'mic' => false, + 'name' => false, + 'tape' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'id' => 'id', + 'market' => 'market', + 'mic' => 'mic', + 'name' => 'name', + 'tape' => 'tape', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'id' => 'setId', + 'market' => 'setMarket', + 'mic' => 'setMic', + 'name' => 'setName', + 'tape' => 'setTape', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'id' => 'getId', + 'market' => 'getMarket', + 'mic' => 'getMic', + 'name' => 'getName', + 'tape' => 'getTape', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('code', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('mic', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tape', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code A unique identifier for the exchange internal to Polygon.io. This is not an industry code or ISO standard. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets id + * + * @return float|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param float|null $id The ID of the exchange. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets market + * + * @return string|null + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string|null $market The market data type that this exchange contains. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets mic + * + * @return string|null + */ + public function getMic() + { + return $this->container['mic']; + } + + /** + * Sets mic + * + * @param string|null $mic The Market Identification Code or MIC as defined in ISO 10383 (https://en.wikipedia.org/wiki/Market_Identifier_Code). + * + * @return self + */ + public function setMic($mic) + { + if (is_null($mic)) { + throw new \InvalidArgumentException('non-nullable mic cannot be null'); + } + $this->container['mic'] = $mic; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the exchange. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tape + * + * @return string|null + */ + public function getTape() + { + return $this->container['tape']; + } + + /** + * Sets tape + * + * @param string|null $tape The tape id of the exchange. + * + * @return self + */ + public function setTape($tape) + { + if (is_null($tape)) { + throw new \InvalidArgumentException('non-nullable tape cannot be null'); + } + $this->container['tape'] = $tape; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of exchange. - TRF = Trade Reporting Facility - exchange = Reporting exchange on the tape + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Financial.php b/lib/Model/Financial.php new file mode 100644 index 0000000..aaeb202 --- /dev/null +++ b/lib/Model/Financial.php @@ -0,0 +1,1132 @@ + + */ +class Financial implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Financial'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cash_change' => 'int', + 'cash_flow' => 'int', + 'cost_of_revenue' => 'int', + 'current_assets' => 'int', + 'current_cash' => 'int', + 'current_debt' => 'int', + 'gross_profit' => 'int', + 'net_income' => 'int', + 'operating_expense' => 'int', + 'operating_gains_losses' => 'float', + 'operating_income' => 'int', + 'operating_revenue' => 'int', + 'report_date' => '\DateTime', + 'report_date_str' => 'string', + 'research_and_development' => 'int', + 'shareholder_equity' => 'int', + 'symbol' => 'string', + 'total_assets' => 'int', + 'total_cash' => 'int', + 'total_debt' => 'int', + 'total_liabilities' => 'int', + 'total_revenue' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cash_change' => null, + 'cash_flow' => null, + 'cost_of_revenue' => null, + 'current_assets' => null, + 'current_cash' => null, + 'current_debt' => null, + 'gross_profit' => null, + 'net_income' => null, + 'operating_expense' => null, + 'operating_gains_losses' => null, + 'operating_income' => null, + 'operating_revenue' => null, + 'report_date' => 'date-time', + 'report_date_str' => null, + 'research_and_development' => null, + 'shareholder_equity' => null, + 'symbol' => null, + 'total_assets' => null, + 'total_cash' => null, + 'total_debt' => null, + 'total_liabilities' => null, + 'total_revenue' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cash_change' => false, + 'cash_flow' => false, + 'cost_of_revenue' => false, + 'current_assets' => false, + 'current_cash' => false, + 'current_debt' => false, + 'gross_profit' => false, + 'net_income' => false, + 'operating_expense' => false, + 'operating_gains_losses' => false, + 'operating_income' => false, + 'operating_revenue' => false, + 'report_date' => false, + 'report_date_str' => false, + 'research_and_development' => false, + 'shareholder_equity' => false, + 'symbol' => false, + 'total_assets' => false, + 'total_cash' => false, + 'total_debt' => false, + 'total_liabilities' => false, + 'total_revenue' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cash_change' => 'cashChange', + 'cash_flow' => 'cashFlow', + 'cost_of_revenue' => 'costOfRevenue', + 'current_assets' => 'currentAssets', + 'current_cash' => 'currentCash', + 'current_debt' => 'currentDebt', + 'gross_profit' => 'grossProfit', + 'net_income' => 'netIncome', + 'operating_expense' => 'operatingExpense', + 'operating_gains_losses' => 'operatingGainsLosses', + 'operating_income' => 'operatingIncome', + 'operating_revenue' => 'operatingRevenue', + 'report_date' => 'reportDate', + 'report_date_str' => 'reportDateStr', + 'research_and_development' => 'researchAndDevelopment', + 'shareholder_equity' => 'shareholderEquity', + 'symbol' => 'symbol', + 'total_assets' => 'totalAssets', + 'total_cash' => 'totalCash', + 'total_debt' => 'totalDebt', + 'total_liabilities' => 'totalLiabilities', + 'total_revenue' => 'totalRevenue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cash_change' => 'setCashChange', + 'cash_flow' => 'setCashFlow', + 'cost_of_revenue' => 'setCostOfRevenue', + 'current_assets' => 'setCurrentAssets', + 'current_cash' => 'setCurrentCash', + 'current_debt' => 'setCurrentDebt', + 'gross_profit' => 'setGrossProfit', + 'net_income' => 'setNetIncome', + 'operating_expense' => 'setOperatingExpense', + 'operating_gains_losses' => 'setOperatingGainsLosses', + 'operating_income' => 'setOperatingIncome', + 'operating_revenue' => 'setOperatingRevenue', + 'report_date' => 'setReportDate', + 'report_date_str' => 'setReportDateStr', + 'research_and_development' => 'setResearchAndDevelopment', + 'shareholder_equity' => 'setShareholderEquity', + 'symbol' => 'setSymbol', + 'total_assets' => 'setTotalAssets', + 'total_cash' => 'setTotalCash', + 'total_debt' => 'setTotalDebt', + 'total_liabilities' => 'setTotalLiabilities', + 'total_revenue' => 'setTotalRevenue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cash_change' => 'getCashChange', + 'cash_flow' => 'getCashFlow', + 'cost_of_revenue' => 'getCostOfRevenue', + 'current_assets' => 'getCurrentAssets', + 'current_cash' => 'getCurrentCash', + 'current_debt' => 'getCurrentDebt', + 'gross_profit' => 'getGrossProfit', + 'net_income' => 'getNetIncome', + 'operating_expense' => 'getOperatingExpense', + 'operating_gains_losses' => 'getOperatingGainsLosses', + 'operating_income' => 'getOperatingIncome', + 'operating_revenue' => 'getOperatingRevenue', + 'report_date' => 'getReportDate', + 'report_date_str' => 'getReportDateStr', + 'research_and_development' => 'getResearchAndDevelopment', + 'shareholder_equity' => 'getShareholderEquity', + 'symbol' => 'getSymbol', + 'total_assets' => 'getTotalAssets', + 'total_cash' => 'getTotalCash', + 'total_debt' => 'getTotalDebt', + 'total_liabilities' => 'getTotalLiabilities', + 'total_revenue' => 'getTotalRevenue' + ]; + + /** + * 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->setIfExists('cash_change', $data ?? [], null); + $this->setIfExists('cash_flow', $data ?? [], null); + $this->setIfExists('cost_of_revenue', $data ?? [], null); + $this->setIfExists('current_assets', $data ?? [], null); + $this->setIfExists('current_cash', $data ?? [], null); + $this->setIfExists('current_debt', $data ?? [], null); + $this->setIfExists('gross_profit', $data ?? [], null); + $this->setIfExists('net_income', $data ?? [], null); + $this->setIfExists('operating_expense', $data ?? [], null); + $this->setIfExists('operating_gains_losses', $data ?? [], null); + $this->setIfExists('operating_income', $data ?? [], null); + $this->setIfExists('operating_revenue', $data ?? [], null); + $this->setIfExists('report_date', $data ?? [], null); + $this->setIfExists('report_date_str', $data ?? [], null); + $this->setIfExists('research_and_development', $data ?? [], null); + $this->setIfExists('shareholder_equity', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('total_assets', $data ?? [], null); + $this->setIfExists('total_cash', $data ?? [], null); + $this->setIfExists('total_debt', $data ?? [], null); + $this->setIfExists('total_liabilities', $data ?? [], null); + $this->setIfExists('total_revenue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['report_date'] === null) { + $invalidProperties[] = "'report_date' can't be null"; + } + if ($this->container['report_date_str'] === null) { + $invalidProperties[] = "'report_date_str' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 cash_change + * + * @return int|null + */ + public function getCashChange() + { + return $this->container['cash_change']; + } + + /** + * Sets cash_change + * + * @param int|null $cash_change cash_change + * + * @return self + */ + public function setCashChange($cash_change) + { + if (is_null($cash_change)) { + throw new \InvalidArgumentException('non-nullable cash_change cannot be null'); + } + $this->container['cash_change'] = $cash_change; + + return $this; + } + + /** + * Gets cash_flow + * + * @return int|null + */ + public function getCashFlow() + { + return $this->container['cash_flow']; + } + + /** + * Sets cash_flow + * + * @param int|null $cash_flow cash_flow + * + * @return self + */ + public function setCashFlow($cash_flow) + { + if (is_null($cash_flow)) { + throw new \InvalidArgumentException('non-nullable cash_flow cannot be null'); + } + $this->container['cash_flow'] = $cash_flow; + + return $this; + } + + /** + * Gets cost_of_revenue + * + * @return int|null + */ + public function getCostOfRevenue() + { + return $this->container['cost_of_revenue']; + } + + /** + * Sets cost_of_revenue + * + * @param int|null $cost_of_revenue cost_of_revenue + * + * @return self + */ + public function setCostOfRevenue($cost_of_revenue) + { + if (is_null($cost_of_revenue)) { + throw new \InvalidArgumentException('non-nullable cost_of_revenue cannot be null'); + } + $this->container['cost_of_revenue'] = $cost_of_revenue; + + return $this; + } + + /** + * Gets current_assets + * + * @return int|null + */ + public function getCurrentAssets() + { + return $this->container['current_assets']; + } + + /** + * Sets current_assets + * + * @param int|null $current_assets current_assets + * + * @return self + */ + public function setCurrentAssets($current_assets) + { + if (is_null($current_assets)) { + throw new \InvalidArgumentException('non-nullable current_assets cannot be null'); + } + $this->container['current_assets'] = $current_assets; + + return $this; + } + + /** + * Gets current_cash + * + * @return int|null + */ + public function getCurrentCash() + { + return $this->container['current_cash']; + } + + /** + * Sets current_cash + * + * @param int|null $current_cash current_cash + * + * @return self + */ + public function setCurrentCash($current_cash) + { + if (is_null($current_cash)) { + throw new \InvalidArgumentException('non-nullable current_cash cannot be null'); + } + $this->container['current_cash'] = $current_cash; + + return $this; + } + + /** + * Gets current_debt + * + * @return int|null + */ + public function getCurrentDebt() + { + return $this->container['current_debt']; + } + + /** + * Sets current_debt + * + * @param int|null $current_debt current_debt + * + * @return self + */ + public function setCurrentDebt($current_debt) + { + if (is_null($current_debt)) { + throw new \InvalidArgumentException('non-nullable current_debt cannot be null'); + } + $this->container['current_debt'] = $current_debt; + + return $this; + } + + /** + * Gets gross_profit + * + * @return int|null + */ + public function getGrossProfit() + { + return $this->container['gross_profit']; + } + + /** + * Sets gross_profit + * + * @param int|null $gross_profit gross_profit + * + * @return self + */ + public function setGrossProfit($gross_profit) + { + if (is_null($gross_profit)) { + throw new \InvalidArgumentException('non-nullable gross_profit cannot be null'); + } + $this->container['gross_profit'] = $gross_profit; + + return $this; + } + + /** + * Gets net_income + * + * @return int|null + */ + public function getNetIncome() + { + return $this->container['net_income']; + } + + /** + * Sets net_income + * + * @param int|null $net_income net_income + * + * @return self + */ + public function setNetIncome($net_income) + { + if (is_null($net_income)) { + throw new \InvalidArgumentException('non-nullable net_income cannot be null'); + } + $this->container['net_income'] = $net_income; + + return $this; + } + + /** + * Gets operating_expense + * + * @return int|null + */ + public function getOperatingExpense() + { + return $this->container['operating_expense']; + } + + /** + * Sets operating_expense + * + * @param int|null $operating_expense operating_expense + * + * @return self + */ + public function setOperatingExpense($operating_expense) + { + if (is_null($operating_expense)) { + throw new \InvalidArgumentException('non-nullable operating_expense cannot be null'); + } + $this->container['operating_expense'] = $operating_expense; + + return $this; + } + + /** + * Gets operating_gains_losses + * + * @return float|null + */ + public function getOperatingGainsLosses() + { + return $this->container['operating_gains_losses']; + } + + /** + * Sets operating_gains_losses + * + * @param float|null $operating_gains_losses operating_gains_losses + * + * @return self + */ + public function setOperatingGainsLosses($operating_gains_losses) + { + if (is_null($operating_gains_losses)) { + throw new \InvalidArgumentException('non-nullable operating_gains_losses cannot be null'); + } + $this->container['operating_gains_losses'] = $operating_gains_losses; + + return $this; + } + + /** + * Gets operating_income + * + * @return int|null + */ + public function getOperatingIncome() + { + return $this->container['operating_income']; + } + + /** + * Sets operating_income + * + * @param int|null $operating_income operating_income + * + * @return self + */ + public function setOperatingIncome($operating_income) + { + if (is_null($operating_income)) { + throw new \InvalidArgumentException('non-nullable operating_income cannot be null'); + } + $this->container['operating_income'] = $operating_income; + + return $this; + } + + /** + * Gets operating_revenue + * + * @return int|null + */ + public function getOperatingRevenue() + { + return $this->container['operating_revenue']; + } + + /** + * Sets operating_revenue + * + * @param int|null $operating_revenue operating_revenue + * + * @return self + */ + public function setOperatingRevenue($operating_revenue) + { + if (is_null($operating_revenue)) { + throw new \InvalidArgumentException('non-nullable operating_revenue cannot be null'); + } + $this->container['operating_revenue'] = $operating_revenue; + + return $this; + } + + /** + * Gets report_date + * + * @return \DateTime + */ + public function getReportDate() + { + return $this->container['report_date']; + } + + /** + * Sets report_date + * + * @param \DateTime $report_date Report Date + * + * @return self + */ + public function setReportDate($report_date) + { + if (is_null($report_date)) { + throw new \InvalidArgumentException('non-nullable report_date cannot be null'); + } + $this->container['report_date'] = $report_date; + + return $this; + } + + /** + * Gets report_date_str + * + * @return string + */ + public function getReportDateStr() + { + return $this->container['report_date_str']; + } + + /** + * Sets report_date_str + * + * @param string $report_date_str Report date as non date format + * + * @return self + */ + public function setReportDateStr($report_date_str) + { + if (is_null($report_date_str)) { + throw new \InvalidArgumentException('non-nullable report_date_str cannot be null'); + } + $this->container['report_date_str'] = $report_date_str; + + return $this; + } + + /** + * Gets research_and_development + * + * @return int|null + */ + public function getResearchAndDevelopment() + { + return $this->container['research_and_development']; + } + + /** + * Sets research_and_development + * + * @param int|null $research_and_development research_and_development + * + * @return self + */ + public function setResearchAndDevelopment($research_and_development) + { + if (is_null($research_and_development)) { + throw new \InvalidArgumentException('non-nullable research_and_development cannot be null'); + } + $this->container['research_and_development'] = $research_and_development; + + return $this; + } + + /** + * Gets shareholder_equity + * + * @return int|null + */ + public function getShareholderEquity() + { + return $this->container['shareholder_equity']; + } + + /** + * Sets shareholder_equity + * + * @param int|null $shareholder_equity shareholder_equity + * + * @return self + */ + public function setShareholderEquity($shareholder_equity) + { + if (is_null($shareholder_equity)) { + throw new \InvalidArgumentException('non-nullable shareholder_equity cannot be null'); + } + $this->container['shareholder_equity'] = $shareholder_equity; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol Stock Symbol + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets total_assets + * + * @return int|null + */ + public function getTotalAssets() + { + return $this->container['total_assets']; + } + + /** + * Sets total_assets + * + * @param int|null $total_assets total_assets + * + * @return self + */ + public function setTotalAssets($total_assets) + { + if (is_null($total_assets)) { + throw new \InvalidArgumentException('non-nullable total_assets cannot be null'); + } + $this->container['total_assets'] = $total_assets; + + return $this; + } + + /** + * Gets total_cash + * + * @return int|null + */ + public function getTotalCash() + { + return $this->container['total_cash']; + } + + /** + * Sets total_cash + * + * @param int|null $total_cash total_cash + * + * @return self + */ + public function setTotalCash($total_cash) + { + if (is_null($total_cash)) { + throw new \InvalidArgumentException('non-nullable total_cash cannot be null'); + } + $this->container['total_cash'] = $total_cash; + + return $this; + } + + /** + * Gets total_debt + * + * @return int|null + */ + public function getTotalDebt() + { + return $this->container['total_debt']; + } + + /** + * Sets total_debt + * + * @param int|null $total_debt total_debt + * + * @return self + */ + public function setTotalDebt($total_debt) + { + if (is_null($total_debt)) { + throw new \InvalidArgumentException('non-nullable total_debt cannot be null'); + } + $this->container['total_debt'] = $total_debt; + + return $this; + } + + /** + * Gets total_liabilities + * + * @return int|null + */ + public function getTotalLiabilities() + { + return $this->container['total_liabilities']; + } + + /** + * Sets total_liabilities + * + * @param int|null $total_liabilities total_liabilities + * + * @return self + */ + public function setTotalLiabilities($total_liabilities) + { + if (is_null($total_liabilities)) { + throw new \InvalidArgumentException('non-nullable total_liabilities cannot be null'); + } + $this->container['total_liabilities'] = $total_liabilities; + + return $this; + } + + /** + * Gets total_revenue + * + * @return int|null + */ + public function getTotalRevenue() + { + return $this->container['total_revenue']; + } + + /** + * Sets total_revenue + * + * @param int|null $total_revenue total_revenue + * + * @return self + */ + public function setTotalRevenue($total_revenue) + { + if (is_null($total_revenue)) { + throw new \InvalidArgumentException('non-nullable total_revenue cannot be null'); + } + $this->container['total_revenue'] = $total_revenue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Financials.php b/lib/Model/Financials.php new file mode 100644 index 0000000..9412bf0 --- /dev/null +++ b/lib/Model/Financials.php @@ -0,0 +1,4161 @@ + + */ +class Financials implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Financials'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ebitda_margin' => 'float', + 'accumulated_other_comprehensive_income' => 'int', + 'accumulated_retained_earnings_deficit' => 'int', + 'asset_turnover' => 'int', + 'assets' => 'int', + 'assets_average' => 'int', + 'assets_current' => 'int', + 'assets_non_current' => 'int', + 'average_equity' => 'int', + 'book_value_per_share' => 'float', + 'calendar_date' => '\DateTime', + 'capital_expenditure' => 'int', + 'cash_and_equivalents' => 'int', + 'cash_and_equivalents_usd' => 'int', + 'consolidated_income' => 'int', + 'cost_of_revenue' => 'int', + 'current_liabilities' => 'int', + 'current_ratio' => 'float', + 'debt' => 'int', + 'debt_current' => 'int', + 'debt_non_current' => 'int', + 'debt_to_equity_ratio' => 'float', + 'debt_usd' => 'int', + 'deferred_revenue' => 'int', + 'deposits' => 'int', + 'depreciation_amortization_and_accretion' => 'int', + 'dividend_yield' => 'int', + 'dividends_per_basic_common_share' => 'int', + 'earning_before_interest_taxes' => 'int', + 'earning_before_interest_taxes_usd' => 'int', + 'earnings_before_interest_taxes_depreciation_amortization' => 'int', + 'earnings_before_interest_taxes_depreciation_amortization_usd' => 'int', + 'earnings_before_tax' => 'int', + 'earnings_per_basic_share' => 'float', + 'earnings_per_basic_share_usd' => 'float', + 'earnings_per_diluted_share' => 'float', + 'effect_of_exchange_rate_changes_on_cash' => 'int', + 'enterprise_value' => 'int', + 'enterprise_value_over_ebit' => 'int', + 'enterprise_value_over_ebitda' => 'float', + 'foreign_currency_usd_exchange_rate' => 'int', + 'free_cash_flow' => 'int', + 'free_cash_flow_per_share' => 'float', + 'goodwill_and_intangible_assets' => 'int', + 'gross_margin' => 'float', + 'gross_profit' => 'int', + 'income_tax_expense' => 'int', + 'interest_expense' => 'int', + 'inventory' => 'int', + 'invested_capital' => 'int', + 'invested_capital_average' => 'int', + 'investments' => 'int', + 'investments_current' => 'int', + 'investments_non_current' => 'int', + 'issuance_debt_securities' => 'int', + 'issuance_equity_shares' => 'int', + 'liabilities_non_current' => 'int', + 'market_capitalization' => 'int', + 'net_cash_flow' => 'int', + 'net_cash_flow_business_acquisitions_disposals' => 'int', + 'net_cash_flow_from_financing' => 'int', + 'net_cash_flow_from_investing' => 'int', + 'net_cash_flow_from_operations' => 'int', + 'net_cash_flow_investment_acquisitions_disposals' => 'int', + 'net_income' => 'int', + 'net_income_common_stock' => 'int', + 'net_income_common_stock_usd' => 'int', + 'net_income_to_non_controlling_interests' => 'int', + 'net_loss_income_from_discontinued_operations' => 'int', + 'operating_expenses' => 'int', + 'operating_income' => 'int', + 'payment_dividends_other_cash_distributions' => 'int', + 'payout_ratio' => 'int', + 'period' => 'string', + 'preferred_dividends_income_statement_impact' => 'int', + 'price_earnings' => 'float', + 'price_sales' => 'float', + 'price_to_book_value' => 'float', + 'price_to_earnings_ratio' => 'float', + 'price_to_sales_ratio' => 'float', + 'profit_margin' => 'float', + 'property_plant_equipment_net' => 'int', + 'report_period' => '\DateTime', + 'research_and_development_expense' => 'int', + 'return_on_average_assets' => 'int', + 'return_on_average_equity' => 'int', + 'return_on_invested_capital' => 'int', + 'return_on_sales' => 'float', + 'revenues' => 'int', + 'revenues_usd' => 'int', + 'sales_per_share' => 'float', + 'selling_general_and_administrative_expense' => 'int', + 'share_based_compensation' => 'int', + 'share_factor' => 'int', + 'share_price_adjusted_close' => 'float', + 'shareholders_equity' => 'int', + 'shareholders_equity_usd' => 'int', + 'shares' => 'int', + 'tangible_asset_value' => 'int', + 'tangible_assets_book_value_per_share' => 'float', + 'tax_assets' => 'int', + 'tax_liabilities' => 'int', + 'ticker' => 'string', + 'total_liabilities' => 'int', + 'trade_and_non_trade_payables' => 'int', + 'trade_and_non_trade_receivables' => 'int', + 'updated' => '\DateTime', + 'weighted_average_shares' => 'int', + 'weighted_average_shares_diluted' => 'int', + 'working_capital' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ebitda_margin' => 'double', + 'accumulated_other_comprehensive_income' => null, + 'accumulated_retained_earnings_deficit' => null, + 'asset_turnover' => null, + 'assets' => null, + 'assets_average' => null, + 'assets_current' => null, + 'assets_non_current' => null, + 'average_equity' => null, + 'book_value_per_share' => 'double', + 'calendar_date' => 'date-time', + 'capital_expenditure' => null, + 'cash_and_equivalents' => null, + 'cash_and_equivalents_usd' => null, + 'consolidated_income' => null, + 'cost_of_revenue' => null, + 'current_liabilities' => null, + 'current_ratio' => 'double', + 'debt' => null, + 'debt_current' => null, + 'debt_non_current' => null, + 'debt_to_equity_ratio' => 'double', + 'debt_usd' => null, + 'deferred_revenue' => null, + 'deposits' => null, + 'depreciation_amortization_and_accretion' => null, + 'dividend_yield' => null, + 'dividends_per_basic_common_share' => null, + 'earning_before_interest_taxes' => null, + 'earning_before_interest_taxes_usd' => null, + 'earnings_before_interest_taxes_depreciation_amortization' => null, + 'earnings_before_interest_taxes_depreciation_amortization_usd' => null, + 'earnings_before_tax' => null, + 'earnings_per_basic_share' => 'double', + 'earnings_per_basic_share_usd' => 'double', + 'earnings_per_diluted_share' => 'double', + 'effect_of_exchange_rate_changes_on_cash' => null, + 'enterprise_value' => null, + 'enterprise_value_over_ebit' => null, + 'enterprise_value_over_ebitda' => 'double', + 'foreign_currency_usd_exchange_rate' => null, + 'free_cash_flow' => null, + 'free_cash_flow_per_share' => 'double', + 'goodwill_and_intangible_assets' => null, + 'gross_margin' => 'double', + 'gross_profit' => null, + 'income_tax_expense' => null, + 'interest_expense' => null, + 'inventory' => null, + 'invested_capital' => null, + 'invested_capital_average' => null, + 'investments' => null, + 'investments_current' => null, + 'investments_non_current' => null, + 'issuance_debt_securities' => null, + 'issuance_equity_shares' => null, + 'liabilities_non_current' => null, + 'market_capitalization' => null, + 'net_cash_flow' => null, + 'net_cash_flow_business_acquisitions_disposals' => null, + 'net_cash_flow_from_financing' => null, + 'net_cash_flow_from_investing' => null, + 'net_cash_flow_from_operations' => null, + 'net_cash_flow_investment_acquisitions_disposals' => null, + 'net_income' => null, + 'net_income_common_stock' => null, + 'net_income_common_stock_usd' => null, + 'net_income_to_non_controlling_interests' => null, + 'net_loss_income_from_discontinued_operations' => null, + 'operating_expenses' => null, + 'operating_income' => null, + 'payment_dividends_other_cash_distributions' => null, + 'payout_ratio' => null, + 'period' => null, + 'preferred_dividends_income_statement_impact' => null, + 'price_earnings' => 'double', + 'price_sales' => 'double', + 'price_to_book_value' => 'double', + 'price_to_earnings_ratio' => 'double', + 'price_to_sales_ratio' => 'double', + 'profit_margin' => 'double', + 'property_plant_equipment_net' => null, + 'report_period' => 'date-time', + 'research_and_development_expense' => null, + 'return_on_average_assets' => null, + 'return_on_average_equity' => null, + 'return_on_invested_capital' => null, + 'return_on_sales' => 'double', + 'revenues' => null, + 'revenues_usd' => null, + 'sales_per_share' => 'double', + 'selling_general_and_administrative_expense' => null, + 'share_based_compensation' => null, + 'share_factor' => null, + 'share_price_adjusted_close' => 'double', + 'shareholders_equity' => null, + 'shareholders_equity_usd' => null, + 'shares' => null, + 'tangible_asset_value' => null, + 'tangible_assets_book_value_per_share' => 'double', + 'tax_assets' => null, + 'tax_liabilities' => null, + 'ticker' => null, + 'total_liabilities' => null, + 'trade_and_non_trade_payables' => null, + 'trade_and_non_trade_receivables' => null, + 'updated' => 'date-time', + 'weighted_average_shares' => null, + 'weighted_average_shares_diluted' => null, + 'working_capital' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ebitda_margin' => false, + 'accumulated_other_comprehensive_income' => false, + 'accumulated_retained_earnings_deficit' => false, + 'asset_turnover' => false, + 'assets' => false, + 'assets_average' => false, + 'assets_current' => false, + 'assets_non_current' => false, + 'average_equity' => false, + 'book_value_per_share' => false, + 'calendar_date' => false, + 'capital_expenditure' => false, + 'cash_and_equivalents' => false, + 'cash_and_equivalents_usd' => false, + 'consolidated_income' => false, + 'cost_of_revenue' => false, + 'current_liabilities' => false, + 'current_ratio' => false, + 'debt' => false, + 'debt_current' => false, + 'debt_non_current' => false, + 'debt_to_equity_ratio' => false, + 'debt_usd' => false, + 'deferred_revenue' => false, + 'deposits' => false, + 'depreciation_amortization_and_accretion' => false, + 'dividend_yield' => false, + 'dividends_per_basic_common_share' => false, + 'earning_before_interest_taxes' => false, + 'earning_before_interest_taxes_usd' => false, + 'earnings_before_interest_taxes_depreciation_amortization' => false, + 'earnings_before_interest_taxes_depreciation_amortization_usd' => false, + 'earnings_before_tax' => false, + 'earnings_per_basic_share' => false, + 'earnings_per_basic_share_usd' => false, + 'earnings_per_diluted_share' => false, + 'effect_of_exchange_rate_changes_on_cash' => false, + 'enterprise_value' => false, + 'enterprise_value_over_ebit' => false, + 'enterprise_value_over_ebitda' => false, + 'foreign_currency_usd_exchange_rate' => false, + 'free_cash_flow' => false, + 'free_cash_flow_per_share' => false, + 'goodwill_and_intangible_assets' => false, + 'gross_margin' => false, + 'gross_profit' => false, + 'income_tax_expense' => false, + 'interest_expense' => false, + 'inventory' => false, + 'invested_capital' => false, + 'invested_capital_average' => false, + 'investments' => false, + 'investments_current' => false, + 'investments_non_current' => false, + 'issuance_debt_securities' => false, + 'issuance_equity_shares' => false, + 'liabilities_non_current' => false, + 'market_capitalization' => false, + 'net_cash_flow' => false, + 'net_cash_flow_business_acquisitions_disposals' => false, + 'net_cash_flow_from_financing' => false, + 'net_cash_flow_from_investing' => false, + 'net_cash_flow_from_operations' => false, + 'net_cash_flow_investment_acquisitions_disposals' => false, + 'net_income' => false, + 'net_income_common_stock' => false, + 'net_income_common_stock_usd' => false, + 'net_income_to_non_controlling_interests' => false, + 'net_loss_income_from_discontinued_operations' => false, + 'operating_expenses' => false, + 'operating_income' => false, + 'payment_dividends_other_cash_distributions' => false, + 'payout_ratio' => false, + 'period' => false, + 'preferred_dividends_income_statement_impact' => false, + 'price_earnings' => false, + 'price_sales' => false, + 'price_to_book_value' => false, + 'price_to_earnings_ratio' => false, + 'price_to_sales_ratio' => false, + 'profit_margin' => false, + 'property_plant_equipment_net' => false, + 'report_period' => false, + 'research_and_development_expense' => false, + 'return_on_average_assets' => false, + 'return_on_average_equity' => false, + 'return_on_invested_capital' => false, + 'return_on_sales' => false, + 'revenues' => false, + 'revenues_usd' => false, + 'sales_per_share' => false, + 'selling_general_and_administrative_expense' => false, + 'share_based_compensation' => false, + 'share_factor' => false, + 'share_price_adjusted_close' => false, + 'shareholders_equity' => false, + 'shareholders_equity_usd' => false, + 'shares' => false, + 'tangible_asset_value' => false, + 'tangible_assets_book_value_per_share' => false, + 'tax_assets' => false, + 'tax_liabilities' => false, + 'ticker' => false, + 'total_liabilities' => false, + 'trade_and_non_trade_payables' => false, + 'trade_and_non_trade_receivables' => false, + 'updated' => false, + 'weighted_average_shares' => false, + 'weighted_average_shares_diluted' => false, + 'working_capital' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ebitda_margin' => 'EBITDAMargin', + 'accumulated_other_comprehensive_income' => 'accumulatedOtherComprehensiveIncome', + 'accumulated_retained_earnings_deficit' => 'accumulatedRetainedEarningsDeficit', + 'asset_turnover' => 'assetTurnover', + 'assets' => 'assets', + 'assets_average' => 'assetsAverage', + 'assets_current' => 'assetsCurrent', + 'assets_non_current' => 'assetsNonCurrent', + 'average_equity' => 'averageEquity', + 'book_value_per_share' => 'bookValuePerShare', + 'calendar_date' => 'calendarDate', + 'capital_expenditure' => 'capitalExpenditure', + 'cash_and_equivalents' => 'cashAndEquivalents', + 'cash_and_equivalents_usd' => 'cashAndEquivalentsUSD', + 'consolidated_income' => 'consolidatedIncome', + 'cost_of_revenue' => 'costOfRevenue', + 'current_liabilities' => 'currentLiabilities', + 'current_ratio' => 'currentRatio', + 'debt' => 'debt', + 'debt_current' => 'debtCurrent', + 'debt_non_current' => 'debtNonCurrent', + 'debt_to_equity_ratio' => 'debtToEquityRatio', + 'debt_usd' => 'debtUSD', + 'deferred_revenue' => 'deferredRevenue', + 'deposits' => 'deposits', + 'depreciation_amortization_and_accretion' => 'depreciationAmortizationAndAccretion', + 'dividend_yield' => 'dividendYield', + 'dividends_per_basic_common_share' => 'dividendsPerBasicCommonShare', + 'earning_before_interest_taxes' => 'earningBeforeInterestTaxes', + 'earning_before_interest_taxes_usd' => 'earningBeforeInterestTaxesUSD', + 'earnings_before_interest_taxes_depreciation_amortization' => 'earningsBeforeInterestTaxesDepreciationAmortization', + 'earnings_before_interest_taxes_depreciation_amortization_usd' => 'earningsBeforeInterestTaxesDepreciationAmortizationUSD', + 'earnings_before_tax' => 'earningsBeforeTax', + 'earnings_per_basic_share' => 'earningsPerBasicShare', + 'earnings_per_basic_share_usd' => 'earningsPerBasicShareUSD', + 'earnings_per_diluted_share' => 'earningsPerDilutedShare', + 'effect_of_exchange_rate_changes_on_cash' => 'effectOfExchangeRateChangesOnCash', + 'enterprise_value' => 'enterpriseValue', + 'enterprise_value_over_ebit' => 'enterpriseValueOverEBIT', + 'enterprise_value_over_ebitda' => 'enterpriseValueOverEBITDA', + 'foreign_currency_usd_exchange_rate' => 'foreignCurrencyUSDExchangeRate', + 'free_cash_flow' => 'freeCashFlow', + 'free_cash_flow_per_share' => 'freeCashFlowPerShare', + 'goodwill_and_intangible_assets' => 'goodwillAndIntangibleAssets', + 'gross_margin' => 'grossMargin', + 'gross_profit' => 'grossProfit', + 'income_tax_expense' => 'incomeTaxExpense', + 'interest_expense' => 'interestExpense', + 'inventory' => 'inventory', + 'invested_capital' => 'investedCapital', + 'invested_capital_average' => 'investedCapitalAverage', + 'investments' => 'investments', + 'investments_current' => 'investmentsCurrent', + 'investments_non_current' => 'investmentsNonCurrent', + 'issuance_debt_securities' => 'issuanceDebtSecurities', + 'issuance_equity_shares' => 'issuanceEquityShares', + 'liabilities_non_current' => 'liabilitiesNonCurrent', + 'market_capitalization' => 'marketCapitalization', + 'net_cash_flow' => 'netCashFlow', + 'net_cash_flow_business_acquisitions_disposals' => 'netCashFlowBusinessAcquisitionsDisposals', + 'net_cash_flow_from_financing' => 'netCashFlowFromFinancing', + 'net_cash_flow_from_investing' => 'netCashFlowFromInvesting', + 'net_cash_flow_from_operations' => 'netCashFlowFromOperations', + 'net_cash_flow_investment_acquisitions_disposals' => 'netCashFlowInvestmentAcquisitionsDisposals', + 'net_income' => 'netIncome', + 'net_income_common_stock' => 'netIncomeCommonStock', + 'net_income_common_stock_usd' => 'netIncomeCommonStockUSD', + 'net_income_to_non_controlling_interests' => 'netIncomeToNonControllingInterests', + 'net_loss_income_from_discontinued_operations' => 'netLossIncomeFromDiscontinuedOperations', + 'operating_expenses' => 'operatingExpenses', + 'operating_income' => 'operatingIncome', + 'payment_dividends_other_cash_distributions' => 'paymentDividendsOtherCashDistributions', + 'payout_ratio' => 'payoutRatio', + 'period' => 'period', + 'preferred_dividends_income_statement_impact' => 'preferredDividendsIncomeStatementImpact', + 'price_earnings' => 'priceEarnings', + 'price_sales' => 'priceSales', + 'price_to_book_value' => 'priceToBookValue', + 'price_to_earnings_ratio' => 'priceToEarningsRatio', + 'price_to_sales_ratio' => 'priceToSalesRatio', + 'profit_margin' => 'profitMargin', + 'property_plant_equipment_net' => 'propertyPlantEquipmentNet', + 'report_period' => 'reportPeriod', + 'research_and_development_expense' => 'researchAndDevelopmentExpense', + 'return_on_average_assets' => 'returnOnAverageAssets', + 'return_on_average_equity' => 'returnOnAverageEquity', + 'return_on_invested_capital' => 'returnOnInvestedCapital', + 'return_on_sales' => 'returnOnSales', + 'revenues' => 'revenues', + 'revenues_usd' => 'revenuesUSD', + 'sales_per_share' => 'salesPerShare', + 'selling_general_and_administrative_expense' => 'sellingGeneralAndAdministrativeExpense', + 'share_based_compensation' => 'shareBasedCompensation', + 'share_factor' => 'shareFactor', + 'share_price_adjusted_close' => 'sharePriceAdjustedClose', + 'shareholders_equity' => 'shareholdersEquity', + 'shareholders_equity_usd' => 'shareholdersEquityUSD', + 'shares' => 'shares', + 'tangible_asset_value' => 'tangibleAssetValue', + 'tangible_assets_book_value_per_share' => 'tangibleAssetsBookValuePerShare', + 'tax_assets' => 'taxAssets', + 'tax_liabilities' => 'taxLiabilities', + 'ticker' => 'ticker', + 'total_liabilities' => 'totalLiabilities', + 'trade_and_non_trade_payables' => 'tradeAndNonTradePayables', + 'trade_and_non_trade_receivables' => 'tradeAndNonTradeReceivables', + 'updated' => 'updated', + 'weighted_average_shares' => 'weightedAverageShares', + 'weighted_average_shares_diluted' => 'weightedAverageSharesDiluted', + 'working_capital' => 'workingCapital' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ebitda_margin' => 'setEbitdaMargin', + 'accumulated_other_comprehensive_income' => 'setAccumulatedOtherComprehensiveIncome', + 'accumulated_retained_earnings_deficit' => 'setAccumulatedRetainedEarningsDeficit', + 'asset_turnover' => 'setAssetTurnover', + 'assets' => 'setAssets', + 'assets_average' => 'setAssetsAverage', + 'assets_current' => 'setAssetsCurrent', + 'assets_non_current' => 'setAssetsNonCurrent', + 'average_equity' => 'setAverageEquity', + 'book_value_per_share' => 'setBookValuePerShare', + 'calendar_date' => 'setCalendarDate', + 'capital_expenditure' => 'setCapitalExpenditure', + 'cash_and_equivalents' => 'setCashAndEquivalents', + 'cash_and_equivalents_usd' => 'setCashAndEquivalentsUsd', + 'consolidated_income' => 'setConsolidatedIncome', + 'cost_of_revenue' => 'setCostOfRevenue', + 'current_liabilities' => 'setCurrentLiabilities', + 'current_ratio' => 'setCurrentRatio', + 'debt' => 'setDebt', + 'debt_current' => 'setDebtCurrent', + 'debt_non_current' => 'setDebtNonCurrent', + 'debt_to_equity_ratio' => 'setDebtToEquityRatio', + 'debt_usd' => 'setDebtUsd', + 'deferred_revenue' => 'setDeferredRevenue', + 'deposits' => 'setDeposits', + 'depreciation_amortization_and_accretion' => 'setDepreciationAmortizationAndAccretion', + 'dividend_yield' => 'setDividendYield', + 'dividends_per_basic_common_share' => 'setDividendsPerBasicCommonShare', + 'earning_before_interest_taxes' => 'setEarningBeforeInterestTaxes', + 'earning_before_interest_taxes_usd' => 'setEarningBeforeInterestTaxesUsd', + 'earnings_before_interest_taxes_depreciation_amortization' => 'setEarningsBeforeInterestTaxesDepreciationAmortization', + 'earnings_before_interest_taxes_depreciation_amortization_usd' => 'setEarningsBeforeInterestTaxesDepreciationAmortizationUsd', + 'earnings_before_tax' => 'setEarningsBeforeTax', + 'earnings_per_basic_share' => 'setEarningsPerBasicShare', + 'earnings_per_basic_share_usd' => 'setEarningsPerBasicShareUsd', + 'earnings_per_diluted_share' => 'setEarningsPerDilutedShare', + 'effect_of_exchange_rate_changes_on_cash' => 'setEffectOfExchangeRateChangesOnCash', + 'enterprise_value' => 'setEnterpriseValue', + 'enterprise_value_over_ebit' => 'setEnterpriseValueOverEbit', + 'enterprise_value_over_ebitda' => 'setEnterpriseValueOverEbitda', + 'foreign_currency_usd_exchange_rate' => 'setForeignCurrencyUsdExchangeRate', + 'free_cash_flow' => 'setFreeCashFlow', + 'free_cash_flow_per_share' => 'setFreeCashFlowPerShare', + 'goodwill_and_intangible_assets' => 'setGoodwillAndIntangibleAssets', + 'gross_margin' => 'setGrossMargin', + 'gross_profit' => 'setGrossProfit', + 'income_tax_expense' => 'setIncomeTaxExpense', + 'interest_expense' => 'setInterestExpense', + 'inventory' => 'setInventory', + 'invested_capital' => 'setInvestedCapital', + 'invested_capital_average' => 'setInvestedCapitalAverage', + 'investments' => 'setInvestments', + 'investments_current' => 'setInvestmentsCurrent', + 'investments_non_current' => 'setInvestmentsNonCurrent', + 'issuance_debt_securities' => 'setIssuanceDebtSecurities', + 'issuance_equity_shares' => 'setIssuanceEquityShares', + 'liabilities_non_current' => 'setLiabilitiesNonCurrent', + 'market_capitalization' => 'setMarketCapitalization', + 'net_cash_flow' => 'setNetCashFlow', + 'net_cash_flow_business_acquisitions_disposals' => 'setNetCashFlowBusinessAcquisitionsDisposals', + 'net_cash_flow_from_financing' => 'setNetCashFlowFromFinancing', + 'net_cash_flow_from_investing' => 'setNetCashFlowFromInvesting', + 'net_cash_flow_from_operations' => 'setNetCashFlowFromOperations', + 'net_cash_flow_investment_acquisitions_disposals' => 'setNetCashFlowInvestmentAcquisitionsDisposals', + 'net_income' => 'setNetIncome', + 'net_income_common_stock' => 'setNetIncomeCommonStock', + 'net_income_common_stock_usd' => 'setNetIncomeCommonStockUsd', + 'net_income_to_non_controlling_interests' => 'setNetIncomeToNonControllingInterests', + 'net_loss_income_from_discontinued_operations' => 'setNetLossIncomeFromDiscontinuedOperations', + 'operating_expenses' => 'setOperatingExpenses', + 'operating_income' => 'setOperatingIncome', + 'payment_dividends_other_cash_distributions' => 'setPaymentDividendsOtherCashDistributions', + 'payout_ratio' => 'setPayoutRatio', + 'period' => 'setPeriod', + 'preferred_dividends_income_statement_impact' => 'setPreferredDividendsIncomeStatementImpact', + 'price_earnings' => 'setPriceEarnings', + 'price_sales' => 'setPriceSales', + 'price_to_book_value' => 'setPriceToBookValue', + 'price_to_earnings_ratio' => 'setPriceToEarningsRatio', + 'price_to_sales_ratio' => 'setPriceToSalesRatio', + 'profit_margin' => 'setProfitMargin', + 'property_plant_equipment_net' => 'setPropertyPlantEquipmentNet', + 'report_period' => 'setReportPeriod', + 'research_and_development_expense' => 'setResearchAndDevelopmentExpense', + 'return_on_average_assets' => 'setReturnOnAverageAssets', + 'return_on_average_equity' => 'setReturnOnAverageEquity', + 'return_on_invested_capital' => 'setReturnOnInvestedCapital', + 'return_on_sales' => 'setReturnOnSales', + 'revenues' => 'setRevenues', + 'revenues_usd' => 'setRevenuesUsd', + 'sales_per_share' => 'setSalesPerShare', + 'selling_general_and_administrative_expense' => 'setSellingGeneralAndAdministrativeExpense', + 'share_based_compensation' => 'setShareBasedCompensation', + 'share_factor' => 'setShareFactor', + 'share_price_adjusted_close' => 'setSharePriceAdjustedClose', + 'shareholders_equity' => 'setShareholdersEquity', + 'shareholders_equity_usd' => 'setShareholdersEquityUsd', + 'shares' => 'setShares', + 'tangible_asset_value' => 'setTangibleAssetValue', + 'tangible_assets_book_value_per_share' => 'setTangibleAssetsBookValuePerShare', + 'tax_assets' => 'setTaxAssets', + 'tax_liabilities' => 'setTaxLiabilities', + 'ticker' => 'setTicker', + 'total_liabilities' => 'setTotalLiabilities', + 'trade_and_non_trade_payables' => 'setTradeAndNonTradePayables', + 'trade_and_non_trade_receivables' => 'setTradeAndNonTradeReceivables', + 'updated' => 'setUpdated', + 'weighted_average_shares' => 'setWeightedAverageShares', + 'weighted_average_shares_diluted' => 'setWeightedAverageSharesDiluted', + 'working_capital' => 'setWorkingCapital' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ebitda_margin' => 'getEbitdaMargin', + 'accumulated_other_comprehensive_income' => 'getAccumulatedOtherComprehensiveIncome', + 'accumulated_retained_earnings_deficit' => 'getAccumulatedRetainedEarningsDeficit', + 'asset_turnover' => 'getAssetTurnover', + 'assets' => 'getAssets', + 'assets_average' => 'getAssetsAverage', + 'assets_current' => 'getAssetsCurrent', + 'assets_non_current' => 'getAssetsNonCurrent', + 'average_equity' => 'getAverageEquity', + 'book_value_per_share' => 'getBookValuePerShare', + 'calendar_date' => 'getCalendarDate', + 'capital_expenditure' => 'getCapitalExpenditure', + 'cash_and_equivalents' => 'getCashAndEquivalents', + 'cash_and_equivalents_usd' => 'getCashAndEquivalentsUsd', + 'consolidated_income' => 'getConsolidatedIncome', + 'cost_of_revenue' => 'getCostOfRevenue', + 'current_liabilities' => 'getCurrentLiabilities', + 'current_ratio' => 'getCurrentRatio', + 'debt' => 'getDebt', + 'debt_current' => 'getDebtCurrent', + 'debt_non_current' => 'getDebtNonCurrent', + 'debt_to_equity_ratio' => 'getDebtToEquityRatio', + 'debt_usd' => 'getDebtUsd', + 'deferred_revenue' => 'getDeferredRevenue', + 'deposits' => 'getDeposits', + 'depreciation_amortization_and_accretion' => 'getDepreciationAmortizationAndAccretion', + 'dividend_yield' => 'getDividendYield', + 'dividends_per_basic_common_share' => 'getDividendsPerBasicCommonShare', + 'earning_before_interest_taxes' => 'getEarningBeforeInterestTaxes', + 'earning_before_interest_taxes_usd' => 'getEarningBeforeInterestTaxesUsd', + 'earnings_before_interest_taxes_depreciation_amortization' => 'getEarningsBeforeInterestTaxesDepreciationAmortization', + 'earnings_before_interest_taxes_depreciation_amortization_usd' => 'getEarningsBeforeInterestTaxesDepreciationAmortizationUsd', + 'earnings_before_tax' => 'getEarningsBeforeTax', + 'earnings_per_basic_share' => 'getEarningsPerBasicShare', + 'earnings_per_basic_share_usd' => 'getEarningsPerBasicShareUsd', + 'earnings_per_diluted_share' => 'getEarningsPerDilutedShare', + 'effect_of_exchange_rate_changes_on_cash' => 'getEffectOfExchangeRateChangesOnCash', + 'enterprise_value' => 'getEnterpriseValue', + 'enterprise_value_over_ebit' => 'getEnterpriseValueOverEbit', + 'enterprise_value_over_ebitda' => 'getEnterpriseValueOverEbitda', + 'foreign_currency_usd_exchange_rate' => 'getForeignCurrencyUsdExchangeRate', + 'free_cash_flow' => 'getFreeCashFlow', + 'free_cash_flow_per_share' => 'getFreeCashFlowPerShare', + 'goodwill_and_intangible_assets' => 'getGoodwillAndIntangibleAssets', + 'gross_margin' => 'getGrossMargin', + 'gross_profit' => 'getGrossProfit', + 'income_tax_expense' => 'getIncomeTaxExpense', + 'interest_expense' => 'getInterestExpense', + 'inventory' => 'getInventory', + 'invested_capital' => 'getInvestedCapital', + 'invested_capital_average' => 'getInvestedCapitalAverage', + 'investments' => 'getInvestments', + 'investments_current' => 'getInvestmentsCurrent', + 'investments_non_current' => 'getInvestmentsNonCurrent', + 'issuance_debt_securities' => 'getIssuanceDebtSecurities', + 'issuance_equity_shares' => 'getIssuanceEquityShares', + 'liabilities_non_current' => 'getLiabilitiesNonCurrent', + 'market_capitalization' => 'getMarketCapitalization', + 'net_cash_flow' => 'getNetCashFlow', + 'net_cash_flow_business_acquisitions_disposals' => 'getNetCashFlowBusinessAcquisitionsDisposals', + 'net_cash_flow_from_financing' => 'getNetCashFlowFromFinancing', + 'net_cash_flow_from_investing' => 'getNetCashFlowFromInvesting', + 'net_cash_flow_from_operations' => 'getNetCashFlowFromOperations', + 'net_cash_flow_investment_acquisitions_disposals' => 'getNetCashFlowInvestmentAcquisitionsDisposals', + 'net_income' => 'getNetIncome', + 'net_income_common_stock' => 'getNetIncomeCommonStock', + 'net_income_common_stock_usd' => 'getNetIncomeCommonStockUsd', + 'net_income_to_non_controlling_interests' => 'getNetIncomeToNonControllingInterests', + 'net_loss_income_from_discontinued_operations' => 'getNetLossIncomeFromDiscontinuedOperations', + 'operating_expenses' => 'getOperatingExpenses', + 'operating_income' => 'getOperatingIncome', + 'payment_dividends_other_cash_distributions' => 'getPaymentDividendsOtherCashDistributions', + 'payout_ratio' => 'getPayoutRatio', + 'period' => 'getPeriod', + 'preferred_dividends_income_statement_impact' => 'getPreferredDividendsIncomeStatementImpact', + 'price_earnings' => 'getPriceEarnings', + 'price_sales' => 'getPriceSales', + 'price_to_book_value' => 'getPriceToBookValue', + 'price_to_earnings_ratio' => 'getPriceToEarningsRatio', + 'price_to_sales_ratio' => 'getPriceToSalesRatio', + 'profit_margin' => 'getProfitMargin', + 'property_plant_equipment_net' => 'getPropertyPlantEquipmentNet', + 'report_period' => 'getReportPeriod', + 'research_and_development_expense' => 'getResearchAndDevelopmentExpense', + 'return_on_average_assets' => 'getReturnOnAverageAssets', + 'return_on_average_equity' => 'getReturnOnAverageEquity', + 'return_on_invested_capital' => 'getReturnOnInvestedCapital', + 'return_on_sales' => 'getReturnOnSales', + 'revenues' => 'getRevenues', + 'revenues_usd' => 'getRevenuesUsd', + 'sales_per_share' => 'getSalesPerShare', + 'selling_general_and_administrative_expense' => 'getSellingGeneralAndAdministrativeExpense', + 'share_based_compensation' => 'getShareBasedCompensation', + 'share_factor' => 'getShareFactor', + 'share_price_adjusted_close' => 'getSharePriceAdjustedClose', + 'shareholders_equity' => 'getShareholdersEquity', + 'shareholders_equity_usd' => 'getShareholdersEquityUsd', + 'shares' => 'getShares', + 'tangible_asset_value' => 'getTangibleAssetValue', + 'tangible_assets_book_value_per_share' => 'getTangibleAssetsBookValuePerShare', + 'tax_assets' => 'getTaxAssets', + 'tax_liabilities' => 'getTaxLiabilities', + 'ticker' => 'getTicker', + 'total_liabilities' => 'getTotalLiabilities', + 'trade_and_non_trade_payables' => 'getTradeAndNonTradePayables', + 'trade_and_non_trade_receivables' => 'getTradeAndNonTradeReceivables', + 'updated' => 'getUpdated', + 'weighted_average_shares' => 'getWeightedAverageShares', + 'weighted_average_shares_diluted' => 'getWeightedAverageSharesDiluted', + 'working_capital' => 'getWorkingCapital' + ]; + + /** + * 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; + } + + public const PERIOD_Q = 'Q'; + public const PERIOD_T = 'T'; + public const PERIOD_QA = 'QA'; + public const PERIOD_TA = 'TA'; + public const PERIOD_Y = 'Y'; + public const PERIOD_YA = 'YA'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPeriodAllowableValues() + { + return [ + self::PERIOD_Q, + self::PERIOD_T, + self::PERIOD_QA, + self::PERIOD_TA, + self::PERIOD_Y, + self::PERIOD_YA, + ]; + } + + /** + * 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->setIfExists('ebitda_margin', $data ?? [], null); + $this->setIfExists('accumulated_other_comprehensive_income', $data ?? [], null); + $this->setIfExists('accumulated_retained_earnings_deficit', $data ?? [], null); + $this->setIfExists('asset_turnover', $data ?? [], null); + $this->setIfExists('assets', $data ?? [], null); + $this->setIfExists('assets_average', $data ?? [], null); + $this->setIfExists('assets_current', $data ?? [], null); + $this->setIfExists('assets_non_current', $data ?? [], null); + $this->setIfExists('average_equity', $data ?? [], null); + $this->setIfExists('book_value_per_share', $data ?? [], null); + $this->setIfExists('calendar_date', $data ?? [], null); + $this->setIfExists('capital_expenditure', $data ?? [], null); + $this->setIfExists('cash_and_equivalents', $data ?? [], null); + $this->setIfExists('cash_and_equivalents_usd', $data ?? [], null); + $this->setIfExists('consolidated_income', $data ?? [], null); + $this->setIfExists('cost_of_revenue', $data ?? [], null); + $this->setIfExists('current_liabilities', $data ?? [], null); + $this->setIfExists('current_ratio', $data ?? [], null); + $this->setIfExists('debt', $data ?? [], null); + $this->setIfExists('debt_current', $data ?? [], null); + $this->setIfExists('debt_non_current', $data ?? [], null); + $this->setIfExists('debt_to_equity_ratio', $data ?? [], null); + $this->setIfExists('debt_usd', $data ?? [], null); + $this->setIfExists('deferred_revenue', $data ?? [], null); + $this->setIfExists('deposits', $data ?? [], null); + $this->setIfExists('depreciation_amortization_and_accretion', $data ?? [], null); + $this->setIfExists('dividend_yield', $data ?? [], null); + $this->setIfExists('dividends_per_basic_common_share', $data ?? [], null); + $this->setIfExists('earning_before_interest_taxes', $data ?? [], null); + $this->setIfExists('earning_before_interest_taxes_usd', $data ?? [], null); + $this->setIfExists('earnings_before_interest_taxes_depreciation_amortization', $data ?? [], null); + $this->setIfExists('earnings_before_interest_taxes_depreciation_amortization_usd', $data ?? [], null); + $this->setIfExists('earnings_before_tax', $data ?? [], null); + $this->setIfExists('earnings_per_basic_share', $data ?? [], null); + $this->setIfExists('earnings_per_basic_share_usd', $data ?? [], null); + $this->setIfExists('earnings_per_diluted_share', $data ?? [], null); + $this->setIfExists('effect_of_exchange_rate_changes_on_cash', $data ?? [], null); + $this->setIfExists('enterprise_value', $data ?? [], null); + $this->setIfExists('enterprise_value_over_ebit', $data ?? [], null); + $this->setIfExists('enterprise_value_over_ebitda', $data ?? [], null); + $this->setIfExists('foreign_currency_usd_exchange_rate', $data ?? [], null); + $this->setIfExists('free_cash_flow', $data ?? [], null); + $this->setIfExists('free_cash_flow_per_share', $data ?? [], null); + $this->setIfExists('goodwill_and_intangible_assets', $data ?? [], null); + $this->setIfExists('gross_margin', $data ?? [], null); + $this->setIfExists('gross_profit', $data ?? [], null); + $this->setIfExists('income_tax_expense', $data ?? [], null); + $this->setIfExists('interest_expense', $data ?? [], null); + $this->setIfExists('inventory', $data ?? [], null); + $this->setIfExists('invested_capital', $data ?? [], null); + $this->setIfExists('invested_capital_average', $data ?? [], null); + $this->setIfExists('investments', $data ?? [], null); + $this->setIfExists('investments_current', $data ?? [], null); + $this->setIfExists('investments_non_current', $data ?? [], null); + $this->setIfExists('issuance_debt_securities', $data ?? [], null); + $this->setIfExists('issuance_equity_shares', $data ?? [], null); + $this->setIfExists('liabilities_non_current', $data ?? [], null); + $this->setIfExists('market_capitalization', $data ?? [], null); + $this->setIfExists('net_cash_flow', $data ?? [], null); + $this->setIfExists('net_cash_flow_business_acquisitions_disposals', $data ?? [], null); + $this->setIfExists('net_cash_flow_from_financing', $data ?? [], null); + $this->setIfExists('net_cash_flow_from_investing', $data ?? [], null); + $this->setIfExists('net_cash_flow_from_operations', $data ?? [], null); + $this->setIfExists('net_cash_flow_investment_acquisitions_disposals', $data ?? [], null); + $this->setIfExists('net_income', $data ?? [], null); + $this->setIfExists('net_income_common_stock', $data ?? [], null); + $this->setIfExists('net_income_common_stock_usd', $data ?? [], null); + $this->setIfExists('net_income_to_non_controlling_interests', $data ?? [], null); + $this->setIfExists('net_loss_income_from_discontinued_operations', $data ?? [], null); + $this->setIfExists('operating_expenses', $data ?? [], null); + $this->setIfExists('operating_income', $data ?? [], null); + $this->setIfExists('payment_dividends_other_cash_distributions', $data ?? [], null); + $this->setIfExists('payout_ratio', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('preferred_dividends_income_statement_impact', $data ?? [], null); + $this->setIfExists('price_earnings', $data ?? [], null); + $this->setIfExists('price_sales', $data ?? [], null); + $this->setIfExists('price_to_book_value', $data ?? [], null); + $this->setIfExists('price_to_earnings_ratio', $data ?? [], null); + $this->setIfExists('price_to_sales_ratio', $data ?? [], null); + $this->setIfExists('profit_margin', $data ?? [], null); + $this->setIfExists('property_plant_equipment_net', $data ?? [], null); + $this->setIfExists('report_period', $data ?? [], null); + $this->setIfExists('research_and_development_expense', $data ?? [], null); + $this->setIfExists('return_on_average_assets', $data ?? [], null); + $this->setIfExists('return_on_average_equity', $data ?? [], null); + $this->setIfExists('return_on_invested_capital', $data ?? [], null); + $this->setIfExists('return_on_sales', $data ?? [], null); + $this->setIfExists('revenues', $data ?? [], null); + $this->setIfExists('revenues_usd', $data ?? [], null); + $this->setIfExists('sales_per_share', $data ?? [], null); + $this->setIfExists('selling_general_and_administrative_expense', $data ?? [], null); + $this->setIfExists('share_based_compensation', $data ?? [], null); + $this->setIfExists('share_factor', $data ?? [], null); + $this->setIfExists('share_price_adjusted_close', $data ?? [], null); + $this->setIfExists('shareholders_equity', $data ?? [], null); + $this->setIfExists('shareholders_equity_usd', $data ?? [], null); + $this->setIfExists('shares', $data ?? [], null); + $this->setIfExists('tangible_asset_value', $data ?? [], null); + $this->setIfExists('tangible_assets_book_value_per_share', $data ?? [], null); + $this->setIfExists('tax_assets', $data ?? [], null); + $this->setIfExists('tax_liabilities', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('total_liabilities', $data ?? [], null); + $this->setIfExists('trade_and_non_trade_payables', $data ?? [], null); + $this->setIfExists('trade_and_non_trade_receivables', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + $this->setIfExists('weighted_average_shares', $data ?? [], null); + $this->setIfExists('weighted_average_shares_diluted', $data ?? [], null); + $this->setIfExists('working_capital', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getPeriodAllowableValues(); + if (!is_null($this->container['period']) && !in_array($this->container['period'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'period', must be one of '%s'", + $this->container['period'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 ebitda_margin + * + * @return float|null + */ + public function getEbitdaMargin() + { + return $this->container['ebitda_margin']; + } + + /** + * Sets ebitda_margin + * + * @param float|null $ebitda_margin ebitda_margin + * + * @return self + */ + public function setEbitdaMargin($ebitda_margin) + { + if (is_null($ebitda_margin)) { + throw new \InvalidArgumentException('non-nullable ebitda_margin cannot be null'); + } + $this->container['ebitda_margin'] = $ebitda_margin; + + return $this; + } + + /** + * Gets accumulated_other_comprehensive_income + * + * @return int|null + */ + public function getAccumulatedOtherComprehensiveIncome() + { + return $this->container['accumulated_other_comprehensive_income']; + } + + /** + * Sets accumulated_other_comprehensive_income + * + * @param int|null $accumulated_other_comprehensive_income accumulated_other_comprehensive_income + * + * @return self + */ + public function setAccumulatedOtherComprehensiveIncome($accumulated_other_comprehensive_income) + { + if (is_null($accumulated_other_comprehensive_income)) { + throw new \InvalidArgumentException('non-nullable accumulated_other_comprehensive_income cannot be null'); + } + $this->container['accumulated_other_comprehensive_income'] = $accumulated_other_comprehensive_income; + + return $this; + } + + /** + * Gets accumulated_retained_earnings_deficit + * + * @return int|null + */ + public function getAccumulatedRetainedEarningsDeficit() + { + return $this->container['accumulated_retained_earnings_deficit']; + } + + /** + * Sets accumulated_retained_earnings_deficit + * + * @param int|null $accumulated_retained_earnings_deficit accumulated_retained_earnings_deficit + * + * @return self + */ + public function setAccumulatedRetainedEarningsDeficit($accumulated_retained_earnings_deficit) + { + if (is_null($accumulated_retained_earnings_deficit)) { + throw new \InvalidArgumentException('non-nullable accumulated_retained_earnings_deficit cannot be null'); + } + $this->container['accumulated_retained_earnings_deficit'] = $accumulated_retained_earnings_deficit; + + return $this; + } + + /** + * Gets asset_turnover + * + * @return int|null + */ + public function getAssetTurnover() + { + return $this->container['asset_turnover']; + } + + /** + * Sets asset_turnover + * + * @param int|null $asset_turnover asset_turnover + * + * @return self + */ + public function setAssetTurnover($asset_turnover) + { + if (is_null($asset_turnover)) { + throw new \InvalidArgumentException('non-nullable asset_turnover cannot be null'); + } + $this->container['asset_turnover'] = $asset_turnover; + + return $this; + } + + /** + * Gets assets + * + * @return int|null + */ + public function getAssets() + { + return $this->container['assets']; + } + + /** + * Sets assets + * + * @param int|null $assets assets + * + * @return self + */ + public function setAssets($assets) + { + if (is_null($assets)) { + throw new \InvalidArgumentException('non-nullable assets cannot be null'); + } + $this->container['assets'] = $assets; + + return $this; + } + + /** + * Gets assets_average + * + * @return int|null + */ + public function getAssetsAverage() + { + return $this->container['assets_average']; + } + + /** + * Sets assets_average + * + * @param int|null $assets_average assets_average + * + * @return self + */ + public function setAssetsAverage($assets_average) + { + if (is_null($assets_average)) { + throw new \InvalidArgumentException('non-nullable assets_average cannot be null'); + } + $this->container['assets_average'] = $assets_average; + + return $this; + } + + /** + * Gets assets_current + * + * @return int|null + */ + public function getAssetsCurrent() + { + return $this->container['assets_current']; + } + + /** + * Sets assets_current + * + * @param int|null $assets_current assets_current + * + * @return self + */ + public function setAssetsCurrent($assets_current) + { + if (is_null($assets_current)) { + throw new \InvalidArgumentException('non-nullable assets_current cannot be null'); + } + $this->container['assets_current'] = $assets_current; + + return $this; + } + + /** + * Gets assets_non_current + * + * @return int|null + */ + public function getAssetsNonCurrent() + { + return $this->container['assets_non_current']; + } + + /** + * Sets assets_non_current + * + * @param int|null $assets_non_current assets_non_current + * + * @return self + */ + public function setAssetsNonCurrent($assets_non_current) + { + if (is_null($assets_non_current)) { + throw new \InvalidArgumentException('non-nullable assets_non_current cannot be null'); + } + $this->container['assets_non_current'] = $assets_non_current; + + return $this; + } + + /** + * Gets average_equity + * + * @return int|null + */ + public function getAverageEquity() + { + return $this->container['average_equity']; + } + + /** + * Sets average_equity + * + * @param int|null $average_equity average_equity + * + * @return self + */ + public function setAverageEquity($average_equity) + { + if (is_null($average_equity)) { + throw new \InvalidArgumentException('non-nullable average_equity cannot be null'); + } + $this->container['average_equity'] = $average_equity; + + return $this; + } + + /** + * Gets book_value_per_share + * + * @return float|null + */ + public function getBookValuePerShare() + { + return $this->container['book_value_per_share']; + } + + /** + * Sets book_value_per_share + * + * @param float|null $book_value_per_share book_value_per_share + * + * @return self + */ + public function setBookValuePerShare($book_value_per_share) + { + if (is_null($book_value_per_share)) { + throw new \InvalidArgumentException('non-nullable book_value_per_share cannot be null'); + } + $this->container['book_value_per_share'] = $book_value_per_share; + + return $this; + } + + /** + * Gets calendar_date + * + * @return \DateTime|null + */ + public function getCalendarDate() + { + return $this->container['calendar_date']; + } + + /** + * Sets calendar_date + * + * @param \DateTime|null $calendar_date calendar_date + * + * @return self + */ + public function setCalendarDate($calendar_date) + { + if (is_null($calendar_date)) { + throw new \InvalidArgumentException('non-nullable calendar_date cannot be null'); + } + $this->container['calendar_date'] = $calendar_date; + + return $this; + } + + /** + * Gets capital_expenditure + * + * @return int|null + */ + public function getCapitalExpenditure() + { + return $this->container['capital_expenditure']; + } + + /** + * Sets capital_expenditure + * + * @param int|null $capital_expenditure capital_expenditure + * + * @return self + */ + public function setCapitalExpenditure($capital_expenditure) + { + if (is_null($capital_expenditure)) { + throw new \InvalidArgumentException('non-nullable capital_expenditure cannot be null'); + } + $this->container['capital_expenditure'] = $capital_expenditure; + + return $this; + } + + /** + * Gets cash_and_equivalents + * + * @return int|null + */ + public function getCashAndEquivalents() + { + return $this->container['cash_and_equivalents']; + } + + /** + * Sets cash_and_equivalents + * + * @param int|null $cash_and_equivalents cash_and_equivalents + * + * @return self + */ + public function setCashAndEquivalents($cash_and_equivalents) + { + if (is_null($cash_and_equivalents)) { + throw new \InvalidArgumentException('non-nullable cash_and_equivalents cannot be null'); + } + $this->container['cash_and_equivalents'] = $cash_and_equivalents; + + return $this; + } + + /** + * Gets cash_and_equivalents_usd + * + * @return int|null + */ + public function getCashAndEquivalentsUsd() + { + return $this->container['cash_and_equivalents_usd']; + } + + /** + * Sets cash_and_equivalents_usd + * + * @param int|null $cash_and_equivalents_usd cash_and_equivalents_usd + * + * @return self + */ + public function setCashAndEquivalentsUsd($cash_and_equivalents_usd) + { + if (is_null($cash_and_equivalents_usd)) { + throw new \InvalidArgumentException('non-nullable cash_and_equivalents_usd cannot be null'); + } + $this->container['cash_and_equivalents_usd'] = $cash_and_equivalents_usd; + + return $this; + } + + /** + * Gets consolidated_income + * + * @return int|null + */ + public function getConsolidatedIncome() + { + return $this->container['consolidated_income']; + } + + /** + * Sets consolidated_income + * + * @param int|null $consolidated_income consolidated_income + * + * @return self + */ + public function setConsolidatedIncome($consolidated_income) + { + if (is_null($consolidated_income)) { + throw new \InvalidArgumentException('non-nullable consolidated_income cannot be null'); + } + $this->container['consolidated_income'] = $consolidated_income; + + return $this; + } + + /** + * Gets cost_of_revenue + * + * @return int|null + */ + public function getCostOfRevenue() + { + return $this->container['cost_of_revenue']; + } + + /** + * Sets cost_of_revenue + * + * @param int|null $cost_of_revenue cost_of_revenue + * + * @return self + */ + public function setCostOfRevenue($cost_of_revenue) + { + if (is_null($cost_of_revenue)) { + throw new \InvalidArgumentException('non-nullable cost_of_revenue cannot be null'); + } + $this->container['cost_of_revenue'] = $cost_of_revenue; + + return $this; + } + + /** + * Gets current_liabilities + * + * @return int|null + */ + public function getCurrentLiabilities() + { + return $this->container['current_liabilities']; + } + + /** + * Sets current_liabilities + * + * @param int|null $current_liabilities current_liabilities + * + * @return self + */ + public function setCurrentLiabilities($current_liabilities) + { + if (is_null($current_liabilities)) { + throw new \InvalidArgumentException('non-nullable current_liabilities cannot be null'); + } + $this->container['current_liabilities'] = $current_liabilities; + + return $this; + } + + /** + * Gets current_ratio + * + * @return float|null + */ + public function getCurrentRatio() + { + return $this->container['current_ratio']; + } + + /** + * Sets current_ratio + * + * @param float|null $current_ratio current_ratio + * + * @return self + */ + public function setCurrentRatio($current_ratio) + { + if (is_null($current_ratio)) { + throw new \InvalidArgumentException('non-nullable current_ratio cannot be null'); + } + $this->container['current_ratio'] = $current_ratio; + + return $this; + } + + /** + * Gets debt + * + * @return int|null + */ + public function getDebt() + { + return $this->container['debt']; + } + + /** + * Sets debt + * + * @param int|null $debt debt + * + * @return self + */ + public function setDebt($debt) + { + if (is_null($debt)) { + throw new \InvalidArgumentException('non-nullable debt cannot be null'); + } + $this->container['debt'] = $debt; + + return $this; + } + + /** + * Gets debt_current + * + * @return int|null + */ + public function getDebtCurrent() + { + return $this->container['debt_current']; + } + + /** + * Sets debt_current + * + * @param int|null $debt_current debt_current + * + * @return self + */ + public function setDebtCurrent($debt_current) + { + if (is_null($debt_current)) { + throw new \InvalidArgumentException('non-nullable debt_current cannot be null'); + } + $this->container['debt_current'] = $debt_current; + + return $this; + } + + /** + * Gets debt_non_current + * + * @return int|null + */ + public function getDebtNonCurrent() + { + return $this->container['debt_non_current']; + } + + /** + * Sets debt_non_current + * + * @param int|null $debt_non_current debt_non_current + * + * @return self + */ + public function setDebtNonCurrent($debt_non_current) + { + if (is_null($debt_non_current)) { + throw new \InvalidArgumentException('non-nullable debt_non_current cannot be null'); + } + $this->container['debt_non_current'] = $debt_non_current; + + return $this; + } + + /** + * Gets debt_to_equity_ratio + * + * @return float|null + */ + public function getDebtToEquityRatio() + { + return $this->container['debt_to_equity_ratio']; + } + + /** + * Sets debt_to_equity_ratio + * + * @param float|null $debt_to_equity_ratio debt_to_equity_ratio + * + * @return self + */ + public function setDebtToEquityRatio($debt_to_equity_ratio) + { + if (is_null($debt_to_equity_ratio)) { + throw new \InvalidArgumentException('non-nullable debt_to_equity_ratio cannot be null'); + } + $this->container['debt_to_equity_ratio'] = $debt_to_equity_ratio; + + return $this; + } + + /** + * Gets debt_usd + * + * @return int|null + */ + public function getDebtUsd() + { + return $this->container['debt_usd']; + } + + /** + * Sets debt_usd + * + * @param int|null $debt_usd debt_usd + * + * @return self + */ + public function setDebtUsd($debt_usd) + { + if (is_null($debt_usd)) { + throw new \InvalidArgumentException('non-nullable debt_usd cannot be null'); + } + $this->container['debt_usd'] = $debt_usd; + + return $this; + } + + /** + * Gets deferred_revenue + * + * @return int|null + */ + public function getDeferredRevenue() + { + return $this->container['deferred_revenue']; + } + + /** + * Sets deferred_revenue + * + * @param int|null $deferred_revenue deferred_revenue + * + * @return self + */ + public function setDeferredRevenue($deferred_revenue) + { + if (is_null($deferred_revenue)) { + throw new \InvalidArgumentException('non-nullable deferred_revenue cannot be null'); + } + $this->container['deferred_revenue'] = $deferred_revenue; + + return $this; + } + + /** + * Gets deposits + * + * @return int|null + */ + public function getDeposits() + { + return $this->container['deposits']; + } + + /** + * Sets deposits + * + * @param int|null $deposits deposits + * + * @return self + */ + public function setDeposits($deposits) + { + if (is_null($deposits)) { + throw new \InvalidArgumentException('non-nullable deposits cannot be null'); + } + $this->container['deposits'] = $deposits; + + return $this; + } + + /** + * Gets depreciation_amortization_and_accretion + * + * @return int|null + */ + public function getDepreciationAmortizationAndAccretion() + { + return $this->container['depreciation_amortization_and_accretion']; + } + + /** + * Sets depreciation_amortization_and_accretion + * + * @param int|null $depreciation_amortization_and_accretion depreciation_amortization_and_accretion + * + * @return self + */ + public function setDepreciationAmortizationAndAccretion($depreciation_amortization_and_accretion) + { + if (is_null($depreciation_amortization_and_accretion)) { + throw new \InvalidArgumentException('non-nullable depreciation_amortization_and_accretion cannot be null'); + } + $this->container['depreciation_amortization_and_accretion'] = $depreciation_amortization_and_accretion; + + return $this; + } + + /** + * Gets dividend_yield + * + * @return int|null + */ + public function getDividendYield() + { + return $this->container['dividend_yield']; + } + + /** + * Sets dividend_yield + * + * @param int|null $dividend_yield dividend_yield + * + * @return self + */ + public function setDividendYield($dividend_yield) + { + if (is_null($dividend_yield)) { + throw new \InvalidArgumentException('non-nullable dividend_yield cannot be null'); + } + $this->container['dividend_yield'] = $dividend_yield; + + return $this; + } + + /** + * Gets dividends_per_basic_common_share + * + * @return int|null + */ + public function getDividendsPerBasicCommonShare() + { + return $this->container['dividends_per_basic_common_share']; + } + + /** + * Sets dividends_per_basic_common_share + * + * @param int|null $dividends_per_basic_common_share dividends_per_basic_common_share + * + * @return self + */ + public function setDividendsPerBasicCommonShare($dividends_per_basic_common_share) + { + if (is_null($dividends_per_basic_common_share)) { + throw new \InvalidArgumentException('non-nullable dividends_per_basic_common_share cannot be null'); + } + $this->container['dividends_per_basic_common_share'] = $dividends_per_basic_common_share; + + return $this; + } + + /** + * Gets earning_before_interest_taxes + * + * @return int|null + */ + public function getEarningBeforeInterestTaxes() + { + return $this->container['earning_before_interest_taxes']; + } + + /** + * Sets earning_before_interest_taxes + * + * @param int|null $earning_before_interest_taxes earning_before_interest_taxes + * + * @return self + */ + public function setEarningBeforeInterestTaxes($earning_before_interest_taxes) + { + if (is_null($earning_before_interest_taxes)) { + throw new \InvalidArgumentException('non-nullable earning_before_interest_taxes cannot be null'); + } + $this->container['earning_before_interest_taxes'] = $earning_before_interest_taxes; + + return $this; + } + + /** + * Gets earning_before_interest_taxes_usd + * + * @return int|null + */ + public function getEarningBeforeInterestTaxesUsd() + { + return $this->container['earning_before_interest_taxes_usd']; + } + + /** + * Sets earning_before_interest_taxes_usd + * + * @param int|null $earning_before_interest_taxes_usd earning_before_interest_taxes_usd + * + * @return self + */ + public function setEarningBeforeInterestTaxesUsd($earning_before_interest_taxes_usd) + { + if (is_null($earning_before_interest_taxes_usd)) { + throw new \InvalidArgumentException('non-nullable earning_before_interest_taxes_usd cannot be null'); + } + $this->container['earning_before_interest_taxes_usd'] = $earning_before_interest_taxes_usd; + + return $this; + } + + /** + * Gets earnings_before_interest_taxes_depreciation_amortization + * + * @return int|null + */ + public function getEarningsBeforeInterestTaxesDepreciationAmortization() + { + return $this->container['earnings_before_interest_taxes_depreciation_amortization']; + } + + /** + * Sets earnings_before_interest_taxes_depreciation_amortization + * + * @param int|null $earnings_before_interest_taxes_depreciation_amortization earnings_before_interest_taxes_depreciation_amortization + * + * @return self + */ + public function setEarningsBeforeInterestTaxesDepreciationAmortization($earnings_before_interest_taxes_depreciation_amortization) + { + if (is_null($earnings_before_interest_taxes_depreciation_amortization)) { + throw new \InvalidArgumentException('non-nullable earnings_before_interest_taxes_depreciation_amortization cannot be null'); + } + $this->container['earnings_before_interest_taxes_depreciation_amortization'] = $earnings_before_interest_taxes_depreciation_amortization; + + return $this; + } + + /** + * Gets earnings_before_interest_taxes_depreciation_amortization_usd + * + * @return int|null + */ + public function getEarningsBeforeInterestTaxesDepreciationAmortizationUsd() + { + return $this->container['earnings_before_interest_taxes_depreciation_amortization_usd']; + } + + /** + * Sets earnings_before_interest_taxes_depreciation_amortization_usd + * + * @param int|null $earnings_before_interest_taxes_depreciation_amortization_usd earnings_before_interest_taxes_depreciation_amortization_usd + * + * @return self + */ + public function setEarningsBeforeInterestTaxesDepreciationAmortizationUsd($earnings_before_interest_taxes_depreciation_amortization_usd) + { + if (is_null($earnings_before_interest_taxes_depreciation_amortization_usd)) { + throw new \InvalidArgumentException('non-nullable earnings_before_interest_taxes_depreciation_amortization_usd cannot be null'); + } + $this->container['earnings_before_interest_taxes_depreciation_amortization_usd'] = $earnings_before_interest_taxes_depreciation_amortization_usd; + + return $this; + } + + /** + * Gets earnings_before_tax + * + * @return int|null + */ + public function getEarningsBeforeTax() + { + return $this->container['earnings_before_tax']; + } + + /** + * Sets earnings_before_tax + * + * @param int|null $earnings_before_tax earnings_before_tax + * + * @return self + */ + public function setEarningsBeforeTax($earnings_before_tax) + { + if (is_null($earnings_before_tax)) { + throw new \InvalidArgumentException('non-nullable earnings_before_tax cannot be null'); + } + $this->container['earnings_before_tax'] = $earnings_before_tax; + + return $this; + } + + /** + * Gets earnings_per_basic_share + * + * @return float|null + */ + public function getEarningsPerBasicShare() + { + return $this->container['earnings_per_basic_share']; + } + + /** + * Sets earnings_per_basic_share + * + * @param float|null $earnings_per_basic_share earnings_per_basic_share + * + * @return self + */ + public function setEarningsPerBasicShare($earnings_per_basic_share) + { + if (is_null($earnings_per_basic_share)) { + throw new \InvalidArgumentException('non-nullable earnings_per_basic_share cannot be null'); + } + $this->container['earnings_per_basic_share'] = $earnings_per_basic_share; + + return $this; + } + + /** + * Gets earnings_per_basic_share_usd + * + * @return float|null + */ + public function getEarningsPerBasicShareUsd() + { + return $this->container['earnings_per_basic_share_usd']; + } + + /** + * Sets earnings_per_basic_share_usd + * + * @param float|null $earnings_per_basic_share_usd earnings_per_basic_share_usd + * + * @return self + */ + public function setEarningsPerBasicShareUsd($earnings_per_basic_share_usd) + { + if (is_null($earnings_per_basic_share_usd)) { + throw new \InvalidArgumentException('non-nullable earnings_per_basic_share_usd cannot be null'); + } + $this->container['earnings_per_basic_share_usd'] = $earnings_per_basic_share_usd; + + return $this; + } + + /** + * Gets earnings_per_diluted_share + * + * @return float|null + */ + public function getEarningsPerDilutedShare() + { + return $this->container['earnings_per_diluted_share']; + } + + /** + * Sets earnings_per_diluted_share + * + * @param float|null $earnings_per_diluted_share earnings_per_diluted_share + * + * @return self + */ + public function setEarningsPerDilutedShare($earnings_per_diluted_share) + { + if (is_null($earnings_per_diluted_share)) { + throw new \InvalidArgumentException('non-nullable earnings_per_diluted_share cannot be null'); + } + $this->container['earnings_per_diluted_share'] = $earnings_per_diluted_share; + + return $this; + } + + /** + * Gets effect_of_exchange_rate_changes_on_cash + * + * @return int|null + */ + public function getEffectOfExchangeRateChangesOnCash() + { + return $this->container['effect_of_exchange_rate_changes_on_cash']; + } + + /** + * Sets effect_of_exchange_rate_changes_on_cash + * + * @param int|null $effect_of_exchange_rate_changes_on_cash effect_of_exchange_rate_changes_on_cash + * + * @return self + */ + public function setEffectOfExchangeRateChangesOnCash($effect_of_exchange_rate_changes_on_cash) + { + if (is_null($effect_of_exchange_rate_changes_on_cash)) { + throw new \InvalidArgumentException('non-nullable effect_of_exchange_rate_changes_on_cash cannot be null'); + } + $this->container['effect_of_exchange_rate_changes_on_cash'] = $effect_of_exchange_rate_changes_on_cash; + + return $this; + } + + /** + * Gets enterprise_value + * + * @return int|null + */ + public function getEnterpriseValue() + { + return $this->container['enterprise_value']; + } + + /** + * Sets enterprise_value + * + * @param int|null $enterprise_value enterprise_value + * + * @return self + */ + public function setEnterpriseValue($enterprise_value) + { + if (is_null($enterprise_value)) { + throw new \InvalidArgumentException('non-nullable enterprise_value cannot be null'); + } + $this->container['enterprise_value'] = $enterprise_value; + + return $this; + } + + /** + * Gets enterprise_value_over_ebit + * + * @return int|null + */ + public function getEnterpriseValueOverEbit() + { + return $this->container['enterprise_value_over_ebit']; + } + + /** + * Sets enterprise_value_over_ebit + * + * @param int|null $enterprise_value_over_ebit enterprise_value_over_ebit + * + * @return self + */ + public function setEnterpriseValueOverEbit($enterprise_value_over_ebit) + { + if (is_null($enterprise_value_over_ebit)) { + throw new \InvalidArgumentException('non-nullable enterprise_value_over_ebit cannot be null'); + } + $this->container['enterprise_value_over_ebit'] = $enterprise_value_over_ebit; + + return $this; + } + + /** + * Gets enterprise_value_over_ebitda + * + * @return float|null + */ + public function getEnterpriseValueOverEbitda() + { + return $this->container['enterprise_value_over_ebitda']; + } + + /** + * Sets enterprise_value_over_ebitda + * + * @param float|null $enterprise_value_over_ebitda enterprise_value_over_ebitda + * + * @return self + */ + public function setEnterpriseValueOverEbitda($enterprise_value_over_ebitda) + { + if (is_null($enterprise_value_over_ebitda)) { + throw new \InvalidArgumentException('non-nullable enterprise_value_over_ebitda cannot be null'); + } + $this->container['enterprise_value_over_ebitda'] = $enterprise_value_over_ebitda; + + return $this; + } + + /** + * Gets foreign_currency_usd_exchange_rate + * + * @return int|null + */ + public function getForeignCurrencyUsdExchangeRate() + { + return $this->container['foreign_currency_usd_exchange_rate']; + } + + /** + * Sets foreign_currency_usd_exchange_rate + * + * @param int|null $foreign_currency_usd_exchange_rate foreign_currency_usd_exchange_rate + * + * @return self + */ + public function setForeignCurrencyUsdExchangeRate($foreign_currency_usd_exchange_rate) + { + if (is_null($foreign_currency_usd_exchange_rate)) { + throw new \InvalidArgumentException('non-nullable foreign_currency_usd_exchange_rate cannot be null'); + } + $this->container['foreign_currency_usd_exchange_rate'] = $foreign_currency_usd_exchange_rate; + + return $this; + } + + /** + * Gets free_cash_flow + * + * @return int|null + */ + public function getFreeCashFlow() + { + return $this->container['free_cash_flow']; + } + + /** + * Sets free_cash_flow + * + * @param int|null $free_cash_flow free_cash_flow + * + * @return self + */ + public function setFreeCashFlow($free_cash_flow) + { + if (is_null($free_cash_flow)) { + throw new \InvalidArgumentException('non-nullable free_cash_flow cannot be null'); + } + $this->container['free_cash_flow'] = $free_cash_flow; + + return $this; + } + + /** + * Gets free_cash_flow_per_share + * + * @return float|null + */ + public function getFreeCashFlowPerShare() + { + return $this->container['free_cash_flow_per_share']; + } + + /** + * Sets free_cash_flow_per_share + * + * @param float|null $free_cash_flow_per_share free_cash_flow_per_share + * + * @return self + */ + public function setFreeCashFlowPerShare($free_cash_flow_per_share) + { + if (is_null($free_cash_flow_per_share)) { + throw new \InvalidArgumentException('non-nullable free_cash_flow_per_share cannot be null'); + } + $this->container['free_cash_flow_per_share'] = $free_cash_flow_per_share; + + return $this; + } + + /** + * Gets goodwill_and_intangible_assets + * + * @return int|null + */ + public function getGoodwillAndIntangibleAssets() + { + return $this->container['goodwill_and_intangible_assets']; + } + + /** + * Sets goodwill_and_intangible_assets + * + * @param int|null $goodwill_and_intangible_assets goodwill_and_intangible_assets + * + * @return self + */ + public function setGoodwillAndIntangibleAssets($goodwill_and_intangible_assets) + { + if (is_null($goodwill_and_intangible_assets)) { + throw new \InvalidArgumentException('non-nullable goodwill_and_intangible_assets cannot be null'); + } + $this->container['goodwill_and_intangible_assets'] = $goodwill_and_intangible_assets; + + return $this; + } + + /** + * Gets gross_margin + * + * @return float|null + */ + public function getGrossMargin() + { + return $this->container['gross_margin']; + } + + /** + * Sets gross_margin + * + * @param float|null $gross_margin gross_margin + * + * @return self + */ + public function setGrossMargin($gross_margin) + { + if (is_null($gross_margin)) { + throw new \InvalidArgumentException('non-nullable gross_margin cannot be null'); + } + $this->container['gross_margin'] = $gross_margin; + + return $this; + } + + /** + * Gets gross_profit + * + * @return int|null + */ + public function getGrossProfit() + { + return $this->container['gross_profit']; + } + + /** + * Sets gross_profit + * + * @param int|null $gross_profit gross_profit + * + * @return self + */ + public function setGrossProfit($gross_profit) + { + if (is_null($gross_profit)) { + throw new \InvalidArgumentException('non-nullable gross_profit cannot be null'); + } + $this->container['gross_profit'] = $gross_profit; + + return $this; + } + + /** + * Gets income_tax_expense + * + * @return int|null + */ + public function getIncomeTaxExpense() + { + return $this->container['income_tax_expense']; + } + + /** + * Sets income_tax_expense + * + * @param int|null $income_tax_expense income_tax_expense + * + * @return self + */ + public function setIncomeTaxExpense($income_tax_expense) + { + if (is_null($income_tax_expense)) { + throw new \InvalidArgumentException('non-nullable income_tax_expense cannot be null'); + } + $this->container['income_tax_expense'] = $income_tax_expense; + + return $this; + } + + /** + * Gets interest_expense + * + * @return int|null + */ + public function getInterestExpense() + { + return $this->container['interest_expense']; + } + + /** + * Sets interest_expense + * + * @param int|null $interest_expense interest_expense + * + * @return self + */ + public function setInterestExpense($interest_expense) + { + if (is_null($interest_expense)) { + throw new \InvalidArgumentException('non-nullable interest_expense cannot be null'); + } + $this->container['interest_expense'] = $interest_expense; + + return $this; + } + + /** + * Gets inventory + * + * @return int|null + */ + public function getInventory() + { + return $this->container['inventory']; + } + + /** + * Sets inventory + * + * @param int|null $inventory inventory + * + * @return self + */ + public function setInventory($inventory) + { + if (is_null($inventory)) { + throw new \InvalidArgumentException('non-nullable inventory cannot be null'); + } + $this->container['inventory'] = $inventory; + + return $this; + } + + /** + * Gets invested_capital + * + * @return int|null + */ + public function getInvestedCapital() + { + return $this->container['invested_capital']; + } + + /** + * Sets invested_capital + * + * @param int|null $invested_capital invested_capital + * + * @return self + */ + public function setInvestedCapital($invested_capital) + { + if (is_null($invested_capital)) { + throw new \InvalidArgumentException('non-nullable invested_capital cannot be null'); + } + $this->container['invested_capital'] = $invested_capital; + + return $this; + } + + /** + * Gets invested_capital_average + * + * @return int|null + */ + public function getInvestedCapitalAverage() + { + return $this->container['invested_capital_average']; + } + + /** + * Sets invested_capital_average + * + * @param int|null $invested_capital_average invested_capital_average + * + * @return self + */ + public function setInvestedCapitalAverage($invested_capital_average) + { + if (is_null($invested_capital_average)) { + throw new \InvalidArgumentException('non-nullable invested_capital_average cannot be null'); + } + $this->container['invested_capital_average'] = $invested_capital_average; + + return $this; + } + + /** + * Gets investments + * + * @return int|null + */ + public function getInvestments() + { + return $this->container['investments']; + } + + /** + * Sets investments + * + * @param int|null $investments investments + * + * @return self + */ + public function setInvestments($investments) + { + if (is_null($investments)) { + throw new \InvalidArgumentException('non-nullable investments cannot be null'); + } + $this->container['investments'] = $investments; + + return $this; + } + + /** + * Gets investments_current + * + * @return int|null + */ + public function getInvestmentsCurrent() + { + return $this->container['investments_current']; + } + + /** + * Sets investments_current + * + * @param int|null $investments_current investments_current + * + * @return self + */ + public function setInvestmentsCurrent($investments_current) + { + if (is_null($investments_current)) { + throw new \InvalidArgumentException('non-nullable investments_current cannot be null'); + } + $this->container['investments_current'] = $investments_current; + + return $this; + } + + /** + * Gets investments_non_current + * + * @return int|null + */ + public function getInvestmentsNonCurrent() + { + return $this->container['investments_non_current']; + } + + /** + * Sets investments_non_current + * + * @param int|null $investments_non_current investments_non_current + * + * @return self + */ + public function setInvestmentsNonCurrent($investments_non_current) + { + if (is_null($investments_non_current)) { + throw new \InvalidArgumentException('non-nullable investments_non_current cannot be null'); + } + $this->container['investments_non_current'] = $investments_non_current; + + return $this; + } + + /** + * Gets issuance_debt_securities + * + * @return int|null + */ + public function getIssuanceDebtSecurities() + { + return $this->container['issuance_debt_securities']; + } + + /** + * Sets issuance_debt_securities + * + * @param int|null $issuance_debt_securities issuance_debt_securities + * + * @return self + */ + public function setIssuanceDebtSecurities($issuance_debt_securities) + { + if (is_null($issuance_debt_securities)) { + throw new \InvalidArgumentException('non-nullable issuance_debt_securities cannot be null'); + } + $this->container['issuance_debt_securities'] = $issuance_debt_securities; + + return $this; + } + + /** + * Gets issuance_equity_shares + * + * @return int|null + */ + public function getIssuanceEquityShares() + { + return $this->container['issuance_equity_shares']; + } + + /** + * Sets issuance_equity_shares + * + * @param int|null $issuance_equity_shares issuance_equity_shares + * + * @return self + */ + public function setIssuanceEquityShares($issuance_equity_shares) + { + if (is_null($issuance_equity_shares)) { + throw new \InvalidArgumentException('non-nullable issuance_equity_shares cannot be null'); + } + $this->container['issuance_equity_shares'] = $issuance_equity_shares; + + return $this; + } + + /** + * Gets liabilities_non_current + * + * @return int|null + */ + public function getLiabilitiesNonCurrent() + { + return $this->container['liabilities_non_current']; + } + + /** + * Sets liabilities_non_current + * + * @param int|null $liabilities_non_current liabilities_non_current + * + * @return self + */ + public function setLiabilitiesNonCurrent($liabilities_non_current) + { + if (is_null($liabilities_non_current)) { + throw new \InvalidArgumentException('non-nullable liabilities_non_current cannot be null'); + } + $this->container['liabilities_non_current'] = $liabilities_non_current; + + return $this; + } + + /** + * Gets market_capitalization + * + * @return int|null + */ + public function getMarketCapitalization() + { + return $this->container['market_capitalization']; + } + + /** + * Sets market_capitalization + * + * @param int|null $market_capitalization market_capitalization + * + * @return self + */ + public function setMarketCapitalization($market_capitalization) + { + if (is_null($market_capitalization)) { + throw new \InvalidArgumentException('non-nullable market_capitalization cannot be null'); + } + $this->container['market_capitalization'] = $market_capitalization; + + return $this; + } + + /** + * Gets net_cash_flow + * + * @return int|null + */ + public function getNetCashFlow() + { + return $this->container['net_cash_flow']; + } + + /** + * Sets net_cash_flow + * + * @param int|null $net_cash_flow net_cash_flow + * + * @return self + */ + public function setNetCashFlow($net_cash_flow) + { + if (is_null($net_cash_flow)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow cannot be null'); + } + $this->container['net_cash_flow'] = $net_cash_flow; + + return $this; + } + + /** + * Gets net_cash_flow_business_acquisitions_disposals + * + * @return int|null + */ + public function getNetCashFlowBusinessAcquisitionsDisposals() + { + return $this->container['net_cash_flow_business_acquisitions_disposals']; + } + + /** + * Sets net_cash_flow_business_acquisitions_disposals + * + * @param int|null $net_cash_flow_business_acquisitions_disposals net_cash_flow_business_acquisitions_disposals + * + * @return self + */ + public function setNetCashFlowBusinessAcquisitionsDisposals($net_cash_flow_business_acquisitions_disposals) + { + if (is_null($net_cash_flow_business_acquisitions_disposals)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow_business_acquisitions_disposals cannot be null'); + } + $this->container['net_cash_flow_business_acquisitions_disposals'] = $net_cash_flow_business_acquisitions_disposals; + + return $this; + } + + /** + * Gets net_cash_flow_from_financing + * + * @return int|null + */ + public function getNetCashFlowFromFinancing() + { + return $this->container['net_cash_flow_from_financing']; + } + + /** + * Sets net_cash_flow_from_financing + * + * @param int|null $net_cash_flow_from_financing net_cash_flow_from_financing + * + * @return self + */ + public function setNetCashFlowFromFinancing($net_cash_flow_from_financing) + { + if (is_null($net_cash_flow_from_financing)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow_from_financing cannot be null'); + } + $this->container['net_cash_flow_from_financing'] = $net_cash_flow_from_financing; + + return $this; + } + + /** + * Gets net_cash_flow_from_investing + * + * @return int|null + */ + public function getNetCashFlowFromInvesting() + { + return $this->container['net_cash_flow_from_investing']; + } + + /** + * Sets net_cash_flow_from_investing + * + * @param int|null $net_cash_flow_from_investing net_cash_flow_from_investing + * + * @return self + */ + public function setNetCashFlowFromInvesting($net_cash_flow_from_investing) + { + if (is_null($net_cash_flow_from_investing)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow_from_investing cannot be null'); + } + $this->container['net_cash_flow_from_investing'] = $net_cash_flow_from_investing; + + return $this; + } + + /** + * Gets net_cash_flow_from_operations + * + * @return int|null + */ + public function getNetCashFlowFromOperations() + { + return $this->container['net_cash_flow_from_operations']; + } + + /** + * Sets net_cash_flow_from_operations + * + * @param int|null $net_cash_flow_from_operations net_cash_flow_from_operations + * + * @return self + */ + public function setNetCashFlowFromOperations($net_cash_flow_from_operations) + { + if (is_null($net_cash_flow_from_operations)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow_from_operations cannot be null'); + } + $this->container['net_cash_flow_from_operations'] = $net_cash_flow_from_operations; + + return $this; + } + + /** + * Gets net_cash_flow_investment_acquisitions_disposals + * + * @return int|null + */ + public function getNetCashFlowInvestmentAcquisitionsDisposals() + { + return $this->container['net_cash_flow_investment_acquisitions_disposals']; + } + + /** + * Sets net_cash_flow_investment_acquisitions_disposals + * + * @param int|null $net_cash_flow_investment_acquisitions_disposals net_cash_flow_investment_acquisitions_disposals + * + * @return self + */ + public function setNetCashFlowInvestmentAcquisitionsDisposals($net_cash_flow_investment_acquisitions_disposals) + { + if (is_null($net_cash_flow_investment_acquisitions_disposals)) { + throw new \InvalidArgumentException('non-nullable net_cash_flow_investment_acquisitions_disposals cannot be null'); + } + $this->container['net_cash_flow_investment_acquisitions_disposals'] = $net_cash_flow_investment_acquisitions_disposals; + + return $this; + } + + /** + * Gets net_income + * + * @return int|null + */ + public function getNetIncome() + { + return $this->container['net_income']; + } + + /** + * Sets net_income + * + * @param int|null $net_income net_income + * + * @return self + */ + public function setNetIncome($net_income) + { + if (is_null($net_income)) { + throw new \InvalidArgumentException('non-nullable net_income cannot be null'); + } + $this->container['net_income'] = $net_income; + + return $this; + } + + /** + * Gets net_income_common_stock + * + * @return int|null + */ + public function getNetIncomeCommonStock() + { + return $this->container['net_income_common_stock']; + } + + /** + * Sets net_income_common_stock + * + * @param int|null $net_income_common_stock net_income_common_stock + * + * @return self + */ + public function setNetIncomeCommonStock($net_income_common_stock) + { + if (is_null($net_income_common_stock)) { + throw new \InvalidArgumentException('non-nullable net_income_common_stock cannot be null'); + } + $this->container['net_income_common_stock'] = $net_income_common_stock; + + return $this; + } + + /** + * Gets net_income_common_stock_usd + * + * @return int|null + */ + public function getNetIncomeCommonStockUsd() + { + return $this->container['net_income_common_stock_usd']; + } + + /** + * Sets net_income_common_stock_usd + * + * @param int|null $net_income_common_stock_usd net_income_common_stock_usd + * + * @return self + */ + public function setNetIncomeCommonStockUsd($net_income_common_stock_usd) + { + if (is_null($net_income_common_stock_usd)) { + throw new \InvalidArgumentException('non-nullable net_income_common_stock_usd cannot be null'); + } + $this->container['net_income_common_stock_usd'] = $net_income_common_stock_usd; + + return $this; + } + + /** + * Gets net_income_to_non_controlling_interests + * + * @return int|null + */ + public function getNetIncomeToNonControllingInterests() + { + return $this->container['net_income_to_non_controlling_interests']; + } + + /** + * Sets net_income_to_non_controlling_interests + * + * @param int|null $net_income_to_non_controlling_interests net_income_to_non_controlling_interests + * + * @return self + */ + public function setNetIncomeToNonControllingInterests($net_income_to_non_controlling_interests) + { + if (is_null($net_income_to_non_controlling_interests)) { + throw new \InvalidArgumentException('non-nullable net_income_to_non_controlling_interests cannot be null'); + } + $this->container['net_income_to_non_controlling_interests'] = $net_income_to_non_controlling_interests; + + return $this; + } + + /** + * Gets net_loss_income_from_discontinued_operations + * + * @return int|null + */ + public function getNetLossIncomeFromDiscontinuedOperations() + { + return $this->container['net_loss_income_from_discontinued_operations']; + } + + /** + * Sets net_loss_income_from_discontinued_operations + * + * @param int|null $net_loss_income_from_discontinued_operations net_loss_income_from_discontinued_operations + * + * @return self + */ + public function setNetLossIncomeFromDiscontinuedOperations($net_loss_income_from_discontinued_operations) + { + if (is_null($net_loss_income_from_discontinued_operations)) { + throw new \InvalidArgumentException('non-nullable net_loss_income_from_discontinued_operations cannot be null'); + } + $this->container['net_loss_income_from_discontinued_operations'] = $net_loss_income_from_discontinued_operations; + + return $this; + } + + /** + * Gets operating_expenses + * + * @return int|null + */ + public function getOperatingExpenses() + { + return $this->container['operating_expenses']; + } + + /** + * Sets operating_expenses + * + * @param int|null $operating_expenses operating_expenses + * + * @return self + */ + public function setOperatingExpenses($operating_expenses) + { + if (is_null($operating_expenses)) { + throw new \InvalidArgumentException('non-nullable operating_expenses cannot be null'); + } + $this->container['operating_expenses'] = $operating_expenses; + + return $this; + } + + /** + * Gets operating_income + * + * @return int|null + */ + public function getOperatingIncome() + { + return $this->container['operating_income']; + } + + /** + * Sets operating_income + * + * @param int|null $operating_income operating_income + * + * @return self + */ + public function setOperatingIncome($operating_income) + { + if (is_null($operating_income)) { + throw new \InvalidArgumentException('non-nullable operating_income cannot be null'); + } + $this->container['operating_income'] = $operating_income; + + return $this; + } + + /** + * Gets payment_dividends_other_cash_distributions + * + * @return int|null + */ + public function getPaymentDividendsOtherCashDistributions() + { + return $this->container['payment_dividends_other_cash_distributions']; + } + + /** + * Sets payment_dividends_other_cash_distributions + * + * @param int|null $payment_dividends_other_cash_distributions payment_dividends_other_cash_distributions + * + * @return self + */ + public function setPaymentDividendsOtherCashDistributions($payment_dividends_other_cash_distributions) + { + if (is_null($payment_dividends_other_cash_distributions)) { + throw new \InvalidArgumentException('non-nullable payment_dividends_other_cash_distributions cannot be null'); + } + $this->container['payment_dividends_other_cash_distributions'] = $payment_dividends_other_cash_distributions; + + return $this; + } + + /** + * Gets payout_ratio + * + * @return int|null + */ + public function getPayoutRatio() + { + return $this->container['payout_ratio']; + } + + /** + * Sets payout_ratio + * + * @param int|null $payout_ratio payout_ratio + * + * @return self + */ + public function setPayoutRatio($payout_ratio) + { + if (is_null($payout_ratio)) { + throw new \InvalidArgumentException('non-nullable payout_ratio cannot be null'); + } + $this->container['payout_ratio'] = $payout_ratio; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period Reporting period. + * + * @return self + */ + public function setPeriod($period) + { + if (is_null($period)) { + throw new \InvalidArgumentException('non-nullable period cannot be null'); + } + $allowedValues = $this->getPeriodAllowableValues(); + if (!in_array($period, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'period', must be one of '%s'", + $period, + implode("', '", $allowedValues) + ) + ); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets preferred_dividends_income_statement_impact + * + * @return int|null + */ + public function getPreferredDividendsIncomeStatementImpact() + { + return $this->container['preferred_dividends_income_statement_impact']; + } + + /** + * Sets preferred_dividends_income_statement_impact + * + * @param int|null $preferred_dividends_income_statement_impact preferred_dividends_income_statement_impact + * + * @return self + */ + public function setPreferredDividendsIncomeStatementImpact($preferred_dividends_income_statement_impact) + { + if (is_null($preferred_dividends_income_statement_impact)) { + throw new \InvalidArgumentException('non-nullable preferred_dividends_income_statement_impact cannot be null'); + } + $this->container['preferred_dividends_income_statement_impact'] = $preferred_dividends_income_statement_impact; + + return $this; + } + + /** + * Gets price_earnings + * + * @return float|null + */ + public function getPriceEarnings() + { + return $this->container['price_earnings']; + } + + /** + * Sets price_earnings + * + * @param float|null $price_earnings price_earnings + * + * @return self + */ + public function setPriceEarnings($price_earnings) + { + if (is_null($price_earnings)) { + throw new \InvalidArgumentException('non-nullable price_earnings cannot be null'); + } + $this->container['price_earnings'] = $price_earnings; + + return $this; + } + + /** + * Gets price_sales + * + * @return float|null + */ + public function getPriceSales() + { + return $this->container['price_sales']; + } + + /** + * Sets price_sales + * + * @param float|null $price_sales price_sales + * + * @return self + */ + public function setPriceSales($price_sales) + { + if (is_null($price_sales)) { + throw new \InvalidArgumentException('non-nullable price_sales cannot be null'); + } + $this->container['price_sales'] = $price_sales; + + return $this; + } + + /** + * Gets price_to_book_value + * + * @return float|null + */ + public function getPriceToBookValue() + { + return $this->container['price_to_book_value']; + } + + /** + * Sets price_to_book_value + * + * @param float|null $price_to_book_value price_to_book_value + * + * @return self + */ + public function setPriceToBookValue($price_to_book_value) + { + if (is_null($price_to_book_value)) { + throw new \InvalidArgumentException('non-nullable price_to_book_value cannot be null'); + } + $this->container['price_to_book_value'] = $price_to_book_value; + + return $this; + } + + /** + * Gets price_to_earnings_ratio + * + * @return float|null + */ + public function getPriceToEarningsRatio() + { + return $this->container['price_to_earnings_ratio']; + } + + /** + * Sets price_to_earnings_ratio + * + * @param float|null $price_to_earnings_ratio price_to_earnings_ratio + * + * @return self + */ + public function setPriceToEarningsRatio($price_to_earnings_ratio) + { + if (is_null($price_to_earnings_ratio)) { + throw new \InvalidArgumentException('non-nullable price_to_earnings_ratio cannot be null'); + } + $this->container['price_to_earnings_ratio'] = $price_to_earnings_ratio; + + return $this; + } + + /** + * Gets price_to_sales_ratio + * + * @return float|null + */ + public function getPriceToSalesRatio() + { + return $this->container['price_to_sales_ratio']; + } + + /** + * Sets price_to_sales_ratio + * + * @param float|null $price_to_sales_ratio price_to_sales_ratio + * + * @return self + */ + public function setPriceToSalesRatio($price_to_sales_ratio) + { + if (is_null($price_to_sales_ratio)) { + throw new \InvalidArgumentException('non-nullable price_to_sales_ratio cannot be null'); + } + $this->container['price_to_sales_ratio'] = $price_to_sales_ratio; + + return $this; + } + + /** + * Gets profit_margin + * + * @return float|null + */ + public function getProfitMargin() + { + return $this->container['profit_margin']; + } + + /** + * Sets profit_margin + * + * @param float|null $profit_margin profit_margin + * + * @return self + */ + public function setProfitMargin($profit_margin) + { + if (is_null($profit_margin)) { + throw new \InvalidArgumentException('non-nullable profit_margin cannot be null'); + } + $this->container['profit_margin'] = $profit_margin; + + return $this; + } + + /** + * Gets property_plant_equipment_net + * + * @return int|null + */ + public function getPropertyPlantEquipmentNet() + { + return $this->container['property_plant_equipment_net']; + } + + /** + * Sets property_plant_equipment_net + * + * @param int|null $property_plant_equipment_net property_plant_equipment_net + * + * @return self + */ + public function setPropertyPlantEquipmentNet($property_plant_equipment_net) + { + if (is_null($property_plant_equipment_net)) { + throw new \InvalidArgumentException('non-nullable property_plant_equipment_net cannot be null'); + } + $this->container['property_plant_equipment_net'] = $property_plant_equipment_net; + + return $this; + } + + /** + * Gets report_period + * + * @return \DateTime|null + */ + public function getReportPeriod() + { + return $this->container['report_period']; + } + + /** + * Sets report_period + * + * @param \DateTime|null $report_period report_period + * + * @return self + */ + public function setReportPeriod($report_period) + { + if (is_null($report_period)) { + throw new \InvalidArgumentException('non-nullable report_period cannot be null'); + } + $this->container['report_period'] = $report_period; + + return $this; + } + + /** + * Gets research_and_development_expense + * + * @return int|null + */ + public function getResearchAndDevelopmentExpense() + { + return $this->container['research_and_development_expense']; + } + + /** + * Sets research_and_development_expense + * + * @param int|null $research_and_development_expense research_and_development_expense + * + * @return self + */ + public function setResearchAndDevelopmentExpense($research_and_development_expense) + { + if (is_null($research_and_development_expense)) { + throw new \InvalidArgumentException('non-nullable research_and_development_expense cannot be null'); + } + $this->container['research_and_development_expense'] = $research_and_development_expense; + + return $this; + } + + /** + * Gets return_on_average_assets + * + * @return int|null + */ + public function getReturnOnAverageAssets() + { + return $this->container['return_on_average_assets']; + } + + /** + * Sets return_on_average_assets + * + * @param int|null $return_on_average_assets return_on_average_assets + * + * @return self + */ + public function setReturnOnAverageAssets($return_on_average_assets) + { + if (is_null($return_on_average_assets)) { + throw new \InvalidArgumentException('non-nullable return_on_average_assets cannot be null'); + } + $this->container['return_on_average_assets'] = $return_on_average_assets; + + return $this; + } + + /** + * Gets return_on_average_equity + * + * @return int|null + */ + public function getReturnOnAverageEquity() + { + return $this->container['return_on_average_equity']; + } + + /** + * Sets return_on_average_equity + * + * @param int|null $return_on_average_equity return_on_average_equity + * + * @return self + */ + public function setReturnOnAverageEquity($return_on_average_equity) + { + if (is_null($return_on_average_equity)) { + throw new \InvalidArgumentException('non-nullable return_on_average_equity cannot be null'); + } + $this->container['return_on_average_equity'] = $return_on_average_equity; + + return $this; + } + + /** + * Gets return_on_invested_capital + * + * @return int|null + */ + public function getReturnOnInvestedCapital() + { + return $this->container['return_on_invested_capital']; + } + + /** + * Sets return_on_invested_capital + * + * @param int|null $return_on_invested_capital return_on_invested_capital + * + * @return self + */ + public function setReturnOnInvestedCapital($return_on_invested_capital) + { + if (is_null($return_on_invested_capital)) { + throw new \InvalidArgumentException('non-nullable return_on_invested_capital cannot be null'); + } + $this->container['return_on_invested_capital'] = $return_on_invested_capital; + + return $this; + } + + /** + * Gets return_on_sales + * + * @return float|null + */ + public function getReturnOnSales() + { + return $this->container['return_on_sales']; + } + + /** + * Sets return_on_sales + * + * @param float|null $return_on_sales return_on_sales + * + * @return self + */ + public function setReturnOnSales($return_on_sales) + { + if (is_null($return_on_sales)) { + throw new \InvalidArgumentException('non-nullable return_on_sales cannot be null'); + } + $this->container['return_on_sales'] = $return_on_sales; + + return $this; + } + + /** + * Gets revenues + * + * @return int|null + */ + public function getRevenues() + { + return $this->container['revenues']; + } + + /** + * Sets revenues + * + * @param int|null $revenues revenues + * + * @return self + */ + public function setRevenues($revenues) + { + if (is_null($revenues)) { + throw new \InvalidArgumentException('non-nullable revenues cannot be null'); + } + $this->container['revenues'] = $revenues; + + return $this; + } + + /** + * Gets revenues_usd + * + * @return int|null + */ + public function getRevenuesUsd() + { + return $this->container['revenues_usd']; + } + + /** + * Sets revenues_usd + * + * @param int|null $revenues_usd revenues_usd + * + * @return self + */ + public function setRevenuesUsd($revenues_usd) + { + if (is_null($revenues_usd)) { + throw new \InvalidArgumentException('non-nullable revenues_usd cannot be null'); + } + $this->container['revenues_usd'] = $revenues_usd; + + return $this; + } + + /** + * Gets sales_per_share + * + * @return float|null + */ + public function getSalesPerShare() + { + return $this->container['sales_per_share']; + } + + /** + * Sets sales_per_share + * + * @param float|null $sales_per_share sales_per_share + * + * @return self + */ + public function setSalesPerShare($sales_per_share) + { + if (is_null($sales_per_share)) { + throw new \InvalidArgumentException('non-nullable sales_per_share cannot be null'); + } + $this->container['sales_per_share'] = $sales_per_share; + + return $this; + } + + /** + * Gets selling_general_and_administrative_expense + * + * @return int|null + */ + public function getSellingGeneralAndAdministrativeExpense() + { + return $this->container['selling_general_and_administrative_expense']; + } + + /** + * Sets selling_general_and_administrative_expense + * + * @param int|null $selling_general_and_administrative_expense selling_general_and_administrative_expense + * + * @return self + */ + public function setSellingGeneralAndAdministrativeExpense($selling_general_and_administrative_expense) + { + if (is_null($selling_general_and_administrative_expense)) { + throw new \InvalidArgumentException('non-nullable selling_general_and_administrative_expense cannot be null'); + } + $this->container['selling_general_and_administrative_expense'] = $selling_general_and_administrative_expense; + + return $this; + } + + /** + * Gets share_based_compensation + * + * @return int|null + */ + public function getShareBasedCompensation() + { + return $this->container['share_based_compensation']; + } + + /** + * Sets share_based_compensation + * + * @param int|null $share_based_compensation share_based_compensation + * + * @return self + */ + public function setShareBasedCompensation($share_based_compensation) + { + if (is_null($share_based_compensation)) { + throw new \InvalidArgumentException('non-nullable share_based_compensation cannot be null'); + } + $this->container['share_based_compensation'] = $share_based_compensation; + + return $this; + } + + /** + * Gets share_factor + * + * @return int|null + */ + public function getShareFactor() + { + return $this->container['share_factor']; + } + + /** + * Sets share_factor + * + * @param int|null $share_factor share_factor + * + * @return self + */ + public function setShareFactor($share_factor) + { + if (is_null($share_factor)) { + throw new \InvalidArgumentException('non-nullable share_factor cannot be null'); + } + $this->container['share_factor'] = $share_factor; + + return $this; + } + + /** + * Gets share_price_adjusted_close + * + * @return float|null + */ + public function getSharePriceAdjustedClose() + { + return $this->container['share_price_adjusted_close']; + } + + /** + * Sets share_price_adjusted_close + * + * @param float|null $share_price_adjusted_close share_price_adjusted_close + * + * @return self + */ + public function setSharePriceAdjustedClose($share_price_adjusted_close) + { + if (is_null($share_price_adjusted_close)) { + throw new \InvalidArgumentException('non-nullable share_price_adjusted_close cannot be null'); + } + $this->container['share_price_adjusted_close'] = $share_price_adjusted_close; + + return $this; + } + + /** + * Gets shareholders_equity + * + * @return int|null + */ + public function getShareholdersEquity() + { + return $this->container['shareholders_equity']; + } + + /** + * Sets shareholders_equity + * + * @param int|null $shareholders_equity shareholders_equity + * + * @return self + */ + public function setShareholdersEquity($shareholders_equity) + { + if (is_null($shareholders_equity)) { + throw new \InvalidArgumentException('non-nullable shareholders_equity cannot be null'); + } + $this->container['shareholders_equity'] = $shareholders_equity; + + return $this; + } + + /** + * Gets shareholders_equity_usd + * + * @return int|null + */ + public function getShareholdersEquityUsd() + { + return $this->container['shareholders_equity_usd']; + } + + /** + * Sets shareholders_equity_usd + * + * @param int|null $shareholders_equity_usd shareholders_equity_usd + * + * @return self + */ + public function setShareholdersEquityUsd($shareholders_equity_usd) + { + if (is_null($shareholders_equity_usd)) { + throw new \InvalidArgumentException('non-nullable shareholders_equity_usd cannot be null'); + } + $this->container['shareholders_equity_usd'] = $shareholders_equity_usd; + + return $this; + } + + /** + * Gets shares + * + * @return int|null + */ + public function getShares() + { + return $this->container['shares']; + } + + /** + * Sets shares + * + * @param int|null $shares shares + * + * @return self + */ + public function setShares($shares) + { + if (is_null($shares)) { + throw new \InvalidArgumentException('non-nullable shares cannot be null'); + } + $this->container['shares'] = $shares; + + return $this; + } + + /** + * Gets tangible_asset_value + * + * @return int|null + */ + public function getTangibleAssetValue() + { + return $this->container['tangible_asset_value']; + } + + /** + * Sets tangible_asset_value + * + * @param int|null $tangible_asset_value tangible_asset_value + * + * @return self + */ + public function setTangibleAssetValue($tangible_asset_value) + { + if (is_null($tangible_asset_value)) { + throw new \InvalidArgumentException('non-nullable tangible_asset_value cannot be null'); + } + $this->container['tangible_asset_value'] = $tangible_asset_value; + + return $this; + } + + /** + * Gets tangible_assets_book_value_per_share + * + * @return float|null + */ + public function getTangibleAssetsBookValuePerShare() + { + return $this->container['tangible_assets_book_value_per_share']; + } + + /** + * Sets tangible_assets_book_value_per_share + * + * @param float|null $tangible_assets_book_value_per_share tangible_assets_book_value_per_share + * + * @return self + */ + public function setTangibleAssetsBookValuePerShare($tangible_assets_book_value_per_share) + { + if (is_null($tangible_assets_book_value_per_share)) { + throw new \InvalidArgumentException('non-nullable tangible_assets_book_value_per_share cannot be null'); + } + $this->container['tangible_assets_book_value_per_share'] = $tangible_assets_book_value_per_share; + + return $this; + } + + /** + * Gets tax_assets + * + * @return int|null + */ + public function getTaxAssets() + { + return $this->container['tax_assets']; + } + + /** + * Sets tax_assets + * + * @param int|null $tax_assets tax_assets + * + * @return self + */ + public function setTaxAssets($tax_assets) + { + if (is_null($tax_assets)) { + throw new \InvalidArgumentException('non-nullable tax_assets cannot be null'); + } + $this->container['tax_assets'] = $tax_assets; + + return $this; + } + + /** + * Gets tax_liabilities + * + * @return int|null + */ + public function getTaxLiabilities() + { + return $this->container['tax_liabilities']; + } + + /** + * Sets tax_liabilities + * + * @param int|null $tax_liabilities tax_liabilities + * + * @return self + */ + public function setTaxLiabilities($tax_liabilities) + { + if (is_null($tax_liabilities)) { + throw new \InvalidArgumentException('non-nullable tax_liabilities cannot be null'); + } + $this->container['tax_liabilities'] = $tax_liabilities; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets total_liabilities + * + * @return int|null + */ + public function getTotalLiabilities() + { + return $this->container['total_liabilities']; + } + + /** + * Sets total_liabilities + * + * @param int|null $total_liabilities total_liabilities + * + * @return self + */ + public function setTotalLiabilities($total_liabilities) + { + if (is_null($total_liabilities)) { + throw new \InvalidArgumentException('non-nullable total_liabilities cannot be null'); + } + $this->container['total_liabilities'] = $total_liabilities; + + return $this; + } + + /** + * Gets trade_and_non_trade_payables + * + * @return int|null + */ + public function getTradeAndNonTradePayables() + { + return $this->container['trade_and_non_trade_payables']; + } + + /** + * Sets trade_and_non_trade_payables + * + * @param int|null $trade_and_non_trade_payables trade_and_non_trade_payables + * + * @return self + */ + public function setTradeAndNonTradePayables($trade_and_non_trade_payables) + { + if (is_null($trade_and_non_trade_payables)) { + throw new \InvalidArgumentException('non-nullable trade_and_non_trade_payables cannot be null'); + } + $this->container['trade_and_non_trade_payables'] = $trade_and_non_trade_payables; + + return $this; + } + + /** + * Gets trade_and_non_trade_receivables + * + * @return int|null + */ + public function getTradeAndNonTradeReceivables() + { + return $this->container['trade_and_non_trade_receivables']; + } + + /** + * Sets trade_and_non_trade_receivables + * + * @param int|null $trade_and_non_trade_receivables trade_and_non_trade_receivables + * + * @return self + */ + public function setTradeAndNonTradeReceivables($trade_and_non_trade_receivables) + { + if (is_null($trade_and_non_trade_receivables)) { + throw new \InvalidArgumentException('non-nullable trade_and_non_trade_receivables cannot be null'); + } + $this->container['trade_and_non_trade_receivables'] = $trade_and_non_trade_receivables; + + return $this; + } + + /** + * Gets updated + * + * @return \DateTime|null + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param \DateTime|null $updated updated + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + + /** + * Gets weighted_average_shares + * + * @return int|null + */ + public function getWeightedAverageShares() + { + return $this->container['weighted_average_shares']; + } + + /** + * Sets weighted_average_shares + * + * @param int|null $weighted_average_shares weighted_average_shares + * + * @return self + */ + public function setWeightedAverageShares($weighted_average_shares) + { + if (is_null($weighted_average_shares)) { + throw new \InvalidArgumentException('non-nullable weighted_average_shares cannot be null'); + } + $this->container['weighted_average_shares'] = $weighted_average_shares; + + return $this; + } + + /** + * Gets weighted_average_shares_diluted + * + * @return int|null + */ + public function getWeightedAverageSharesDiluted() + { + return $this->container['weighted_average_shares_diluted']; + } + + /** + * Sets weighted_average_shares_diluted + * + * @param int|null $weighted_average_shares_diluted weighted_average_shares_diluted + * + * @return self + */ + public function setWeightedAverageSharesDiluted($weighted_average_shares_diluted) + { + if (is_null($weighted_average_shares_diluted)) { + throw new \InvalidArgumentException('non-nullable weighted_average_shares_diluted cannot be null'); + } + $this->container['weighted_average_shares_diluted'] = $weighted_average_shares_diluted; + + return $this; + } + + /** + * Gets working_capital + * + * @return int|null + */ + public function getWorkingCapital() + { + return $this->container['working_capital']; + } + + /** + * Sets working_capital + * + * @param int|null $working_capital working_capital + * + * @return self + */ + public function setWorkingCapital($working_capital) + { + if (is_null($working_capital)) { + throw new \InvalidArgumentException('non-nullable working_capital cannot be null'); + } + $this->container['working_capital'] = $working_capital; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexConversion.php b/lib/Model/ForexConversion.php new file mode 100644 index 0000000..6b6ce1d --- /dev/null +++ b/lib/Model/ForexConversion.php @@ -0,0 +1,557 @@ + + */ +class ForexConversion implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexConversion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'converted' => 'float', + 'from' => 'string', + 'initial_amount' => 'float', + 'last' => '\OpenAPI\Client\Model\ForexConversionLast', + 'to' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'converted' => 'double', + 'from' => null, + 'initial_amount' => 'double', + 'last' => null, + 'to' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'converted' => false, + 'from' => false, + 'initial_amount' => false, + 'last' => false, + 'to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'converted' => 'converted', + 'from' => 'from', + 'initial_amount' => 'initialAmount', + 'last' => 'last', + 'to' => 'to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'converted' => 'setConverted', + 'from' => 'setFrom', + 'initial_amount' => 'setInitialAmount', + 'last' => 'setLast', + 'to' => 'setTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'converted' => 'getConverted', + 'from' => 'getFrom', + 'initial_amount' => 'getInitialAmount', + 'last' => 'getLast', + 'to' => 'getTo' + ]; + + /** + * 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->setIfExists('converted', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('initial_amount', $data ?? [], null); + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['converted'] === null) { + $invalidProperties[] = "'converted' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['initial_amount'] === null) { + $invalidProperties[] = "'initial_amount' can't be null"; + } + if ($this->container['to'] === null) { + $invalidProperties[] = "'to' can't be null"; + } + 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 converted + * + * @return float + */ + public function getConverted() + { + return $this->container['converted']; + } + + /** + * Sets converted + * + * @param float $converted The result of the conversion. + * + * @return self + */ + public function setConverted($converted) + { + if (is_null($converted)) { + throw new \InvalidArgumentException('non-nullable converted cannot be null'); + } + $this->container['converted'] = $converted; + + return $this; + } + + /** + * Gets from + * + * @return string + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param string $from The \"from\" currency symbol. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets initial_amount + * + * @return float + */ + public function getInitialAmount() + { + return $this->container['initial_amount']; + } + + /** + * Sets initial_amount + * + * @param float $initial_amount The amount to convert. + * + * @return self + */ + public function setInitialAmount($initial_amount) + { + if (is_null($initial_amount)) { + throw new \InvalidArgumentException('non-nullable initial_amount cannot be null'); + } + $this->container['initial_amount'] = $initial_amount; + + return $this; + } + + /** + * Gets last + * + * @return \OpenAPI\Client\Model\ForexConversionLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\ForexConversionLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets to + * + * @return string + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param string $to The \"to\" currency symbol. + * + * @return self + */ + public function setTo($to) + { + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexConversionLast.php b/lib/Model/ForexConversionLast.php new file mode 100644 index 0000000..dcf1f8c --- /dev/null +++ b/lib/Model/ForexConversionLast.php @@ -0,0 +1,523 @@ + + */ +class ForexConversionLast implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexConversion_last'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask' => 'float', + 'bid' => 'float', + 'exchange' => 'int', + 'timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask' => 'double', + 'bid' => 'double', + 'exchange' => null, + 'timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask' => false, + 'bid' => false, + 'exchange' => false, + 'timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask' => 'ask', + 'bid' => 'bid', + 'exchange' => 'exchange', + 'timestamp' => 'timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask' => 'setAsk', + 'bid' => 'setBid', + 'exchange' => 'setExchange', + 'timestamp' => 'setTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask' => 'getAsk', + 'bid' => 'getBid', + 'exchange' => 'getExchange', + 'timestamp' => 'getTimestamp' + ]; + + /** + * 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->setIfExists('ask', $data ?? [], null); + $this->setIfExists('bid', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ask'] === null) { + $invalidProperties[] = "'ask' can't be null"; + } + if ($this->container['bid'] === null) { + $invalidProperties[] = "'bid' can't be null"; + } + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + 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 ask + * + * @return float + */ + public function getAsk() + { + return $this->container['ask']; + } + + /** + * Sets ask + * + * @param float $ask The ask price. + * + * @return self + */ + public function setAsk($ask) + { + if (is_null($ask)) { + throw new \InvalidArgumentException('non-nullable ask cannot be null'); + } + $this->container['ask'] = $ask; + + return $this; + } + + /** + * Gets bid + * + * @return float + */ + public function getBid() + { + return $this->container['bid']; + } + + /** + * Sets bid + * + * @param float $bid The bid price. + * + * @return self + */ + public function setBid($bid) + { + if (is_null($bid)) { + throw new \InvalidArgumentException('non-nullable bid cannot be null'); + } + $this->container['bid'] = $bid; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexGroupedResults.php b/lib/Model/ForexGroupedResults.php new file mode 100644 index 0000000..2510631 --- /dev/null +++ b/lib/Model/ForexGroupedResults.php @@ -0,0 +1,409 @@ + + */ +class ForexGroupedResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexGroupedResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexHistoricTrades.php b/lib/Model/ForexHistoricTrades.php new file mode 100644 index 0000000..c7ef950 --- /dev/null +++ b/lib/Model/ForexHistoricTrades.php @@ -0,0 +1,560 @@ + + */ +class ForexHistoricTrades implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexHistoricTrades'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\DateTime', + 'map' => 'object', + 'ms_latency' => 'int', + 'pair' => 'string', + 'ticks' => '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => 'date', + 'map' => null, + 'ms_latency' => null, + 'pair' => null, + 'ticks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'map' => false, + 'ms_latency' => false, + 'pair' => false, + 'ticks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'map' => 'map', + 'ms_latency' => 'msLatency', + 'pair' => 'pair', + 'ticks' => 'ticks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'map' => 'setMap', + 'ms_latency' => 'setMsLatency', + 'pair' => 'setPair', + 'ticks' => 'setTicks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'map' => 'getMap', + 'ms_latency' => 'getMsLatency', + 'pair' => 'getPair', + 'ticks' => 'getTicks' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('map', $data ?? [], null); + $this->setIfExists('ms_latency', $data ?? [], null); + $this->setIfExists('pair', $data ?? [], null); + $this->setIfExists('ticks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['map'] === null) { + $invalidProperties[] = "'map' can't be null"; + } + if ($this->container['ms_latency'] === null) { + $invalidProperties[] = "'ms_latency' can't be null"; + } + if ($this->container['pair'] === null) { + $invalidProperties[] = "'pair' can't be null"; + } + if ($this->container['ticks'] === null) { + $invalidProperties[] = "'ticks' can't be null"; + } + 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 day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date that was evaluated from the request. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets map + * + * @return object + */ + public function getMap() + { + return $this->container['map']; + } + + /** + * Sets map + * + * @param object $map A map for shortened result keys. + * + * @return self + */ + public function setMap($map) + { + if (is_null($map)) { + throw new \InvalidArgumentException('non-nullable map cannot be null'); + } + $this->container['map'] = $map; + + return $this; + } + + /** + * Gets ms_latency + * + * @return int + */ + public function getMsLatency() + { + return $this->container['ms_latency']; + } + + /** + * Sets ms_latency + * + * @param int $ms_latency The milliseconds of latency for the query results. + * + * @return self + */ + public function setMsLatency($ms_latency) + { + if (is_null($ms_latency)) { + throw new \InvalidArgumentException('non-nullable ms_latency cannot be null'); + } + $this->container['ms_latency'] = $ms_latency; + + return $this; + } + + /** + * Gets pair + * + * @return string + */ + public function getPair() + { + return $this->container['pair']; + } + + /** + * Sets pair + * + * @param string $pair The currency pair that was evaluated from the request. + * + * @return self + */ + public function setPair($pair) + { + if (is_null($pair)) { + throw new \InvalidArgumentException('non-nullable pair cannot be null'); + } + $this->container['pair'] = $pair; + + return $this; + } + + /** + * Gets ticks + * + * @return \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getTicks() + { + return $this->container['ticks']; + } + + /** + * Sets ticks + * + * @param \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[] $ticks ticks + * + * @return self + */ + public function setTicks($ticks) + { + if (is_null($ticks)) { + throw new \InvalidArgumentException('non-nullable ticks cannot be null'); + } + $this->container['ticks'] = $ticks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexPairLastQuote.php b/lib/Model/ForexPairLastQuote.php new file mode 100644 index 0000000..cb2f4a6 --- /dev/null +++ b/lib/Model/ForexPairLastQuote.php @@ -0,0 +1,446 @@ + + */ +class ForexPairLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexPairLastQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'last' => '\OpenAPI\Client\Model\ForexConversionLast', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'last' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last' => 'last', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last' => 'setLast', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last' => 'getLast', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 last + * + * @return \OpenAPI\Client\Model\ForexConversionLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\ForexConversionLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexPreviousClose.php b/lib/Model/ForexPreviousClose.php new file mode 100644 index 0000000..5970deb --- /dev/null +++ b/lib/Model/ForexPreviousClose.php @@ -0,0 +1,409 @@ + + */ +class ForexPreviousClose implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexPreviousClose'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexSnapshotLastQuote.php b/lib/Model/ForexSnapshotLastQuote.php new file mode 100644 index 0000000..c48e290 --- /dev/null +++ b/lib/Model/ForexSnapshotLastQuote.php @@ -0,0 +1,523 @@ + + */ +class ForexSnapshotLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexSnapshotLastQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'a' => 'float', + 'b' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'a' => 'double', + 'b' => 'double', + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'a' => false, + 'b' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'a' => 'a', + 'b' => 'b', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'a' => 'setA', + 'b' => 'setB', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'a' => 'getA', + 'b' => 'getB', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('a', $data ?? [], null); + $this->setIfExists('b', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['a'] === null) { + $invalidProperties[] = "'a' can't be null"; + } + if ($this->container['b'] === null) { + $invalidProperties[] = "'b' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 a + * + * @return float + */ + public function getA() + { + return $this->container['a']; + } + + /** + * Sets a + * + * @param float $a The ask price. + * + * @return self + */ + public function setA($a) + { + if (is_null($a)) { + throw new \InvalidArgumentException('non-nullable a cannot be null'); + } + $this->container['a'] = $a; + + return $this; + } + + /** + * Gets b + * + * @return float + */ + public function getB() + { + return $this->container['b']; + } + + /** + * Sets b + * + * @param float $b The bid price. + * + * @return self + */ + public function setB($b) + { + if (is_null($b)) { + throw new \InvalidArgumentException('non-nullable b cannot be null'); + } + $this->container['b'] = $b; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The millisecond accuracy timestamp of the quote. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID on which this quote happened. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexSnapshotPrevDay.php b/lib/Model/ForexSnapshotPrevDay.php new file mode 100644 index 0000000..08300ed --- /dev/null +++ b/lib/Model/ForexSnapshotPrevDay.php @@ -0,0 +1,597 @@ + + */ +class ForexSnapshotPrevDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexSnapshotPrevDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexSnapshotTicker.php b/lib/Model/ForexSnapshotTicker.php new file mode 100644 index 0000000..48644bd --- /dev/null +++ b/lib/Model/ForexSnapshotTicker.php @@ -0,0 +1,409 @@ + + */ +class ForexSnapshotTicker implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexSnapshotTicker'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexSnapshotTickers.php b/lib/Model/ForexSnapshotTickers.php new file mode 100644 index 0000000..f3326e5 --- /dev/null +++ b/lib/Model/ForexSnapshotTickers.php @@ -0,0 +1,409 @@ + + */ +class ForexSnapshotTickers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexSnapshotTickers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ForexTickerResults.php b/lib/Model/ForexTickerResults.php new file mode 100644 index 0000000..b9d4ee5 --- /dev/null +++ b/lib/Model/ForexTickerResults.php @@ -0,0 +1,409 @@ + + */ +class ForexTickerResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexTickerResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetEvents200Response.php b/lib/Model/GetEvents200Response.php new file mode 100644 index 0000000..14ee0fd --- /dev/null +++ b/lib/Model/GetEvents200Response.php @@ -0,0 +1,477 @@ + + */ +class GetEvents200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetEvents_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\GetEvents200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\GetEvents200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\GetEvents200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetEvents200ResponseResults.php b/lib/Model/GetEvents200ResponseResults.php new file mode 100644 index 0000000..14220ce --- /dev/null +++ b/lib/Model/GetEvents200ResponseResults.php @@ -0,0 +1,443 @@ + + */ +class GetEvents200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetEvents_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'events' => '\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInner[]', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'events' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'events' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'events' => 'events', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents', + 'name' => 'getName' + ]; + + /** + * 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->setIfExists('events', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 events + * + * @return \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInner[]|null + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInner[]|null $events events + * + * @return self + */ + public function setEvents($events) + { + if (is_null($events)) { + throw new \InvalidArgumentException('non-nullable events cannot be null'); + } + $this->container['events'] = $events; + + 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) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetEvents200ResponseResultsEventsInner.php b/lib/Model/GetEvents200ResponseResultsEventsInner.php new file mode 100644 index 0000000..c1393ea --- /dev/null +++ b/lib/Model/GetEvents200ResponseResultsEventsInner.php @@ -0,0 +1,483 @@ + + */ +class GetEvents200ResponseResultsEventsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetEvents_200_response_results_events_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => '\DateTime', + 'event_type' => 'string', + 'ticker_change' => '\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => 'date', + 'event_type' => null, + 'ticker_change' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'event_type' => false, + 'ticker_change' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'event_type' => 'event_type', + 'ticker_change' => 'ticker_change' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'event_type' => 'setEventType', + 'ticker_change' => 'setTickerChange' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'event_type' => 'getEventType', + 'ticker_change' => 'getTickerChange' + ]; + + /** + * 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->setIfExists('date', $data ?? [], null); + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('ticker_change', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['event_type'] === null) { + $invalidProperties[] = "'event_type' can't be null"; + } + 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 date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date The date the event took place + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets event_type + * + * @return string + */ + public function getEventType() + { + return $this->container['event_type']; + } + + /** + * Sets event_type + * + * @param string $event_type The type of historical event for the asset + * + * @return self + */ + public function setEventType($event_type) + { + if (is_null($event_type)) { + throw new \InvalidArgumentException('non-nullable event_type cannot be null'); + } + $this->container['event_type'] = $event_type; + + return $this; + } + + /** + * Gets ticker_change + * + * @return \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange|null + */ + public function getTickerChange() + { + return $this->container['ticker_change']; + } + + /** + * Sets ticker_change + * + * @param \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange|null $ticker_change ticker_change + * + * @return self + */ + public function setTickerChange($ticker_change) + { + if (is_null($ticker_change)) { + throw new \InvalidArgumentException('non-nullable ticker_change cannot be null'); + } + $this->container['ticker_change'] = $ticker_change; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetEvents200ResponseResultsEventsInnerOneOf.php b/lib/Model/GetEvents200ResponseResultsEventsInnerOneOf.php new file mode 100644 index 0000000..c444bcc --- /dev/null +++ b/lib/Model/GetEvents200ResponseResultsEventsInnerOneOf.php @@ -0,0 +1,483 @@ + + */ +class GetEvents200ResponseResultsEventsInnerOneOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetEvents_200_response_results_events_inner_oneOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => '\DateTime', + 'event_type' => 'string', + 'ticker_change' => '\OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => 'date', + 'event_type' => null, + 'ticker_change' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'event_type' => false, + 'ticker_change' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'event_type' => 'event_type', + 'ticker_change' => 'ticker_change' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'event_type' => 'setEventType', + 'ticker_change' => 'setTickerChange' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'event_type' => 'getEventType', + 'ticker_change' => 'getTickerChange' + ]; + + /** + * 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->setIfExists('date', $data ?? [], null); + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('ticker_change', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['event_type'] === null) { + $invalidProperties[] = "'event_type' can't be null"; + } + 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 date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date The date the event took place + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets event_type + * + * @return string + */ + public function getEventType() + { + return $this->container['event_type']; + } + + /** + * Sets event_type + * + * @param string $event_type The type of historical event for the asset + * + * @return self + */ + public function setEventType($event_type) + { + if (is_null($event_type)) { + throw new \InvalidArgumentException('non-nullable event_type cannot be null'); + } + $this->container['event_type'] = $event_type; + + return $this; + } + + /** + * Gets ticker_change + * + * @return \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange|null + */ + public function getTickerChange() + { + return $this->container['ticker_change']; + } + + /** + * Sets ticker_change + * + * @param \OpenAPI\Client\Model\GetEvents200ResponseResultsEventsInnerOneOfTickerChange|null $ticker_change ticker_change + * + * @return self + */ + public function setTickerChange($ticker_change) + { + if (is_null($ticker_change)) { + throw new \InvalidArgumentException('non-nullable ticker_change cannot be null'); + } + $this->container['ticker_change'] = $ticker_change; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.php b/lib/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.php new file mode 100644 index 0000000..83e7041 --- /dev/null +++ b/lib/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChange.php @@ -0,0 +1,409 @@ + + */ +class GetEvents200ResponseResultsEventsInnerOneOfTickerChange implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetEvents_200_response_results_events_inner_oneOf_ticker_change'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetMarketHolidays200ResponseInner.php b/lib/Model/GetMarketHolidays200ResponseInner.php new file mode 100644 index 0000000..76d91a9 --- /dev/null +++ b/lib/Model/GetMarketHolidays200ResponseInner.php @@ -0,0 +1,579 @@ + + */ +class GetMarketHolidays200ResponseInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetMarketHolidays_200_response_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'close' => 'string', + 'date' => 'string', + 'exchange' => 'string', + 'name' => 'string', + 'open' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'close' => null, + 'date' => null, + 'exchange' => null, + 'name' => null, + 'open' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'close' => false, + 'date' => false, + 'exchange' => false, + 'name' => false, + 'open' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'close' => 'close', + 'date' => 'date', + 'exchange' => 'exchange', + 'name' => 'name', + 'open' => 'open', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'close' => 'setClose', + 'date' => 'setDate', + 'exchange' => 'setExchange', + 'name' => 'setName', + 'open' => 'setOpen', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'close' => 'getClose', + 'date' => 'getDate', + 'exchange' => 'getExchange', + 'name' => 'getName', + 'open' => 'getOpen', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('close', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 close + * + * @return string|null + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param string|null $close The market close time on the holiday (if it's not closed). + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets date + * + * @return string|null + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string|null $date The date of the holiday. + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange Which market the record is for. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the holiday. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets open + * + * @return string|null + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param string|null $open The market open time on the holiday (if it's not closed). + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the market on the holiday. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetMarketStatus200Response.php b/lib/Model/GetMarketStatus200Response.php new file mode 100644 index 0000000..2a57d75 --- /dev/null +++ b/lib/Model/GetMarketStatus200Response.php @@ -0,0 +1,613 @@ + + */ +class GetMarketStatus200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetMarketStatus_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after_hours' => 'bool', + 'currencies' => '\OpenAPI\Client\Model\GetMarketStatus200ResponseCurrencies', + 'early_hours' => 'bool', + 'exchanges' => '\OpenAPI\Client\Model\GetMarketStatus200ResponseExchanges', + 'indices_groups' => '\OpenAPI\Client\Model\GetMarketStatus200ResponseIndicesGroups', + 'market' => 'string', + 'server_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => null, + 'currencies' => null, + 'early_hours' => null, + 'exchanges' => null, + 'indices_groups' => null, + 'market' => null, + 'server_time' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'currencies' => false, + 'early_hours' => false, + 'exchanges' => false, + 'indices_groups' => false, + 'market' => false, + 'server_time' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'currencies' => 'currencies', + 'early_hours' => 'earlyHours', + 'exchanges' => 'exchanges', + 'indices_groups' => 'indicesGroups', + 'market' => 'market', + 'server_time' => 'serverTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'currencies' => 'setCurrencies', + 'early_hours' => 'setEarlyHours', + 'exchanges' => 'setExchanges', + 'indices_groups' => 'setIndicesGroups', + 'market' => 'setMarket', + 'server_time' => 'setServerTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'currencies' => 'getCurrencies', + 'early_hours' => 'getEarlyHours', + 'exchanges' => 'getExchanges', + 'indices_groups' => 'getIndicesGroups', + 'market' => 'getMarket', + 'server_time' => 'getServerTime' + ]; + + /** + * 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->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('early_hours', $data ?? [], null); + $this->setIfExists('exchanges', $data ?? [], null); + $this->setIfExists('indices_groups', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('server_time', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 after_hours + * + * @return bool|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param bool|null $after_hours Whether or not the market is in post-market hours. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets currencies + * + * @return \OpenAPI\Client\Model\GetMarketStatus200ResponseCurrencies|null + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param \OpenAPI\Client\Model\GetMarketStatus200ResponseCurrencies|null $currencies currencies + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets early_hours + * + * @return bool|null + */ + public function getEarlyHours() + { + return $this->container['early_hours']; + } + + /** + * Sets early_hours + * + * @param bool|null $early_hours Whether or not the market is in pre-market hours. + * + * @return self + */ + public function setEarlyHours($early_hours) + { + if (is_null($early_hours)) { + throw new \InvalidArgumentException('non-nullable early_hours cannot be null'); + } + $this->container['early_hours'] = $early_hours; + + return $this; + } + + /** + * Gets exchanges + * + * @return \OpenAPI\Client\Model\GetMarketStatus200ResponseExchanges|null + */ + public function getExchanges() + { + return $this->container['exchanges']; + } + + /** + * Sets exchanges + * + * @param \OpenAPI\Client\Model\GetMarketStatus200ResponseExchanges|null $exchanges exchanges + * + * @return self + */ + public function setExchanges($exchanges) + { + if (is_null($exchanges)) { + throw new \InvalidArgumentException('non-nullable exchanges cannot be null'); + } + $this->container['exchanges'] = $exchanges; + + return $this; + } + + /** + * Gets indices_groups + * + * @return \OpenAPI\Client\Model\GetMarketStatus200ResponseIndicesGroups|null + */ + public function getIndicesGroups() + { + return $this->container['indices_groups']; + } + + /** + * Sets indices_groups + * + * @param \OpenAPI\Client\Model\GetMarketStatus200ResponseIndicesGroups|null $indices_groups indices_groups + * + * @return self + */ + public function setIndicesGroups($indices_groups) + { + if (is_null($indices_groups)) { + throw new \InvalidArgumentException('non-nullable indices_groups cannot be null'); + } + $this->container['indices_groups'] = $indices_groups; + + return $this; + } + + /** + * Gets market + * + * @return string|null + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string|null $market The status of the market as a whole. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets server_time + * + * @return string|null + */ + public function getServerTime() + { + return $this->container['server_time']; + } + + /** + * Sets server_time + * + * @param string|null $server_time The current time of the server, returned as a date-time in RFC3339 format. + * + * @return self + */ + public function setServerTime($server_time) + { + if (is_null($server_time)) { + throw new \InvalidArgumentException('non-nullable server_time cannot be null'); + } + $this->container['server_time'] = $server_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetMarketStatus200ResponseCurrencies.php b/lib/Model/GetMarketStatus200ResponseCurrencies.php new file mode 100644 index 0000000..e4365d7 --- /dev/null +++ b/lib/Model/GetMarketStatus200ResponseCurrencies.php @@ -0,0 +1,443 @@ + + */ +class GetMarketStatus200ResponseCurrencies implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetMarketStatus_200_response_currencies'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'crypto' => 'string', + 'fx' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'crypto' => null, + 'fx' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'crypto' => false, + 'fx' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'crypto' => 'crypto', + 'fx' => 'fx' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'crypto' => 'setCrypto', + 'fx' => 'setFx' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'crypto' => 'getCrypto', + 'fx' => 'getFx' + ]; + + /** + * 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->setIfExists('crypto', $data ?? [], null); + $this->setIfExists('fx', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 crypto + * + * @return string|null + */ + public function getCrypto() + { + return $this->container['crypto']; + } + + /** + * Sets crypto + * + * @param string|null $crypto The status of the crypto market. + * + * @return self + */ + public function setCrypto($crypto) + { + if (is_null($crypto)) { + throw new \InvalidArgumentException('non-nullable crypto cannot be null'); + } + $this->container['crypto'] = $crypto; + + return $this; + } + + /** + * Gets fx + * + * @return string|null + */ + public function getFx() + { + return $this->container['fx']; + } + + /** + * Sets fx + * + * @param string|null $fx The status of the forex market. + * + * @return self + */ + public function setFx($fx) + { + if (is_null($fx)) { + throw new \InvalidArgumentException('non-nullable fx cannot be null'); + } + $this->container['fx'] = $fx; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetMarketStatus200ResponseExchanges.php b/lib/Model/GetMarketStatus200ResponseExchanges.php new file mode 100644 index 0000000..e6b1cc8 --- /dev/null +++ b/lib/Model/GetMarketStatus200ResponseExchanges.php @@ -0,0 +1,477 @@ + + */ +class GetMarketStatus200ResponseExchanges implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetMarketStatus_200_response_exchanges'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nasdaq' => 'string', + 'nyse' => 'string', + 'otc' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nasdaq' => null, + 'nyse' => null, + 'otc' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nasdaq' => false, + 'nyse' => false, + 'otc' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'nasdaq' => 'nasdaq', + 'nyse' => 'nyse', + 'otc' => 'otc' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nasdaq' => 'setNasdaq', + 'nyse' => 'setNyse', + 'otc' => 'setOtc' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nasdaq' => 'getNasdaq', + 'nyse' => 'getNyse', + 'otc' => 'getOtc' + ]; + + /** + * 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->setIfExists('nasdaq', $data ?? [], null); + $this->setIfExists('nyse', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 nasdaq + * + * @return string|null + */ + public function getNasdaq() + { + return $this->container['nasdaq']; + } + + /** + * Sets nasdaq + * + * @param string|null $nasdaq The status of the Nasdaq market. + * + * @return self + */ + public function setNasdaq($nasdaq) + { + if (is_null($nasdaq)) { + throw new \InvalidArgumentException('non-nullable nasdaq cannot be null'); + } + $this->container['nasdaq'] = $nasdaq; + + return $this; + } + + /** + * Gets nyse + * + * @return string|null + */ + public function getNyse() + { + return $this->container['nyse']; + } + + /** + * Sets nyse + * + * @param string|null $nyse The status of the NYSE market. + * + * @return self + */ + public function setNyse($nyse) + { + if (is_null($nyse)) { + throw new \InvalidArgumentException('non-nullable nyse cannot be null'); + } + $this->container['nyse'] = $nyse; + + return $this; + } + + /** + * Gets otc + * + * @return string|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param string|null $otc The status of the OTC market. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetMarketStatus200ResponseIndicesGroups.php b/lib/Model/GetMarketStatus200ResponseIndicesGroups.php new file mode 100644 index 0000000..fe50daa --- /dev/null +++ b/lib/Model/GetMarketStatus200ResponseIndicesGroups.php @@ -0,0 +1,688 @@ + + */ +class GetMarketStatus200ResponseIndicesGroups implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetMarketStatus_200_response_indicesGroups'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cccy' => 'string', + 'dow_jones' => 'string', + 'ftse_russell' => 'string', + 'msci' => 'string', + 'mstar' => 'string', + 'mstarc' => 'mixed', + 'nasdaq' => 'string', + 's_and_p' => 'string', + 'societe_generale' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cccy' => null, + 'dow_jones' => null, + 'ftse_russell' => null, + 'msci' => null, + 'mstar' => null, + 'mstarc' => null, + 'nasdaq' => null, + 's_and_p' => null, + 'societe_generale' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cccy' => false, + 'dow_jones' => false, + 'ftse_russell' => false, + 'msci' => false, + 'mstar' => false, + 'mstarc' => true, + 'nasdaq' => false, + 's_and_p' => false, + 'societe_generale' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cccy' => 'cccy', + 'dow_jones' => 'dow_jones', + 'ftse_russell' => 'ftse_russell', + 'msci' => 'msci', + 'mstar' => 'mstar', + 'mstarc' => 'mstarc', + 'nasdaq' => 'nasdaq', + 's_and_p' => 's_and_p', + 'societe_generale' => 'societe_generale' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cccy' => 'setCccy', + 'dow_jones' => 'setDowJones', + 'ftse_russell' => 'setFtseRussell', + 'msci' => 'setMsci', + 'mstar' => 'setMstar', + 'mstarc' => 'setMstarc', + 'nasdaq' => 'setNasdaq', + 's_and_p' => 'setSAndP', + 'societe_generale' => 'setSocieteGenerale' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cccy' => 'getCccy', + 'dow_jones' => 'getDowJones', + 'ftse_russell' => 'getFtseRussell', + 'msci' => 'getMsci', + 'mstar' => 'getMstar', + 'mstarc' => 'getMstarc', + 'nasdaq' => 'getNasdaq', + 's_and_p' => 'getSAndP', + 'societe_generale' => 'getSocieteGenerale' + ]; + + /** + * 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->setIfExists('cccy', $data ?? [], null); + $this->setIfExists('dow_jones', $data ?? [], null); + $this->setIfExists('ftse_russell', $data ?? [], null); + $this->setIfExists('msci', $data ?? [], null); + $this->setIfExists('mstar', $data ?? [], null); + $this->setIfExists('mstarc', $data ?? [], null); + $this->setIfExists('nasdaq', $data ?? [], null); + $this->setIfExists('s_and_p', $data ?? [], null); + $this->setIfExists('societe_generale', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 cccy + * + * @return string|null + */ + public function getCccy() + { + return $this->container['cccy']; + } + + /** + * Sets cccy + * + * @param string|null $cccy The status of Cboe Streaming Market Indices Cryptocurrency (\"CCCY\") indices trading hours. + * + * @return self + */ + public function setCccy($cccy) + { + if (is_null($cccy)) { + throw new \InvalidArgumentException('non-nullable cccy cannot be null'); + } + $this->container['cccy'] = $cccy; + + return $this; + } + + /** + * Gets dow_jones + * + * @return string|null + */ + public function getDowJones() + { + return $this->container['dow_jones']; + } + + /** + * Sets dow_jones + * + * @param string|null $dow_jones The status of Dow Jones indices trading hours + * + * @return self + */ + public function setDowJones($dow_jones) + { + if (is_null($dow_jones)) { + throw new \InvalidArgumentException('non-nullable dow_jones cannot be null'); + } + $this->container['dow_jones'] = $dow_jones; + + return $this; + } + + /** + * Gets ftse_russell + * + * @return string|null + */ + public function getFtseRussell() + { + return $this->container['ftse_russell']; + } + + /** + * Sets ftse_russell + * + * @param string|null $ftse_russell The status of Financial Times Stock Exchange Group (\"FTSE\") Russell indices trading hours. + * + * @return self + */ + public function setFtseRussell($ftse_russell) + { + if (is_null($ftse_russell)) { + throw new \InvalidArgumentException('non-nullable ftse_russell cannot be null'); + } + $this->container['ftse_russell'] = $ftse_russell; + + return $this; + } + + /** + * Gets msci + * + * @return string|null + */ + public function getMsci() + { + return $this->container['msci']; + } + + /** + * Sets msci + * + * @param string|null $msci The status of Morgan Stanley Capital International (\"MSCI\") indices trading hours. + * + * @return self + */ + public function setMsci($msci) + { + if (is_null($msci)) { + throw new \InvalidArgumentException('non-nullable msci cannot be null'); + } + $this->container['msci'] = $msci; + + return $this; + } + + /** + * Gets mstar + * + * @return string|null + */ + public function getMstar() + { + return $this->container['mstar']; + } + + /** + * Sets mstar + * + * @param string|null $mstar The status of Morningstar (\"MSTAR\") indices trading hours. + * + * @return self + */ + public function setMstar($mstar) + { + if (is_null($mstar)) { + throw new \InvalidArgumentException('non-nullable mstar cannot be null'); + } + $this->container['mstar'] = $mstar; + + return $this; + } + + /** + * Gets mstarc + * + * @return mixed|null + */ + public function getMstarc() + { + return $this->container['mstarc']; + } + + /** + * Sets mstarc + * + * @param mixed|null $mstarc The status of Morningstar Customer (\"MSTARC\") indices trading hours. + * + * @return self + */ + public function setMstarc($mstarc) + { + if (is_null($mstarc)) { + array_push($this->openAPINullablesSetToNull, 'mstarc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mstarc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mstarc'] = $mstarc; + + return $this; + } + + /** + * Gets nasdaq + * + * @return string|null + */ + public function getNasdaq() + { + return $this->container['nasdaq']; + } + + /** + * Sets nasdaq + * + * @param string|null $nasdaq The status of National Association of Securities Dealers Automated Quotations (\"Nasdaq\") indices trading hours. + * + * @return self + */ + public function setNasdaq($nasdaq) + { + if (is_null($nasdaq)) { + throw new \InvalidArgumentException('non-nullable nasdaq cannot be null'); + } + $this->container['nasdaq'] = $nasdaq; + + return $this; + } + + /** + * Gets s_and_p + * + * @return string|null + */ + public function getSAndP() + { + return $this->container['s_and_p']; + } + + /** + * Sets s_and_p + * + * @param string|null $s_and_p The status of Standard & Poors's (\"S&P\") indices trading hours. + * + * @return self + */ + public function setSAndP($s_and_p) + { + if (is_null($s_and_p)) { + throw new \InvalidArgumentException('non-nullable s_and_p cannot be null'); + } + $this->container['s_and_p'] = $s_and_p; + + return $this; + } + + /** + * Gets societe_generale + * + * @return string|null + */ + public function getSocieteGenerale() + { + return $this->container['societe_generale']; + } + + /** + * Sets societe_generale + * + * @param string|null $societe_generale The status of Societe Generale indices trading hours. + * + * @return self + */ + public function setSocieteGenerale($societe_generale) + { + if (is_null($societe_generale)) { + throw new \InvalidArgumentException('non-nullable societe_generale cannot be null'); + } + $this->container['societe_generale'] = $societe_generale; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetOptionsContract200Response.php b/lib/Model/GetOptionsContract200Response.php new file mode 100644 index 0000000..a082675 --- /dev/null +++ b/lib/Model/GetOptionsContract200Response.php @@ -0,0 +1,477 @@ + + */ +class GetOptionsContract200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetOptionsContract_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetTicker200Response.php b/lib/Model/GetTicker200Response.php new file mode 100644 index 0000000..d48b9f7 --- /dev/null +++ b/lib/Model/GetTicker200Response.php @@ -0,0 +1,511 @@ + + */ +class GetTicker200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTicker_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\GetTicker200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\GetTicker200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\GetTicker200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetTicker200ResponseResults.php b/lib/Model/GetTicker200ResponseResults.php new file mode 100644 index 0000000..086336a --- /dev/null +++ b/lib/Model/GetTicker200ResponseResults.php @@ -0,0 +1,1386 @@ + + */ +class GetTicker200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTicker_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active' => 'bool', + 'address' => '\OpenAPI\Client\Model\GetTicker200ResponseResultsAddress', + 'branding' => '\OpenAPI\Client\Model\GetTicker200ResponseResultsBranding', + 'cik' => 'string', + 'composite_figi' => 'string', + 'currency_name' => 'string', + 'delisted_utc' => '\DateTime', + 'description' => 'string', + 'homepage_url' => 'string', + 'list_date' => 'string', + 'locale' => 'string', + 'market' => 'string', + 'market_cap' => 'float', + 'name' => 'string', + 'phone_number' => 'string', + 'primary_exchange' => 'string', + 'round_lot' => 'float', + 'share_class_figi' => 'string', + 'share_class_shares_outstanding' => 'float', + 'sic_code' => 'string', + 'sic_description' => 'string', + 'ticker' => 'string', + 'ticker_root' => 'string', + 'ticker_suffix' => 'string', + 'total_employees' => 'float', + 'type' => 'string', + 'weighted_shares_outstanding' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active' => null, + 'address' => null, + 'branding' => null, + 'cik' => null, + 'composite_figi' => null, + 'currency_name' => null, + 'delisted_utc' => 'date-time', + 'description' => null, + 'homepage_url' => null, + 'list_date' => null, + 'locale' => null, + 'market' => null, + 'market_cap' => 'double', + 'name' => null, + 'phone_number' => null, + 'primary_exchange' => null, + 'round_lot' => 'double', + 'share_class_figi' => null, + 'share_class_shares_outstanding' => 'double', + 'sic_code' => null, + 'sic_description' => null, + 'ticker' => null, + 'ticker_root' => null, + 'ticker_suffix' => null, + 'total_employees' => null, + 'type' => null, + 'weighted_shares_outstanding' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'active' => false, + 'address' => false, + 'branding' => false, + 'cik' => false, + 'composite_figi' => false, + 'currency_name' => false, + 'delisted_utc' => false, + 'description' => false, + 'homepage_url' => false, + 'list_date' => false, + 'locale' => false, + 'market' => false, + 'market_cap' => false, + 'name' => false, + 'phone_number' => false, + 'primary_exchange' => false, + 'round_lot' => false, + 'share_class_figi' => false, + 'share_class_shares_outstanding' => false, + 'sic_code' => false, + 'sic_description' => false, + 'ticker' => false, + 'ticker_root' => false, + 'ticker_suffix' => false, + 'total_employees' => false, + 'type' => false, + 'weighted_shares_outstanding' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'address' => 'address', + 'branding' => 'branding', + 'cik' => 'cik', + 'composite_figi' => 'composite_figi', + 'currency_name' => 'currency_name', + 'delisted_utc' => 'delisted_utc', + 'description' => 'description', + 'homepage_url' => 'homepage_url', + 'list_date' => 'list_date', + 'locale' => 'locale', + 'market' => 'market', + 'market_cap' => 'market_cap', + 'name' => 'name', + 'phone_number' => 'phone_number', + 'primary_exchange' => 'primary_exchange', + 'round_lot' => 'round_lot', + 'share_class_figi' => 'share_class_figi', + 'share_class_shares_outstanding' => 'share_class_shares_outstanding', + 'sic_code' => 'sic_code', + 'sic_description' => 'sic_description', + 'ticker' => 'ticker', + 'ticker_root' => 'ticker_root', + 'ticker_suffix' => 'ticker_suffix', + 'total_employees' => 'total_employees', + 'type' => 'type', + 'weighted_shares_outstanding' => 'weighted_shares_outstanding' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'address' => 'setAddress', + 'branding' => 'setBranding', + 'cik' => 'setCik', + 'composite_figi' => 'setCompositeFigi', + 'currency_name' => 'setCurrencyName', + 'delisted_utc' => 'setDelistedUtc', + 'description' => 'setDescription', + 'homepage_url' => 'setHomepageUrl', + 'list_date' => 'setListDate', + 'locale' => 'setLocale', + 'market' => 'setMarket', + 'market_cap' => 'setMarketCap', + 'name' => 'setName', + 'phone_number' => 'setPhoneNumber', + 'primary_exchange' => 'setPrimaryExchange', + 'round_lot' => 'setRoundLot', + 'share_class_figi' => 'setShareClassFigi', + 'share_class_shares_outstanding' => 'setShareClassSharesOutstanding', + 'sic_code' => 'setSicCode', + 'sic_description' => 'setSicDescription', + 'ticker' => 'setTicker', + 'ticker_root' => 'setTickerRoot', + 'ticker_suffix' => 'setTickerSuffix', + 'total_employees' => 'setTotalEmployees', + 'type' => 'setType', + 'weighted_shares_outstanding' => 'setWeightedSharesOutstanding' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'address' => 'getAddress', + 'branding' => 'getBranding', + 'cik' => 'getCik', + 'composite_figi' => 'getCompositeFigi', + 'currency_name' => 'getCurrencyName', + 'delisted_utc' => 'getDelistedUtc', + 'description' => 'getDescription', + 'homepage_url' => 'getHomepageUrl', + 'list_date' => 'getListDate', + 'locale' => 'getLocale', + 'market' => 'getMarket', + 'market_cap' => 'getMarketCap', + 'name' => 'getName', + 'phone_number' => 'getPhoneNumber', + 'primary_exchange' => 'getPrimaryExchange', + 'round_lot' => 'getRoundLot', + 'share_class_figi' => 'getShareClassFigi', + 'share_class_shares_outstanding' => 'getShareClassSharesOutstanding', + 'sic_code' => 'getSicCode', + 'sic_description' => 'getSicDescription', + 'ticker' => 'getTicker', + 'ticker_root' => 'getTickerRoot', + 'ticker_suffix' => 'getTickerSuffix', + 'total_employees' => 'getTotalEmployees', + 'type' => 'getType', + 'weighted_shares_outstanding' => 'getWeightedSharesOutstanding' + ]; + + /** + * 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; + } + + public const LOCALE_US = 'us'; + public const LOCALE__GLOBAL = 'global'; + public const MARKET_STOCKS = 'stocks'; + public const MARKET_CRYPTO = 'crypto'; + public const MARKET_FX = 'fx'; + public const MARKET_OTC = 'otc'; + public const MARKET_INDICES = 'indices'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLocaleAllowableValues() + { + return [ + self::LOCALE_US, + self::LOCALE__GLOBAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMarketAllowableValues() + { + return [ + self::MARKET_STOCKS, + self::MARKET_CRYPTO, + self::MARKET_FX, + self::MARKET_OTC, + self::MARKET_INDICES, + ]; + } + + /** + * 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->setIfExists('active', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('branding', $data ?? [], null); + $this->setIfExists('cik', $data ?? [], null); + $this->setIfExists('composite_figi', $data ?? [], null); + $this->setIfExists('currency_name', $data ?? [], null); + $this->setIfExists('delisted_utc', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('homepage_url', $data ?? [], null); + $this->setIfExists('list_date', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('market_cap', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('primary_exchange', $data ?? [], null); + $this->setIfExists('round_lot', $data ?? [], null); + $this->setIfExists('share_class_figi', $data ?? [], null); + $this->setIfExists('share_class_shares_outstanding', $data ?? [], null); + $this->setIfExists('sic_code', $data ?? [], null); + $this->setIfExists('sic_description', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('ticker_root', $data ?? [], null); + $this->setIfExists('ticker_suffix', $data ?? [], null); + $this->setIfExists('total_employees', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('weighted_shares_outstanding', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['currency_name'] === null) { + $invalidProperties[] = "'currency_name' can't be null"; + } + if ($this->container['locale'] === null) { + $invalidProperties[] = "'locale' can't be null"; + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!is_null($this->container['locale']) && !in_array($this->container['locale'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'locale', must be one of '%s'", + $this->container['locale'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['market'] === null) { + $invalidProperties[] = "'market' can't be null"; + } + $allowedValues = $this->getMarketAllowableValues(); + if (!is_null($this->container['market']) && !in_array($this->container['market'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'market', must be one of '%s'", + $this->container['market'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Whether or not the asset is actively traded. False means the asset has been delisted. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\GetTicker200ResponseResultsAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\GetTicker200ResponseResultsAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets branding + * + * @return \OpenAPI\Client\Model\GetTicker200ResponseResultsBranding|null + */ + public function getBranding() + { + return $this->container['branding']; + } + + /** + * Sets branding + * + * @param \OpenAPI\Client\Model\GetTicker200ResponseResultsBranding|null $branding branding + * + * @return self + */ + public function setBranding($branding) + { + if (is_null($branding)) { + throw new \InvalidArgumentException('non-nullable branding cannot be null'); + } + $this->container['branding'] = $branding; + + return $this; + } + + /** + * Gets cik + * + * @return string|null + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string|null $cik The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key). + * + * @return self + */ + public function setCik($cik) + { + if (is_null($cik)) { + throw new \InvalidArgumentException('non-nullable cik cannot be null'); + } + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets composite_figi + * + * @return string|null + */ + public function getCompositeFigi() + { + return $this->container['composite_figi']; + } + + /** + * Sets composite_figi + * + * @param string|null $composite_figi The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) + * + * @return self + */ + public function setCompositeFigi($composite_figi) + { + if (is_null($composite_figi)) { + throw new \InvalidArgumentException('non-nullable composite_figi cannot be null'); + } + $this->container['composite_figi'] = $composite_figi; + + return $this; + } + + /** + * Gets currency_name + * + * @return string + */ + public function getCurrencyName() + { + return $this->container['currency_name']; + } + + /** + * Sets currency_name + * + * @param string $currency_name The name of the currency that this asset is traded with. + * + * @return self + */ + public function setCurrencyName($currency_name) + { + if (is_null($currency_name)) { + throw new \InvalidArgumentException('non-nullable currency_name cannot be null'); + } + $this->container['currency_name'] = $currency_name; + + return $this; + } + + /** + * Gets delisted_utc + * + * @return \DateTime|null + */ + public function getDelistedUtc() + { + return $this->container['delisted_utc']; + } + + /** + * Sets delisted_utc + * + * @param \DateTime|null $delisted_utc The last date that the asset was traded. + * + * @return self + */ + public function setDelistedUtc($delisted_utc) + { + if (is_null($delisted_utc)) { + throw new \InvalidArgumentException('non-nullable delisted_utc cannot be null'); + } + $this->container['delisted_utc'] = $delisted_utc; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the company and what they do/offer. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets homepage_url + * + * @return string|null + */ + public function getHomepageUrl() + { + return $this->container['homepage_url']; + } + + /** + * Sets homepage_url + * + * @param string|null $homepage_url The URL of the company's website homepage. + * + * @return self + */ + public function setHomepageUrl($homepage_url) + { + if (is_null($homepage_url)) { + throw new \InvalidArgumentException('non-nullable homepage_url cannot be null'); + } + $this->container['homepage_url'] = $homepage_url; + + return $this; + } + + /** + * Gets list_date + * + * @return string|null + */ + public function getListDate() + { + return $this->container['list_date']; + } + + /** + * Sets list_date + * + * @param string|null $list_date The date that the symbol was first publicly listed in the format YYYY-MM-DD. + * + * @return self + */ + public function setListDate($list_date) + { + if (is_null($list_date)) { + throw new \InvalidArgumentException('non-nullable list_date cannot be null'); + } + $this->container['list_date'] = $list_date; + + return $this; + } + + /** + * Gets locale + * + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string $locale The locale of the asset. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!in_array($locale, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'locale', must be one of '%s'", + $locale, + implode("', '", $allowedValues) + ) + ); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets market + * + * @return string + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string $market The market type of the asset. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $allowedValues = $this->getMarketAllowableValues(); + if (!in_array($market, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'market', must be one of '%s'", + $market, + implode("', '", $allowedValues) + ) + ); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets market_cap + * + * @return float|null + */ + public function getMarketCap() + { + return $this->container['market_cap']; + } + + /** + * Sets market_cap + * + * @param float|null $market_cap The most recent close price of the ticker multiplied by weighted outstanding shares. + * + * @return self + */ + public function setMarketCap($market_cap) + { + if (is_null($market_cap)) { + throw new \InvalidArgumentException('non-nullable market_cap cannot be null'); + } + $this->container['market_cap'] = $market_cap; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The phone number for the company behind this ticker. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets primary_exchange + * + * @return string|null + */ + public function getPrimaryExchange() + { + return $this->container['primary_exchange']; + } + + /** + * Sets primary_exchange + * + * @param string|null $primary_exchange The ISO code of the primary listing exchange for this asset. + * + * @return self + */ + public function setPrimaryExchange($primary_exchange) + { + if (is_null($primary_exchange)) { + throw new \InvalidArgumentException('non-nullable primary_exchange cannot be null'); + } + $this->container['primary_exchange'] = $primary_exchange; + + return $this; + } + + /** + * Gets round_lot + * + * @return float|null + */ + public function getRoundLot() + { + return $this->container['round_lot']; + } + + /** + * Sets round_lot + * + * @param float|null $round_lot Round lot size of this security. + * + * @return self + */ + public function setRoundLot($round_lot) + { + if (is_null($round_lot)) { + throw new \InvalidArgumentException('non-nullable round_lot cannot be null'); + } + $this->container['round_lot'] = $round_lot; + + 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 The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) + * + * @return self + */ + public function setShareClassFigi($share_class_figi) + { + if (is_null($share_class_figi)) { + throw new \InvalidArgumentException('non-nullable share_class_figi cannot be null'); + } + $this->container['share_class_figi'] = $share_class_figi; + + return $this; + } + + /** + * Gets share_class_shares_outstanding + * + * @return float|null + */ + public function getShareClassSharesOutstanding() + { + return $this->container['share_class_shares_outstanding']; + } + + /** + * Sets share_class_shares_outstanding + * + * @param float|null $share_class_shares_outstanding The recorded number of outstanding shares for this particular share class. + * + * @return self + */ + public function setShareClassSharesOutstanding($share_class_shares_outstanding) + { + if (is_null($share_class_shares_outstanding)) { + throw new \InvalidArgumentException('non-nullable share_class_shares_outstanding cannot be null'); + } + $this->container['share_class_shares_outstanding'] = $share_class_shares_outstanding; + + return $this; + } + + /** + * Gets sic_code + * + * @return string|null + */ + public function getSicCode() + { + return $this->container['sic_code']; + } + + /** + * Sets sic_code + * + * @param string|null $sic_code The standard industrial classification code for this ticker. For a list of SIC Codes, see the SEC's SIC Code List. + * + * @return self + */ + public function setSicCode($sic_code) + { + if (is_null($sic_code)) { + throw new \InvalidArgumentException('non-nullable sic_code cannot be null'); + } + $this->container['sic_code'] = $sic_code; + + return $this; + } + + /** + * Gets sic_description + * + * @return string|null + */ + public function getSicDescription() + { + return $this->container['sic_description']; + } + + /** + * Sets sic_description + * + * @param string|null $sic_description A description of this ticker's SIC code. + * + * @return self + */ + public function setSicDescription($sic_description) + { + if (is_null($sic_description)) { + throw new \InvalidArgumentException('non-nullable sic_description cannot be null'); + } + $this->container['sic_description'] = $sic_description; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets ticker_root + * + * @return string|null + */ + public function getTickerRoot() + { + return $this->container['ticker_root']; + } + + /** + * Sets ticker_root + * + * @param string|null $ticker_root The root of a specified ticker. For example, the root of BRK.A is BRK. + * + * @return self + */ + public function setTickerRoot($ticker_root) + { + if (is_null($ticker_root)) { + throw new \InvalidArgumentException('non-nullable ticker_root cannot be null'); + } + $this->container['ticker_root'] = $ticker_root; + + return $this; + } + + /** + * Gets ticker_suffix + * + * @return string|null + */ + public function getTickerSuffix() + { + return $this->container['ticker_suffix']; + } + + /** + * Sets ticker_suffix + * + * @param string|null $ticker_suffix The suffix of a specified ticker. For example, the suffix of BRK.A is A. + * + * @return self + */ + public function setTickerSuffix($ticker_suffix) + { + if (is_null($ticker_suffix)) { + throw new \InvalidArgumentException('non-nullable ticker_suffix cannot be null'); + } + $this->container['ticker_suffix'] = $ticker_suffix; + + return $this; + } + + /** + * Gets total_employees + * + * @return float|null + */ + public function getTotalEmployees() + { + return $this->container['total_employees']; + } + + /** + * Sets total_employees + * + * @param float|null $total_employees The approximate number of employees for the company. + * + * @return self + */ + public function setTotalEmployees($total_employees) + { + if (is_null($total_employees)) { + throw new \InvalidArgumentException('non-nullable total_employees cannot be null'); + } + $this->container['total_employees'] = $total_employees; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the asset. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets weighted_shares_outstanding + * + * @return float|null + */ + public function getWeightedSharesOutstanding() + { + return $this->container['weighted_shares_outstanding']; + } + + /** + * Sets weighted_shares_outstanding + * + * @param float|null $weighted_shares_outstanding The shares outstanding calculated assuming all shares of other share classes are converted to this share class. + * + * @return self + */ + public function setWeightedSharesOutstanding($weighted_shares_outstanding) + { + if (is_null($weighted_shares_outstanding)) { + throw new \InvalidArgumentException('non-nullable weighted_shares_outstanding cannot be null'); + } + $this->container['weighted_shares_outstanding'] = $weighted_shares_outstanding; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetTicker200ResponseResultsAddress.php b/lib/Model/GetTicker200ResponseResultsAddress.php new file mode 100644 index 0000000..7fe87e3 --- /dev/null +++ b/lib/Model/GetTicker200ResponseResultsAddress.php @@ -0,0 +1,511 @@ + + */ +class GetTicker200ResponseResultsAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTicker_200_response_results_address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address1' => 'string', + 'city' => 'string', + 'postal_code' => 'string', + 'state' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address1' => null, + 'city' => null, + 'postal_code' => null, + 'state' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'address1' => false, + 'city' => false, + 'postal_code' => false, + 'state' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address1' => 'address1', + 'city' => 'city', + 'postal_code' => 'postal_code', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address1' => 'setAddress1', + 'city' => 'setCity', + 'postal_code' => 'setPostalCode', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address1' => 'getAddress1', + 'city' => 'getCity', + 'postal_code' => 'getPostalCode', + 'state' => 'getState' + ]; + + /** + * 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->setIfExists('address1', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 address1 + * + * @return string|null + */ + public function getAddress1() + { + return $this->container['address1']; + } + + /** + * Sets address1 + * + * @param string|null $address1 The first line of the company's headquarters address. + * + * @return self + */ + public function setAddress1($address1) + { + if (is_null($address1)) { + throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + } + $this->container['address1'] = $address1; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city of the company's headquarters address. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code of the company's headquarters address. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state of the company's headquarters address. + * + * @return self + */ + public function setState($state) + { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/GetTicker200ResponseResultsBranding.php b/lib/Model/GetTicker200ResponseResultsBranding.php new file mode 100644 index 0000000..a9d9b6c --- /dev/null +++ b/lib/Model/GetTicker200ResponseResultsBranding.php @@ -0,0 +1,443 @@ + + */ +class GetTicker200ResponseResultsBranding implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTicker_200_response_results_branding'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'icon_url' => 'string', + 'logo_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'icon_url' => null, + 'logo_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'icon_url' => false, + 'logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'icon_url' => 'icon_url', + 'logo_url' => 'logo_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'icon_url' => 'setIconUrl', + 'logo_url' => 'setLogoUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'icon_url' => 'getIconUrl', + 'logo_url' => 'getLogoUrl' + ]; + + /** + * 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->setIfExists('icon_url', $data ?? [], null); + $this->setIfExists('logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. + * + * @return self + */ + public function setIconUrl($icon_url) + { + if (is_null($icon_url)) { + throw new \InvalidArgumentException('non-nullable icon_url cannot be null'); + } + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets logo_url + * + * @return string|null + */ + public function getLogoUrl() + { + return $this->container['logo_url']; + } + + /** + * Sets logo_url + * + * @param string|null $logo_url A link to this ticker's company's logo. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. + * + * @return self + */ + public function setLogoUrl($logo_url) + { + if (is_null($logo_url)) { + throw new \InvalidArgumentException('non-nullable logo_url cannot be null'); + } + $this->container['logo_url'] = $logo_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndexAggsBase.php b/lib/Model/IndexAggsBase.php new file mode 100644 index 0000000..4152195 --- /dev/null +++ b/lib/Model/IndexAggsBase.php @@ -0,0 +1,523 @@ + + */ +class IndexAggsBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndexAggsBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesGroupedResults.php b/lib/Model/IndicesGroupedResults.php new file mode 100644 index 0000000..6ad58f6 --- /dev/null +++ b/lib/Model/IndicesGroupedResults.php @@ -0,0 +1,409 @@ + + */ +class IndicesGroupedResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesGroupedResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesOpenClose.php b/lib/Model/IndicesOpenClose.php new file mode 100644 index 0000000..82f9b8a --- /dev/null +++ b/lib/Model/IndicesOpenClose.php @@ -0,0 +1,702 @@ + + */ +class IndicesOpenClose implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesOpenClose'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after_hours' => 'float', + 'close' => 'float', + 'from' => '\DateTime', + 'high' => 'float', + 'low' => 'float', + 'open' => 'float', + 'pre_market' => 'int', + 'status' => 'string', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => 'double', + 'close' => 'double', + 'from' => 'date', + 'high' => 'double', + 'low' => 'double', + 'open' => 'double', + 'pre_market' => null, + 'status' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'close' => false, + 'from' => false, + 'high' => false, + 'low' => false, + 'open' => false, + 'pre_market' => false, + 'status' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'close' => 'close', + 'from' => 'from', + 'high' => 'high', + 'low' => 'low', + 'open' => 'open', + 'pre_market' => 'preMarket', + 'status' => 'status', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'close' => 'setClose', + 'from' => 'setFrom', + 'high' => 'setHigh', + 'low' => 'setLow', + 'open' => 'setOpen', + 'pre_market' => 'setPreMarket', + 'status' => 'setStatus', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'close' => 'getClose', + 'from' => 'getFrom', + 'high' => 'getHigh', + 'low' => 'getLow', + 'open' => 'getOpen', + 'pre_market' => 'getPreMarket', + 'status' => 'getStatus', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('pre_market', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 after_hours + * + * @return float|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param float|null $after_hours The close value of the ticker symbol in after hours trading. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close value for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime $from The requested date. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest value for the symbol in the given time period. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest value for the symbol in the given time period. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open value for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets pre_market + * + * @return int|null + */ + public function getPreMarket() + { + return $this->container['pre_market']; + } + + /** + * Sets pre_market + * + * @param int|null $pre_market The open value of the ticker symbol in pre-market trading. + * + * @return self + */ + public function setPreMarket($pre_market) + { + if (is_null($pre_market)) { + throw new \InvalidArgumentException('non-nullable pre_market cannot be null'); + } + $this->container['pre_market'] = $pre_market; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesSnapshot200Response.php b/lib/Model/IndicesSnapshot200Response.php new file mode 100644 index 0000000..f6b9b7f --- /dev/null +++ b/lib/Model/IndicesSnapshot200Response.php @@ -0,0 +1,517 @@ + + */ +class IndicesSnapshot200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesSnapshot_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesSnapshot200ResponseResultsInner.php b/lib/Model/IndicesSnapshot200ResponseResultsInner.php new file mode 100644 index 0000000..03799f2 --- /dev/null +++ b/lib/Model/IndicesSnapshot200ResponseResultsInner.php @@ -0,0 +1,790 @@ + + */ +class IndicesSnapshot200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesSnapshot_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'last_updated' => 'int', + 'market_status' => 'string', + 'message' => 'string', + 'name' => 'string', + 'session' => '\OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInnerSession', + 'ticker' => 'string', + 'timeframe' => 'string', + 'type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'last_updated' => 'int64', + 'market_status' => null, + 'message' => null, + 'name' => null, + 'session' => null, + 'ticker' => null, + 'timeframe' => null, + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false, + 'last_updated' => false, + 'market_status' => false, + 'message' => false, + 'name' => false, + 'session' => false, + 'ticker' => false, + 'timeframe' => false, + 'type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error', + 'last_updated' => 'last_updated', + 'market_status' => 'market_status', + 'message' => 'message', + 'name' => 'name', + 'session' => 'session', + 'ticker' => 'ticker', + 'timeframe' => 'timeframe', + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'last_updated' => 'setLastUpdated', + 'market_status' => 'setMarketStatus', + 'message' => 'setMessage', + 'name' => 'setName', + 'session' => 'setSession', + 'ticker' => 'setTicker', + 'timeframe' => 'setTimeframe', + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'last_updated' => 'getLastUpdated', + 'market_status' => 'getMarketStatus', + 'message' => 'getMessage', + 'name' => 'getName', + 'session' => 'getSession', + 'ticker' => 'getTicker', + 'timeframe' => 'getTimeframe', + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + public const TYPE_INDICES = 'indices'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INDICES, + ]; + } + + /** + * 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->setIfExists('error', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('market_status', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('session', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error while looking for this ticker. + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets market_status + * + * @return string|null + */ + public function getMarketStatus() + { + return $this->container['market_status']; + } + + /** + * Sets market_status + * + * @param string|null $market_status The market status for the market that trades this ticker. + * + * @return self + */ + public function setMarketStatus($market_status) + { + if (is_null($market_status)) { + throw new \InvalidArgumentException('non-nullable market_status cannot be null'); + } + $this->container['market_status'] = $market_status; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The error message while looking for this ticker. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of Index. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets session + * + * @return \OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInnerSession|null + */ + public function getSession() + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param \OpenAPI\Client\Model\IndicesSnapshot200ResponseResultsInnerSession|null $session session + * + * @return self + */ + public function setSession($session) + { + if (is_null($session)) { + throw new \InvalidArgumentException('non-nullable session cannot be null'); + } + $this->container['session'] = $session; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker Ticker of asset queried. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The indices market. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Value of Index. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesSnapshot200ResponseResultsInnerSession.php b/lib/Model/IndicesSnapshot200ResponseResultsInnerSession.php new file mode 100644 index 0000000..7d55093 --- /dev/null +++ b/lib/Model/IndicesSnapshot200ResponseResultsInnerSession.php @@ -0,0 +1,613 @@ + + */ +class IndicesSnapshot200ResponseResultsInnerSession implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesSnapshot_200_response_results_inner_session'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'change' => 'float', + 'change_percent' => 'float', + 'close' => 'float', + 'high' => 'float', + 'low' => 'float', + 'open' => 'float', + 'previous_close' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'change' => 'double', + 'change_percent' => 'double', + 'close' => 'double', + 'high' => 'double', + 'low' => 'double', + 'open' => 'double', + 'previous_close' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'change' => false, + 'change_percent' => false, + 'close' => false, + 'high' => false, + 'low' => false, + 'open' => false, + 'previous_close' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'change' => 'change', + 'change_percent' => 'change_percent', + 'close' => 'close', + 'high' => 'high', + 'low' => 'low', + 'open' => 'open', + 'previous_close' => 'previous_close' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'change' => 'setChange', + 'change_percent' => 'setChangePercent', + 'close' => 'setClose', + 'high' => 'setHigh', + 'low' => 'setLow', + 'open' => 'setOpen', + 'previous_close' => 'setPreviousClose' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'change' => 'getChange', + 'change_percent' => 'getChangePercent', + 'close' => 'getClose', + 'high' => 'getHigh', + 'low' => 'getLow', + 'open' => 'getOpen', + 'previous_close' => 'getPreviousClose' + ]; + + /** + * 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->setIfExists('change', $data ?? [], null); + $this->setIfExists('change_percent', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('previous_close', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 change + * + * @return float|null + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param float|null $change The value of the change for the index from the previous trading day. + * + * @return self + */ + public function setChange($change) + { + if (is_null($change)) { + throw new \InvalidArgumentException('non-nullable change cannot be null'); + } + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets change_percent + * + * @return float|null + */ + public function getChangePercent() + { + return $this->container['change_percent']; + } + + /** + * Sets change_percent + * + * @param float|null $change_percent The percent of the change for the index from the previous trading day. + * + * @return self + */ + public function setChangePercent($change_percent) + { + if (is_null($change_percent)) { + throw new \InvalidArgumentException('non-nullable change_percent cannot be null'); + } + $this->container['change_percent'] = $change_percent; + + return $this; + } + + /** + * Gets close + * + * @return float|null + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float|null $close The closing value for the index of the day. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets high + * + * @return float|null + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float|null $high The highest value for the index of the day. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets low + * + * @return float|null + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float|null $low The lowest value for the index of the day. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float|null + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float|null $open The open value for the index of the day. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets previous_close + * + * @return float|null + */ + public function getPreviousClose() + { + return $this->container['previous_close']; + } + + /** + * Sets previous_close + * + * @param float|null $previous_close The closing value for the index of previous trading day. + * + * @return self + */ + public function setPreviousClose($previous_close) + { + if (is_null($previous_close)) { + throw new \InvalidArgumentException('non-nullable previous_close cannot be null'); + } + $this->container['previous_close'] = $previous_close; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesTickerResults.php b/lib/Model/IndicesTickerResults.php new file mode 100644 index 0000000..41f9422 --- /dev/null +++ b/lib/Model/IndicesTickerResults.php @@ -0,0 +1,409 @@ + + */ +class IndicesTickerResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesTickerResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\IndicesTickerResultsResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\IndicesTickerResultsResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\IndicesTickerResultsResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/IndicesTickerResultsResultsInner.php b/lib/Model/IndicesTickerResultsResultsInner.php new file mode 100644 index 0000000..adf5ede --- /dev/null +++ b/lib/Model/IndicesTickerResultsResultsInner.php @@ -0,0 +1,594 @@ + + */ +class IndicesTickerResultsResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesTickerResults_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + '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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close value for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest value for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest value for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open value for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastQuote200Response.php b/lib/Model/LastQuote200Response.php new file mode 100644 index 0000000..d7b53b2 --- /dev/null +++ b/lib/Model/LastQuote200Response.php @@ -0,0 +1,483 @@ + + */ +class LastQuote200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastQuote_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\LastQuote200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\LastQuote200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\LastQuote200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastQuote200ResponseResults.php b/lib/Model/LastQuote200ResponseResults.php new file mode 100644 index 0000000..c7a062c --- /dev/null +++ b/lib/Model/LastQuote200ResponseResults.php @@ -0,0 +1,863 @@ + + */ +class LastQuote200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastQuote_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'p' => 'float', + 's' => 'int', + 't' => 'string', + 'x' => 'int', + 'c' => 'int[]', + 'f' => 'int', + 'i' => 'int[]', + 'p' => 'float', + 'q' => 'int', + 's' => 'int', + 't' => 'int', + 'x' => 'int', + 'y' => 'int', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'p' => 'double', + 's' => null, + 't' => null, + 'x' => null, + 'c' => 'int32', + 'f' => null, + 'i' => 'int32', + 'p' => 'double', + 'q' => 'int64', + 's' => null, + 't' => null, + 'x' => null, + 'y' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'p' => false, + 's' => false, + 't' => false, + 'x' => false, + 'c' => false, + 'f' => false, + 'i' => false, + 'p' => false, + 'q' => false, + 's' => false, + 't' => false, + 'x' => false, + 'y' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'p' => 'P', + 's' => 'S', + 't' => 'T', + 'x' => 'X', + 'c' => 'c', + 'f' => 'f', + 'i' => 'i', + 'p' => 'p', + 'q' => 'q', + 's' => 's', + 't' => 't', + 'x' => 'x', + 'y' => 'y', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX', + 'c' => 'setC', + 'f' => 'setF', + 'i' => 'setI', + 'p' => 'setP', + 'q' => 'setQ', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX', + 'y' => 'setY', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'p' => 'getP', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX', + 'c' => 'getC', + 'f' => 'getF', + 'i' => 'getI', + 'p' => 'getP', + 'q' => 'getQ', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX', + 'y' => 'getY', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + 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 p + * + * @return float|null + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float|null $p The ask price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int|null $s The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int|null + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int|null $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets c + * + * @return int[]|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[]|null $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets f + * + * @return int|null + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int|null $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets i + * + * @return int[]|null + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param int[]|null $i A list of indicator codes. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float|null + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float|null $p The bid price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets s + * + * @return int|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int|null $s The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int|null + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int|null $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets z + * + * @return int|null + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int|null $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastQuoteCurrencies200Response.php b/lib/Model/LastQuoteCurrencies200Response.php new file mode 100644 index 0000000..4043e1a --- /dev/null +++ b/lib/Model/LastQuoteCurrencies200Response.php @@ -0,0 +1,520 @@ + + */ +class LastQuoteCurrencies200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastQuoteCurrencies_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'last' => '\OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast', + 'request_id' => 'string', + 'status' => 'string', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last' => null, + 'request_id' => null, + 'status' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'last' => false, + 'request_id' => false, + 'status' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last' => 'last', + 'request_id' => 'request_id', + 'status' => 'status', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last' => 'setLast', + 'request_id' => 'setRequestId', + 'status' => 'setStatus', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last' => 'getLast', + 'request_id' => 'getRequestId', + 'status' => 'getStatus', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 last + * + * @return \OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastTradeCrypto200Response.php b/lib/Model/LastTradeCrypto200Response.php new file mode 100644 index 0000000..5291745 --- /dev/null +++ b/lib/Model/LastTradeCrypto200Response.php @@ -0,0 +1,520 @@ + + */ +class LastTradeCrypto200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastTradeCrypto_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'last' => '\OpenAPI\Client\Model\LastTradeCrypto200ResponseLast', + 'request_id' => 'string', + 'status' => 'string', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last' => null, + 'request_id' => null, + 'status' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'last' => false, + 'request_id' => false, + 'status' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last' => 'last', + 'request_id' => 'request_id', + 'status' => 'status', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last' => 'setLast', + 'request_id' => 'setRequestId', + 'status' => 'setStatus', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last' => 'getLast', + 'request_id' => 'getRequestId', + 'status' => 'getStatus', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 last + * + * @return \OpenAPI\Client\Model\LastTradeCrypto200ResponseLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\LastTradeCrypto200ResponseLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastTradeCrypto200ResponseLast.php b/lib/Model/LastTradeCrypto200ResponseLast.php new file mode 100644 index 0000000..14accd5 --- /dev/null +++ b/lib/Model/LastTradeCrypto200ResponseLast.php @@ -0,0 +1,557 @@ + + */ +class LastTradeCrypto200ResponseLast implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastTradeCrypto_200_response_last'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'exchange' => 'int', + 'price' => 'float', + 'size' => 'float', + 'timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'exchange' => null, + 'price' => 'double', + 'size' => 'double', + 'timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'exchange' => false, + 'price' => false, + 'size' => false, + 'timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'exchange' => 'exchange', + 'price' => 'price', + 'size' => 'size', + 'timestamp' => 'timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'exchange' => 'setExchange', + 'price' => 'setPrice', + 'size' => 'setSize', + 'timestamp' => 'setTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'exchange' => 'getExchange', + 'price' => 'getPrice', + 'size' => 'getSize', + 'timestamp' => 'getTimestamp' + ]; + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange that this crypto trade happened on. See Exchanges for a mapping of exchanges to IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The Unix millisecond timestamp. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastTradeOptions200Response.php b/lib/Model/LastTradeOptions200Response.php new file mode 100644 index 0000000..b6ae29b --- /dev/null +++ b/lib/Model/LastTradeOptions200Response.php @@ -0,0 +1,483 @@ + + */ +class LastTradeOptions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastTradeOptions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\LastTradeOptions200ResponseResults', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\LastTradeOptions200ResponseResults|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\LastTradeOptions200ResponseResults|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LastTradeOptions200ResponseResults.php b/lib/Model/LastTradeOptions200ResponseResults.php new file mode 100644 index 0000000..5b4bfea --- /dev/null +++ b/lib/Model/LastTradeOptions200ResponseResults.php @@ -0,0 +1,838 @@ + + */ +class LastTradeOptions200ResponseResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LastTradeOptions_200_response_results'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'c' => 'int[]', + 'e' => 'int', + 'f' => 'int', + 'i' => 'string', + 'p' => 'float', + 'q' => 'int', + 'r' => 'int', + 's' => 'float', + 't' => 'int', + 'x' => 'int', + 'y' => 'int', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'c' => 'int32', + 'e' => null, + 'f' => null, + 'i' => null, + 'p' => 'double', + 'q' => 'int64', + 'r' => null, + 's' => 'double', + 't' => null, + 'x' => null, + 'y' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'c' => false, + 'e' => false, + 'f' => false, + 'i' => false, + 'p' => false, + 'q' => false, + 'r' => false, + 's' => false, + 't' => false, + 'x' => false, + 'y' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'c' => 'c', + 'e' => 'e', + 'f' => 'f', + 'i' => 'i', + 'p' => 'p', + 'q' => 'q', + 'r' => 'r', + 's' => 's', + 't' => 't', + 'x' => 'x', + 'y' => 'y', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'c' => 'setC', + 'e' => 'setE', + 'f' => 'setF', + 'i' => 'setI', + 'p' => 'setP', + 'q' => 'setQ', + 'r' => 'setR', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX', + 'y' => 'setY', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'c' => 'getC', + 'e' => 'getE', + 'f' => 'getF', + 'i' => 'getI', + 'p' => 'getP', + 'q' => 'getQ', + 'r' => 'getR', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX', + 'y' => 'getY', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('e', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('r', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets c + * + * @return int[]|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[]|null $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets e + * + * @return int|null + */ + public function getE() + { + return $this->container['e']; + } + + /** + * Sets e + * + * @param int|null $e The trade correction indicator. + * + * @return self + */ + public function setE($e) + { + if (is_null($e)) { + throw new \InvalidArgumentException('non-nullable e cannot be null'); + } + $this->container['e'] = $e; + + return $this; + } + + /** + * Gets f + * + * @return int|null + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int|null $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets r + * + * @return int|null + */ + public function getR() + { + return $this->container['r']; + } + + /** + * Sets r + * + * @param int|null $r The ID for the Trade Reporting Facility where the trade took place. + * + * @return self + */ + public function setR($r) + { + if (is_null($r)) { + throw new \InvalidArgumentException('non-nullable r cannot be null'); + } + $this->container['r'] = $r; + + return $this; + } + + /** + * Gets s + * + * @return float|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float|null $s The size of a trade (also known as volume). + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets z + * + * @return int|null + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int|null $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200Response.php b/lib/Model/ListConditions200Response.php new file mode 100644 index 0000000..7890060 --- /dev/null +++ b/lib/Model/ListConditions200Response.php @@ -0,0 +1,557 @@ + + */ +class ListConditions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request ID assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInner[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInner[] $results An array of conditions that match your query. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200ResponseResultsInner.php b/lib/Model/ListConditions200ResponseResultsInner.php new file mode 100644 index 0000000..815e701 --- /dev/null +++ b/lib/Model/ListConditions200ResponseResultsInner.php @@ -0,0 +1,878 @@ + + */ +class ListConditions200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abbreviation' => 'string', + 'asset_class' => 'string', + 'data_types' => 'string[]', + 'description' => 'string', + 'exchange' => 'int', + 'id' => 'int', + 'legacy' => 'bool', + 'name' => 'string', + 'sip_mapping' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerSipMapping', + 'type' => 'string', + 'update_rules' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRules' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abbreviation' => null, + 'asset_class' => null, + 'data_types' => null, + 'description' => null, + 'exchange' => null, + 'id' => null, + 'legacy' => null, + 'name' => null, + 'sip_mapping' => null, + 'type' => null, + 'update_rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'abbreviation' => false, + 'asset_class' => false, + 'data_types' => false, + 'description' => false, + 'exchange' => false, + 'id' => false, + 'legacy' => false, + 'name' => false, + 'sip_mapping' => false, + 'type' => false, + 'update_rules' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abbreviation' => 'abbreviation', + 'asset_class' => 'asset_class', + 'data_types' => 'data_types', + 'description' => 'description', + 'exchange' => 'exchange', + 'id' => 'id', + 'legacy' => 'legacy', + 'name' => 'name', + 'sip_mapping' => 'sip_mapping', + 'type' => 'type', + 'update_rules' => 'update_rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abbreviation' => 'setAbbreviation', + 'asset_class' => 'setAssetClass', + 'data_types' => 'setDataTypes', + 'description' => 'setDescription', + 'exchange' => 'setExchange', + 'id' => 'setId', + 'legacy' => 'setLegacy', + 'name' => 'setName', + 'sip_mapping' => 'setSipMapping', + 'type' => 'setType', + 'update_rules' => 'setUpdateRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abbreviation' => 'getAbbreviation', + 'asset_class' => 'getAssetClass', + 'data_types' => 'getDataTypes', + 'description' => 'getDescription', + 'exchange' => 'getExchange', + 'id' => 'getId', + 'legacy' => 'getLegacy', + 'name' => 'getName', + 'sip_mapping' => 'getSipMapping', + 'type' => 'getType', + 'update_rules' => 'getUpdateRules' + ]; + + /** + * 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; + } + + public const ASSET_CLASS_STOCKS = 'stocks'; + public const ASSET_CLASS_OPTIONS = 'options'; + public const ASSET_CLASS_CRYPTO = 'crypto'; + public const ASSET_CLASS_FX = 'fx'; + public const DATA_TYPES_TRADE = 'trade'; + public const DATA_TYPES_BBO = 'bbo'; + public const DATA_TYPES_NBBO = 'nbbo'; + public const TYPE_SALE_CONDITION = 'sale_condition'; + public const TYPE_QUOTE_CONDITION = 'quote_condition'; + public const TYPE_SIP_GENERATED_FLAG = 'sip_generated_flag'; + public const TYPE_FINANCIAL_STATUS_INDICATOR = 'financial_status_indicator'; + public const TYPE_SHORT_SALE_RESTRICTION_INDICATOR = 'short_sale_restriction_indicator'; + public const TYPE_SETTLEMENT_CONDITION = 'settlement_condition'; + public const TYPE_MARKET_CONDITION = 'market_condition'; + public const TYPE_TRADE_THRU_EXEMPT = 'trade_thru_exempt'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAssetClassAllowableValues() + { + return [ + self::ASSET_CLASS_STOCKS, + self::ASSET_CLASS_OPTIONS, + self::ASSET_CLASS_CRYPTO, + self::ASSET_CLASS_FX, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDataTypesAllowableValues() + { + return [ + self::DATA_TYPES_TRADE, + self::DATA_TYPES_BBO, + self::DATA_TYPES_NBBO, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SALE_CONDITION, + self::TYPE_QUOTE_CONDITION, + self::TYPE_SIP_GENERATED_FLAG, + self::TYPE_FINANCIAL_STATUS_INDICATOR, + self::TYPE_SHORT_SALE_RESTRICTION_INDICATOR, + self::TYPE_SETTLEMENT_CONDITION, + self::TYPE_MARKET_CONDITION, + self::TYPE_TRADE_THRU_EXEMPT, + ]; + } + + /** + * 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->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('asset_class', $data ?? [], null); + $this->setIfExists('data_types', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('legacy', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('sip_mapping', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('update_rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['asset_class'] === null) { + $invalidProperties[] = "'asset_class' can't be null"; + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!is_null($this->container['asset_class']) && !in_array($this->container['asset_class'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'asset_class', must be one of '%s'", + $this->container['asset_class'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data_types'] === null) { + $invalidProperties[] = "'data_types' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['sip_mapping'] === null) { + $invalidProperties[] = "'sip_mapping' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 abbreviation + * + * @return string|null + */ + public function getAbbreviation() + { + return $this->container['abbreviation']; + } + + /** + * Sets abbreviation + * + * @param string|null $abbreviation A commonly-used abbreviation for this condition. + * + * @return self + */ + public function setAbbreviation($abbreviation) + { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } + $this->container['abbreviation'] = $abbreviation; + + return $this; + } + + /** + * Gets asset_class + * + * @return string + */ + public function getAssetClass() + { + return $this->container['asset_class']; + } + + /** + * Sets asset_class + * + * @param string $asset_class An identifier for a group of similar financial instruments. + * + * @return self + */ + public function setAssetClass($asset_class) + { + if (is_null($asset_class)) { + throw new \InvalidArgumentException('non-nullable asset_class cannot be null'); + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!in_array($asset_class, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'asset_class', must be one of '%s'", + $asset_class, + implode("', '", $allowedValues) + ) + ); + } + $this->container['asset_class'] = $asset_class; + + return $this; + } + + /** + * Gets data_types + * + * @return string[] + */ + public function getDataTypes() + { + return $this->container['data_types']; + } + + /** + * Sets data_types + * + * @param string[] $data_types Data types that this condition applies to. + * + * @return self + */ + public function setDataTypes($data_types) + { + if (is_null($data_types)) { + throw new \InvalidArgumentException('non-nullable data_types cannot be null'); + } + $allowedValues = $this->getDataTypesAllowableValues(); + if (array_diff($data_types, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'data_types', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['data_types'] = $data_types; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the semantics of this condition. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets exchange + * + * @return int|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int|null $exchange If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute. In other words, data with this condition attached comes exclusively from the given exchange. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id An identifier used by Polygon.io for this condition. Unique per data type. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets legacy + * + * @return bool|null + */ + public function getLegacy() + { + return $this->container['legacy']; + } + + /** + * Sets legacy + * + * @param bool|null $legacy If true, this condition is from an old version of the SIPs' specs and no longer is used. Other conditions may or may not reuse the same symbol as this one. + * + * @return self + */ + public function setLegacy($legacy) + { + if (is_null($legacy)) { + throw new \InvalidArgumentException('non-nullable legacy cannot be null'); + } + $this->container['legacy'] = $legacy; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of this condition. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sip_mapping + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerSipMapping + */ + public function getSipMapping() + { + return $this->container['sip_mapping']; + } + + /** + * Sets sip_mapping + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerSipMapping $sip_mapping sip_mapping + * + * @return self + */ + public function setSipMapping($sip_mapping) + { + if (is_null($sip_mapping)) { + throw new \InvalidArgumentException('non-nullable sip_mapping cannot be null'); + } + $this->container['sip_mapping'] = $sip_mapping; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type An identifier for a collection of related conditions. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets update_rules + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRules|null + */ + public function getUpdateRules() + { + return $this->container['update_rules']; + } + + /** + * Sets update_rules + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRules|null $update_rules update_rules + * + * @return self + */ + public function setUpdateRules($update_rules) + { + if (is_null($update_rules)) { + throw new \InvalidArgumentException('non-nullable update_rules cannot be null'); + } + $this->container['update_rules'] = $update_rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200ResponseResultsInnerSipMapping.php b/lib/Model/ListConditions200ResponseResultsInnerSipMapping.php new file mode 100644 index 0000000..14f3db5 --- /dev/null +++ b/lib/Model/ListConditions200ResponseResultsInnerSipMapping.php @@ -0,0 +1,478 @@ + + */ +class ListConditions200ResponseResultsInnerSipMapping implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response_results_inner_sip_mapping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cta' => 'string', + 'opra' => 'string', + 'utp' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cta' => null, + 'opra' => null, + 'utp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cta' => false, + 'opra' => false, + 'utp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cta' => 'CTA', + 'opra' => 'OPRA', + 'utp' => 'UTP' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cta' => 'setCta', + 'opra' => 'setOpra', + 'utp' => 'setUtp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cta' => 'getCta', + 'opra' => 'getOpra', + 'utp' => 'getUtp' + ]; + + /** + * 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->setIfExists('cta', $data ?? [], null); + $this->setIfExists('opra', $data ?? [], null); + $this->setIfExists('utp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 cta + * + * @return string|null + */ + public function getCta() + { + return $this->container['cta']; + } + + /** + * Sets cta + * + * @param string|null $cta cta + * + * @return self + */ + public function setCta($cta) + { + if (is_null($cta)) { + throw new \InvalidArgumentException('non-nullable cta cannot be null'); + } + $this->container['cta'] = $cta; + + return $this; + } + + /** + * Gets opra + * + * @return string|null + */ + public function getOpra() + { + return $this->container['opra']; + } + + /** + * Sets opra + * + * @param string|null $opra opra + * + * @return self + */ + public function setOpra($opra) + { + if (is_null($opra)) { + throw new \InvalidArgumentException('non-nullable opra cannot be null'); + } + $this->container['opra'] = $opra; + + return $this; + } + + /** + * Gets utp + * + * @return string|null + */ + public function getUtp() + { + return $this->container['utp']; + } + + /** + * Sets utp + * + * @param string|null $utp utp + * + * @return self + */ + public function setUtp($utp) + { + if (is_null($utp)) { + throw new \InvalidArgumentException('non-nullable utp cannot be null'); + } + $this->container['utp'] = $utp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200ResponseResultsInnerUpdateRules.php b/lib/Model/ListConditions200ResponseResultsInnerUpdateRules.php new file mode 100644 index 0000000..b88d3c0 --- /dev/null +++ b/lib/Model/ListConditions200ResponseResultsInnerUpdateRules.php @@ -0,0 +1,450 @@ + + */ +class ListConditions200ResponseResultsInnerUpdateRules implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response_results_inner_update_rules'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'consolidated' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesConsolidated', + 'market_center' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesMarketCenter' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'consolidated' => null, + 'market_center' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'consolidated' => false, + 'market_center' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'consolidated' => 'consolidated', + 'market_center' => 'market_center' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'consolidated' => 'setConsolidated', + 'market_center' => 'setMarketCenter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'consolidated' => 'getConsolidated', + 'market_center' => 'getMarketCenter' + ]; + + /** + * 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->setIfExists('consolidated', $data ?? [], null); + $this->setIfExists('market_center', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['consolidated'] === null) { + $invalidProperties[] = "'consolidated' can't be null"; + } + if ($this->container['market_center'] === null) { + $invalidProperties[] = "'market_center' can't be null"; + } + 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 consolidated + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesConsolidated + */ + public function getConsolidated() + { + return $this->container['consolidated']; + } + + /** + * Sets consolidated + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesConsolidated $consolidated consolidated + * + * @return self + */ + public function setConsolidated($consolidated) + { + if (is_null($consolidated)) { + throw new \InvalidArgumentException('non-nullable consolidated cannot be null'); + } + $this->container['consolidated'] = $consolidated; + + return $this; + } + + /** + * Gets market_center + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesMarketCenter + */ + public function getMarketCenter() + { + return $this->container['market_center']; + } + + /** + * Sets market_center + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInnerUpdateRulesMarketCenter $market_center market_center + * + * @return self + */ + public function setMarketCenter($market_center) + { + if (is_null($market_center)) { + throw new \InvalidArgumentException('non-nullable market_center cannot be null'); + } + $this->container['market_center'] = $market_center; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.php b/lib/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.php new file mode 100644 index 0000000..c8fd89f --- /dev/null +++ b/lib/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidated.php @@ -0,0 +1,487 @@ + + */ +class ListConditions200ResponseResultsInnerUpdateRulesConsolidated implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response_results_inner_update_rules_consolidated'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'updates_high_low' => 'bool', + 'updates_open_close' => 'bool', + 'updates_volume' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updates_high_low' => null, + 'updates_open_close' => null, + 'updates_volume' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'updates_high_low' => false, + 'updates_open_close' => false, + 'updates_volume' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updates_high_low' => 'updates_high_low', + 'updates_open_close' => 'updates_open_close', + 'updates_volume' => 'updates_volume' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updates_high_low' => 'setUpdatesHighLow', + 'updates_open_close' => 'setUpdatesOpenClose', + 'updates_volume' => 'setUpdatesVolume' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updates_high_low' => 'getUpdatesHighLow', + 'updates_open_close' => 'getUpdatesOpenClose', + 'updates_volume' => 'getUpdatesVolume' + ]; + + /** + * 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->setIfExists('updates_high_low', $data ?? [], null); + $this->setIfExists('updates_open_close', $data ?? [], null); + $this->setIfExists('updates_volume', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['updates_high_low'] === null) { + $invalidProperties[] = "'updates_high_low' can't be null"; + } + if ($this->container['updates_open_close'] === null) { + $invalidProperties[] = "'updates_open_close' can't be null"; + } + if ($this->container['updates_volume'] === null) { + $invalidProperties[] = "'updates_volume' can't be null"; + } + 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 updates_high_low + * + * @return bool + */ + public function getUpdatesHighLow() + { + return $this->container['updates_high_low']; + } + + /** + * Sets updates_high_low + * + * @param bool $updates_high_low Whether or not trades with this condition update the high/low. + * + * @return self + */ + public function setUpdatesHighLow($updates_high_low) + { + if (is_null($updates_high_low)) { + throw new \InvalidArgumentException('non-nullable updates_high_low cannot be null'); + } + $this->container['updates_high_low'] = $updates_high_low; + + return $this; + } + + /** + * Gets updates_open_close + * + * @return bool + */ + public function getUpdatesOpenClose() + { + return $this->container['updates_open_close']; + } + + /** + * Sets updates_open_close + * + * @param bool $updates_open_close Whether or not trades with this condition update the open/close. + * + * @return self + */ + public function setUpdatesOpenClose($updates_open_close) + { + if (is_null($updates_open_close)) { + throw new \InvalidArgumentException('non-nullable updates_open_close cannot be null'); + } + $this->container['updates_open_close'] = $updates_open_close; + + return $this; + } + + /** + * Gets updates_volume + * + * @return bool + */ + public function getUpdatesVolume() + { + return $this->container['updates_volume']; + } + + /** + * Sets updates_volume + * + * @param bool $updates_volume Whether or not trades with this condition update the volume. + * + * @return self + */ + public function setUpdatesVolume($updates_volume) + { + if (is_null($updates_volume)) { + throw new \InvalidArgumentException('non-nullable updates_volume cannot be null'); + } + $this->container['updates_volume'] = $updates_volume; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.php b/lib/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.php new file mode 100644 index 0000000..538b019 --- /dev/null +++ b/lib/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenter.php @@ -0,0 +1,487 @@ + + */ +class ListConditions200ResponseResultsInnerUpdateRulesMarketCenter implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_200_response_results_inner_update_rules_market_center'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'updates_high_low' => 'bool', + 'updates_open_close' => 'bool', + 'updates_volume' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updates_high_low' => null, + 'updates_open_close' => null, + 'updates_volume' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'updates_high_low' => false, + 'updates_open_close' => false, + 'updates_volume' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updates_high_low' => 'updates_high_low', + 'updates_open_close' => 'updates_open_close', + 'updates_volume' => 'updates_volume' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updates_high_low' => 'setUpdatesHighLow', + 'updates_open_close' => 'setUpdatesOpenClose', + 'updates_volume' => 'setUpdatesVolume' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updates_high_low' => 'getUpdatesHighLow', + 'updates_open_close' => 'getUpdatesOpenClose', + 'updates_volume' => 'getUpdatesVolume' + ]; + + /** + * 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->setIfExists('updates_high_low', $data ?? [], null); + $this->setIfExists('updates_open_close', $data ?? [], null); + $this->setIfExists('updates_volume', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['updates_high_low'] === null) { + $invalidProperties[] = "'updates_high_low' can't be null"; + } + if ($this->container['updates_open_close'] === null) { + $invalidProperties[] = "'updates_open_close' can't be null"; + } + if ($this->container['updates_volume'] === null) { + $invalidProperties[] = "'updates_volume' can't be null"; + } + 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 updates_high_low + * + * @return bool + */ + public function getUpdatesHighLow() + { + return $this->container['updates_high_low']; + } + + /** + * Sets updates_high_low + * + * @param bool $updates_high_low Whether or not trades with this condition update the high/low. + * + * @return self + */ + public function setUpdatesHighLow($updates_high_low) + { + if (is_null($updates_high_low)) { + throw new \InvalidArgumentException('non-nullable updates_high_low cannot be null'); + } + $this->container['updates_high_low'] = $updates_high_low; + + return $this; + } + + /** + * Gets updates_open_close + * + * @return bool + */ + public function getUpdatesOpenClose() + { + return $this->container['updates_open_close']; + } + + /** + * Sets updates_open_close + * + * @param bool $updates_open_close Whether or not trades with this condition update the open/close. + * + * @return self + */ + public function setUpdatesOpenClose($updates_open_close) + { + if (is_null($updates_open_close)) { + throw new \InvalidArgumentException('non-nullable updates_open_close cannot be null'); + } + $this->container['updates_open_close'] = $updates_open_close; + + return $this; + } + + /** + * Gets updates_volume + * + * @return bool + */ + public function getUpdatesVolume() + { + return $this->container['updates_volume']; + } + + /** + * Sets updates_volume + * + * @param bool $updates_volume Whether or not trades with this condition update the volume. + * + * @return self + */ + public function setUpdatesVolume($updates_volume) + { + if (is_null($updates_volume)) { + throw new \InvalidArgumentException('non-nullable updates_volume cannot be null'); + } + $this->container['updates_volume'] = $updates_volume; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListConditions400Response.php b/lib/Model/ListConditions400Response.php new file mode 100644 index 0000000..3fec486 --- /dev/null +++ b/lib/Model/ListConditions400Response.php @@ -0,0 +1,557 @@ + + */ +class ListConditions400Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListConditions_400_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListConditions200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request ID assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListConditions200ResponseResultsInner[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListConditions200ResponseResultsInner[] $results An array of conditions that match your query. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListDividends200Response.php b/lib/Model/ListDividends200Response.php new file mode 100644 index 0000000..5be3065 --- /dev/null +++ b/lib/Model/ListDividends200Response.php @@ -0,0 +1,515 @@ + + */ +class ListDividends200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListDividends_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListDividends200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListDividends200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListDividends200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListDividends200ResponseResultsInner.php b/lib/Model/ListDividends200ResponseResultsInner.php new file mode 100644 index 0000000..9d2a3e5 --- /dev/null +++ b/lib/Model/ListDividends200ResponseResultsInner.php @@ -0,0 +1,734 @@ + + */ +class ListDividends200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListDividends_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cash_amount' => 'float', + 'currency' => 'string', + 'declaration_date' => 'string', + 'dividend_type' => 'string', + 'ex_dividend_date' => 'string', + 'frequency' => 'int', + 'pay_date' => 'string', + 'record_date' => 'string', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cash_amount' => null, + 'currency' => null, + 'declaration_date' => null, + 'dividend_type' => null, + 'ex_dividend_date' => null, + 'frequency' => null, + 'pay_date' => null, + 'record_date' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cash_amount' => false, + 'currency' => false, + 'declaration_date' => false, + 'dividend_type' => false, + 'ex_dividend_date' => false, + 'frequency' => false, + 'pay_date' => false, + 'record_date' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cash_amount' => 'cash_amount', + 'currency' => 'currency', + 'declaration_date' => 'declaration_date', + 'dividend_type' => 'dividend_type', + 'ex_dividend_date' => 'ex_dividend_date', + 'frequency' => 'frequency', + 'pay_date' => 'pay_date', + 'record_date' => 'record_date', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cash_amount' => 'setCashAmount', + 'currency' => 'setCurrency', + 'declaration_date' => 'setDeclarationDate', + 'dividend_type' => 'setDividendType', + 'ex_dividend_date' => 'setExDividendDate', + 'frequency' => 'setFrequency', + 'pay_date' => 'setPayDate', + 'record_date' => 'setRecordDate', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cash_amount' => 'getCashAmount', + 'currency' => 'getCurrency', + 'declaration_date' => 'getDeclarationDate', + 'dividend_type' => 'getDividendType', + 'ex_dividend_date' => 'getExDividendDate', + 'frequency' => 'getFrequency', + 'pay_date' => 'getPayDate', + 'record_date' => 'getRecordDate', + 'ticker' => 'getTicker' + ]; + + /** + * 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; + } + + public const DIVIDEND_TYPE_CD = 'CD'; + public const DIVIDEND_TYPE_SC = 'SC'; + public const DIVIDEND_TYPE_LT = 'LT'; + public const DIVIDEND_TYPE_ST = 'ST'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDividendTypeAllowableValues() + { + return [ + self::DIVIDEND_TYPE_CD, + self::DIVIDEND_TYPE_SC, + self::DIVIDEND_TYPE_LT, + self::DIVIDEND_TYPE_ST, + ]; + } + + /** + * 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->setIfExists('cash_amount', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('declaration_date', $data ?? [], null); + $this->setIfExists('dividend_type', $data ?? [], null); + $this->setIfExists('ex_dividend_date', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('pay_date', $data ?? [], null); + $this->setIfExists('record_date', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cash_amount'] === null) { + $invalidProperties[] = "'cash_amount' can't be null"; + } + if ($this->container['dividend_type'] === null) { + $invalidProperties[] = "'dividend_type' can't be null"; + } + $allowedValues = $this->getDividendTypeAllowableValues(); + if (!is_null($this->container['dividend_type']) && !in_array($this->container['dividend_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'dividend_type', must be one of '%s'", + $this->container['dividend_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['ex_dividend_date'] === null) { + $invalidProperties[] = "'ex_dividend_date' can't be null"; + } + if ($this->container['frequency'] === null) { + $invalidProperties[] = "'frequency' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 cash_amount + * + * @return float + */ + public function getCashAmount() + { + return $this->container['cash_amount']; + } + + /** + * Sets cash_amount + * + * @param float $cash_amount The cash amount of the dividend per share owned. + * + * @return self + */ + public function setCashAmount($cash_amount) + { + if (is_null($cash_amount)) { + throw new \InvalidArgumentException('non-nullable cash_amount cannot be null'); + } + $this->container['cash_amount'] = $cash_amount; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency in which the dividend is paid. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets declaration_date + * + * @return string|null + */ + public function getDeclarationDate() + { + return $this->container['declaration_date']; + } + + /** + * Sets declaration_date + * + * @param string|null $declaration_date The date that the dividend was announced. + * + * @return self + */ + public function setDeclarationDate($declaration_date) + { + if (is_null($declaration_date)) { + throw new \InvalidArgumentException('non-nullable declaration_date cannot be null'); + } + $this->container['declaration_date'] = $declaration_date; + + return $this; + } + + /** + * Gets dividend_type + * + * @return string + */ + public function getDividendType() + { + return $this->container['dividend_type']; + } + + /** + * Sets dividend_type + * + * @param string $dividend_type The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC. Long-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively. + * + * @return self + */ + public function setDividendType($dividend_type) + { + if (is_null($dividend_type)) { + throw new \InvalidArgumentException('non-nullable dividend_type cannot be null'); + } + $allowedValues = $this->getDividendTypeAllowableValues(); + if (!in_array($dividend_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'dividend_type', must be one of '%s'", + $dividend_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['dividend_type'] = $dividend_type; + + return $this; + } + + /** + * Gets ex_dividend_date + * + * @return string + */ + public function getExDividendDate() + { + return $this->container['ex_dividend_date']; + } + + /** + * Sets ex_dividend_date + * + * @param string $ex_dividend_date The date that the stock first trades without the dividend, determined by the exchange. + * + * @return self + */ + public function setExDividendDate($ex_dividend_date) + { + if (is_null($ex_dividend_date)) { + throw new \InvalidArgumentException('non-nullable ex_dividend_date cannot be null'); + } + $this->container['ex_dividend_date'] = $ex_dividend_date; + + return $this; + } + + /** + * Gets frequency + * + * @return int + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param int $frequency The number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly). + * + * @return self + */ + public function setFrequency($frequency) + { + if (is_null($frequency)) { + throw new \InvalidArgumentException('non-nullable frequency cannot be null'); + } + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets pay_date + * + * @return string|null + */ + public function getPayDate() + { + return $this->container['pay_date']; + } + + /** + * Sets pay_date + * + * @param string|null $pay_date The date that the dividend is paid out. + * + * @return self + */ + public function setPayDate($pay_date) + { + if (is_null($pay_date)) { + throw new \InvalidArgumentException('non-nullable pay_date cannot be null'); + } + $this->container['pay_date'] = $pay_date; + + return $this; + } + + /** + * Gets record_date + * + * @return string|null + */ + public function getRecordDate() + { + return $this->container['record_date']; + } + + /** + * Sets record_date + * + * @param string|null $record_date The date that the stock must be held to receive the dividend, set by the company. + * + * @return self + */ + public function setRecordDate($record_date) + { + if (is_null($record_date)) { + throw new \InvalidArgumentException('non-nullable record_date cannot be null'); + } + $this->container['record_date'] = $record_date; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The ticker symbol of the dividend. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListExchanges200Response.php b/lib/Model/ListExchanges200Response.php new file mode 100644 index 0000000..6748c11 --- /dev/null +++ b/lib/Model/ListExchanges200Response.php @@ -0,0 +1,517 @@ + + */ +class ListExchanges200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListExchanges_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListExchanges200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request ID assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListExchanges200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListExchanges200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListExchanges200ResponseResultsInner.php b/lib/Model/ListExchanges200ResponseResultsInner.php new file mode 100644 index 0000000..c5135fe --- /dev/null +++ b/lib/Model/ListExchanges200ResponseResultsInner.php @@ -0,0 +1,839 @@ + + */ +class ListExchanges200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListExchanges_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acronym' => 'string', + 'asset_class' => 'string', + 'id' => 'int', + 'locale' => 'string', + 'mic' => 'string', + 'name' => 'string', + 'operating_mic' => 'string', + 'participant_id' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acronym' => null, + 'asset_class' => null, + 'id' => null, + 'locale' => null, + 'mic' => null, + 'name' => null, + 'operating_mic' => null, + 'participant_id' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'acronym' => false, + 'asset_class' => false, + 'id' => false, + 'locale' => false, + 'mic' => false, + 'name' => false, + 'operating_mic' => false, + 'participant_id' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acronym' => 'acronym', + 'asset_class' => 'asset_class', + 'id' => 'id', + 'locale' => 'locale', + 'mic' => 'mic', + 'name' => 'name', + 'operating_mic' => 'operating_mic', + 'participant_id' => 'participant_id', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acronym' => 'setAcronym', + 'asset_class' => 'setAssetClass', + 'id' => 'setId', + 'locale' => 'setLocale', + 'mic' => 'setMic', + 'name' => 'setName', + 'operating_mic' => 'setOperatingMic', + 'participant_id' => 'setParticipantId', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acronym' => 'getAcronym', + 'asset_class' => 'getAssetClass', + 'id' => 'getId', + 'locale' => 'getLocale', + 'mic' => 'getMic', + 'name' => 'getName', + 'operating_mic' => 'getOperatingMic', + 'participant_id' => 'getParticipantId', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ASSET_CLASS_STOCKS = 'stocks'; + public const ASSET_CLASS_OPTIONS = 'options'; + public const ASSET_CLASS_CRYPTO = 'crypto'; + public const ASSET_CLASS_FX = 'fx'; + public const LOCALE_US = 'us'; + public const LOCALE__GLOBAL = 'global'; + public const TYPE_EXCHANGE = 'exchange'; + public const TYPE_TRF = 'TRF'; + public const TYPE_SIP = 'SIP'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAssetClassAllowableValues() + { + return [ + self::ASSET_CLASS_STOCKS, + self::ASSET_CLASS_OPTIONS, + self::ASSET_CLASS_CRYPTO, + self::ASSET_CLASS_FX, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLocaleAllowableValues() + { + return [ + self::LOCALE_US, + self::LOCALE__GLOBAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_EXCHANGE, + self::TYPE_TRF, + self::TYPE_SIP, + ]; + } + + /** + * 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->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('asset_class', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('mic', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('operating_mic', $data ?? [], null); + $this->setIfExists('participant_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['asset_class'] === null) { + $invalidProperties[] = "'asset_class' can't be null"; + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!is_null($this->container['asset_class']) && !in_array($this->container['asset_class'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'asset_class', must be one of '%s'", + $this->container['asset_class'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['locale'] === null) { + $invalidProperties[] = "'locale' can't be null"; + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!is_null($this->container['locale']) && !in_array($this->container['locale'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'locale', must be one of '%s'", + $this->container['locale'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 acronym + * + * @return string|null + */ + public function getAcronym() + { + return $this->container['acronym']; + } + + /** + * Sets acronym + * + * @param string|null $acronym A commonly used abbreviation for this exchange. + * + * @return self + */ + public function setAcronym($acronym) + { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } + $this->container['acronym'] = $acronym; + + return $this; + } + + /** + * Gets asset_class + * + * @return string + */ + public function getAssetClass() + { + return $this->container['asset_class']; + } + + /** + * Sets asset_class + * + * @param string $asset_class An identifier for a group of similar financial instruments. + * + * @return self + */ + public function setAssetClass($asset_class) + { + if (is_null($asset_class)) { + throw new \InvalidArgumentException('non-nullable asset_class cannot be null'); + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!in_array($asset_class, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'asset_class', must be one of '%s'", + $asset_class, + implode("', '", $allowedValues) + ) + ); + } + $this->container['asset_class'] = $asset_class; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id A unique identifier used by Polygon.io for this exchange. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets locale + * + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string $locale An identifier for a geographical location. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!in_array($locale, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'locale', must be one of '%s'", + $locale, + implode("', '", $allowedValues) + ) + ); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets mic + * + * @return string|null + */ + public function getMic() + { + return $this->container['mic']; + } + + /** + * Sets mic + * + * @param string|null $mic The Market Identifer Code of this exchange (see ISO 10383). + * + * @return self + */ + public function setMic($mic) + { + if (is_null($mic)) { + throw new \InvalidArgumentException('non-nullable mic cannot be null'); + } + $this->container['mic'] = $mic; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of this exchange. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets operating_mic + * + * @return string|null + */ + public function getOperatingMic() + { + return $this->container['operating_mic']; + } + + /** + * Sets operating_mic + * + * @param string|null $operating_mic The MIC of the entity that operates this exchange. + * + * @return self + */ + public function setOperatingMic($operating_mic) + { + if (is_null($operating_mic)) { + throw new \InvalidArgumentException('non-nullable operating_mic cannot be null'); + } + $this->container['operating_mic'] = $operating_mic; + + return $this; + } + + /** + * Gets participant_id + * + * @return string|null + */ + public function getParticipantId() + { + return $this->container['participant_id']; + } + + /** + * Sets participant_id + * + * @param string|null $participant_id The ID used by SIP's to represent this exchange. + * + * @return self + */ + public function setParticipantId($participant_id) + { + if (is_null($participant_id)) { + throw new \InvalidArgumentException('non-nullable participant_id cannot be null'); + } + $this->container['participant_id'] = $participant_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Represents the type of exchange. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url A link to this exchange's website, if one exists. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListExchanges400Response.php b/lib/Model/ListExchanges400Response.php new file mode 100644 index 0000000..7d2d8ac --- /dev/null +++ b/lib/Model/ListExchanges400Response.php @@ -0,0 +1,483 @@ + + */ +class ListExchanges400Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListExchanges_400_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'request_id' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'request_id' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'request_id' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'request_id' => 'request_id', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'request_id' => 'setRequestId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'request_id' => 'getRequestId', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request ID assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilingFiles200Response.php b/lib/Model/ListFilingFiles200Response.php new file mode 100644 index 0000000..99ad433 --- /dev/null +++ b/lib/Model/ListFilingFiles200Response.php @@ -0,0 +1,557 @@ + + */ +class ListFilingFiles200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilingFiles_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url next_url + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListFilingFiles200ResponseResultsInner[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilingFiles200ResponseResultsInner.php b/lib/Model/ListFilingFiles200ResponseResultsInner.php new file mode 100644 index 0000000..5d8e784 --- /dev/null +++ b/lib/Model/ListFilingFiles200ResponseResultsInner.php @@ -0,0 +1,632 @@ + + */ +class ListFilingFiles200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilingFiles_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'filename' => 'string', + 'id' => 'string', + 'sequence' => 'int', + 'size_bytes' => 'int', + 'source_url' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'filename' => null, + 'id' => null, + 'sequence' => 'int64', + 'size_bytes' => 'int64', + 'source_url' => 'uri', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'description' => false, + 'filename' => false, + 'id' => false, + 'sequence' => false, + 'size_bytes' => false, + 'source_url' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'filename' => 'filename', + 'id' => 'id', + 'sequence' => 'sequence', + 'size_bytes' => 'size_bytes', + 'source_url' => 'source_url', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'filename' => 'setFilename', + 'id' => 'setId', + 'sequence' => 'setSequence', + 'size_bytes' => 'setSizeBytes', + 'source_url' => 'setSourceUrl', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'filename' => 'getFilename', + 'id' => 'getId', + 'sequence' => 'getSequence', + 'size_bytes' => 'getSizeBytes', + 'source_url' => 'getSourceUrl', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('description', $data ?? [], null); + $this->setIfExists('filename', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('sequence', $data ?? [], null); + $this->setIfExists('size_bytes', $data ?? [], null); + $this->setIfExists('source_url', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['sequence'] === null) { + $invalidProperties[] = "'sequence' can't be null"; + } + if ($this->container['size_bytes'] === null) { + $invalidProperties[] = "'size_bytes' can't be null"; + } + if ($this->container['source_url'] === null) { + $invalidProperties[] = "'source_url' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description A description for the contents of the file. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets filename + * + * @return string|null + */ + public function getFilename() + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string|null $filename The name for the file. + * + * @return self + */ + public function setFilename($filename) + { + if (is_null($filename)) { + throw new \InvalidArgumentException('non-nullable filename cannot be null'); + } + $this->container['filename'] = $filename; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id An identifier unique to the filing for this data entry. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets sequence + * + * @return int + */ + public function getSequence() + { + return $this->container['sequence']; + } + + /** + * Sets sequence + * + * @param int $sequence File Sequence Number + * + * @return self + */ + public function setSequence($sequence) + { + if (is_null($sequence)) { + throw new \InvalidArgumentException('non-nullable sequence cannot be null'); + } + $this->container['sequence'] = $sequence; + + return $this; + } + + /** + * Gets size_bytes + * + * @return int + */ + public function getSizeBytes() + { + return $this->container['size_bytes']; + } + + /** + * Sets size_bytes + * + * @param int $size_bytes The size of the file in bytes. + * + * @return self + */ + public function setSizeBytes($size_bytes) + { + if (is_null($size_bytes)) { + throw new \InvalidArgumentException('non-nullable size_bytes cannot be null'); + } + $this->container['size_bytes'] = $size_bytes; + + return $this; + } + + /** + * Gets source_url + * + * @return string + */ + public function getSourceUrl() + { + return $this->container['source_url']; + } + + /** + * Sets source_url + * + * @param string $source_url The source URL is a link back to the upstream source for this file. + * + * @return self + */ + public function setSourceUrl($source_url) + { + if (is_null($source_url)) { + throw new \InvalidArgumentException('non-nullable source_url cannot be null'); + } + $this->container['source_url'] = $source_url; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of document contained in the file. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilings200Response.php b/lib/Model/ListFilings200Response.php new file mode 100644 index 0000000..23ddbe1 --- /dev/null +++ b/lib/Model/ListFilings200Response.php @@ -0,0 +1,557 @@ + + */ +class ListFilings200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilings_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListFilings200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url next_url + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListFilings200ResponseResultsInner[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListFilings200ResponseResultsInner[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilings200ResponseResultsInner.php b/lib/Model/ListFilings200ResponseResultsInner.php new file mode 100644 index 0000000..f80e124 --- /dev/null +++ b/lib/Model/ListFilings200ResponseResultsInner.php @@ -0,0 +1,760 @@ + + */ +class ListFilings200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilings_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acceptance_datetime' => 'string', + 'accession_number' => 'string', + 'entities' => '\OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInner[]', + 'files_count' => 'int', + 'filing_date' => 'string', + 'id' => 'string', + 'period_of_report_date' => 'string', + 'source_url' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acceptance_datetime' => null, + 'accession_number' => null, + 'entities' => null, + 'files_count' => 'int64', + 'filing_date' => null, + 'id' => null, + 'period_of_report_date' => null, + 'source_url' => 'uri', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'acceptance_datetime' => false, + 'accession_number' => false, + 'entities' => false, + 'files_count' => false, + 'filing_date' => false, + 'id' => false, + 'period_of_report_date' => false, + 'source_url' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acceptance_datetime' => 'acceptance_datetime', + 'accession_number' => 'accession_number', + 'entities' => 'entities', + 'files_count' => 'files_count', + 'filing_date' => 'filing_date', + 'id' => 'id', + 'period_of_report_date' => 'period_of_report_date', + 'source_url' => 'source_url', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acceptance_datetime' => 'setAcceptanceDatetime', + 'accession_number' => 'setAccessionNumber', + 'entities' => 'setEntities', + 'files_count' => 'setFilesCount', + 'filing_date' => 'setFilingDate', + 'id' => 'setId', + 'period_of_report_date' => 'setPeriodOfReportDate', + 'source_url' => 'setSourceUrl', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acceptance_datetime' => 'getAcceptanceDatetime', + 'accession_number' => 'getAccessionNumber', + 'entities' => 'getEntities', + 'files_count' => 'getFilesCount', + 'filing_date' => 'getFilingDate', + 'id' => 'getId', + 'period_of_report_date' => 'getPeriodOfReportDate', + 'source_url' => 'getSourceUrl', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const TYPE_K = '10-K'; + public const TYPE_Q = '10-Q'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_K, + self::TYPE_Q, + ]; + } + + /** + * 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->setIfExists('acceptance_datetime', $data ?? [], null); + $this->setIfExists('accession_number', $data ?? [], null); + $this->setIfExists('entities', $data ?? [], null); + $this->setIfExists('files_count', $data ?? [], null); + $this->setIfExists('filing_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('period_of_report_date', $data ?? [], null); + $this->setIfExists('source_url', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['acceptance_datetime'] === null) { + $invalidProperties[] = "'acceptance_datetime' can't be null"; + } + if ($this->container['accession_number'] === null) { + $invalidProperties[] = "'accession_number' can't be null"; + } + if ($this->container['entities'] === null) { + $invalidProperties[] = "'entities' can't be null"; + } + if ($this->container['files_count'] === null) { + $invalidProperties[] = "'files_count' can't be null"; + } + if ($this->container['filing_date'] === null) { + $invalidProperties[] = "'filing_date' can't be null"; + } + if (!preg_match("/^[0-9]{8}$/", $this->container['filing_date'])) { + $invalidProperties[] = "invalid value for 'filing_date', must be conform to the pattern /^[0-9]{8}$/."; + } + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['period_of_report_date'] === null) { + $invalidProperties[] = "'period_of_report_date' can't be null"; + } + if (!preg_match("/^[0-9]{8}$/", $this->container['period_of_report_date'])) { + $invalidProperties[] = "invalid value for 'period_of_report_date', must be conform to the pattern /^[0-9]{8}$/."; + } + + if ($this->container['source_url'] === null) { + $invalidProperties[] = "'source_url' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 acceptance_datetime + * + * @return string + */ + public function getAcceptanceDatetime() + { + return $this->container['acceptance_datetime']; + } + + /** + * Sets acceptance_datetime + * + * @param string $acceptance_datetime The datetime when the filing was accepted by EDGAR in EST (format: YYYYMMDDHHMMSS) + * + * @return self + */ + public function setAcceptanceDatetime($acceptance_datetime) + { + if (is_null($acceptance_datetime)) { + throw new \InvalidArgumentException('non-nullable acceptance_datetime cannot be null'); + } + $this->container['acceptance_datetime'] = $acceptance_datetime; + + return $this; + } + + /** + * Gets accession_number + * + * @return string + */ + public function getAccessionNumber() + { + return $this->container['accession_number']; + } + + /** + * Sets accession_number + * + * @param string $accession_number Filing Accession Number + * + * @return self + */ + public function setAccessionNumber($accession_number) + { + if (is_null($accession_number)) { + throw new \InvalidArgumentException('non-nullable accession_number cannot be null'); + } + $this->container['accession_number'] = $accession_number; + + return $this; + } + + /** + * Gets entities + * + * @return \OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInner[] + */ + public function getEntities() + { + return $this->container['entities']; + } + + /** + * Sets entities + * + * @param \OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInner[] $entities Entities related to the filing (e.g. the document filers). + * + * @return self + */ + public function setEntities($entities) + { + if (is_null($entities)) { + throw new \InvalidArgumentException('non-nullable entities cannot be null'); + } + $this->container['entities'] = $entities; + + return $this; + } + + /** + * Gets files_count + * + * @return int + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int $files_count The number of files associated with the filing. + * + * @return self + */ + public function setFilesCount($files_count) + { + if (is_null($files_count)) { + throw new \InvalidArgumentException('non-nullable files_count cannot be null'); + } + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets filing_date + * + * @return string + */ + public function getFilingDate() + { + return $this->container['filing_date']; + } + + /** + * Sets filing_date + * + * @param string $filing_date The date when the filing was filed in YYYYMMDD format. + * + * @return self + */ + public function setFilingDate($filing_date) + { + if (is_null($filing_date)) { + throw new \InvalidArgumentException('non-nullable filing_date cannot be null'); + } + + if ((!preg_match("/^[0-9]{8}$/", ObjectSerializer::toString($filing_date)))) { + throw new \InvalidArgumentException("invalid value for \$filing_date when calling ListFilings200ResponseResultsInner., must conform to the pattern /^[0-9]{8}$/."); + } + + $this->container['filing_date'] = $filing_date; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier for the filing. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets period_of_report_date + * + * @return string + */ + public function getPeriodOfReportDate() + { + return $this->container['period_of_report_date']; + } + + /** + * Sets period_of_report_date + * + * @param string $period_of_report_date The period of report for the filing in YYYYMMDD format. + * + * @return self + */ + public function setPeriodOfReportDate($period_of_report_date) + { + if (is_null($period_of_report_date)) { + throw new \InvalidArgumentException('non-nullable period_of_report_date cannot be null'); + } + + if ((!preg_match("/^[0-9]{8}$/", ObjectSerializer::toString($period_of_report_date)))) { + throw new \InvalidArgumentException("invalid value for \$period_of_report_date when calling ListFilings200ResponseResultsInner., must conform to the pattern /^[0-9]{8}$/."); + } + + $this->container['period_of_report_date'] = $period_of_report_date; + + return $this; + } + + /** + * Gets source_url + * + * @return string + */ + public function getSourceUrl() + { + return $this->container['source_url']; + } + + /** + * Sets source_url + * + * @param string $source_url The source URL is a link back to the upstream source for this filing document. + * + * @return self + */ + public function setSourceUrl($source_url) + { + if (is_null($source_url)) { + throw new \InvalidArgumentException('non-nullable source_url cannot be null'); + } + $this->container['source_url'] = $source_url; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Filing Type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilings200ResponseResultsInnerEntitiesInner.php b/lib/Model/ListFilings200ResponseResultsInnerEntitiesInner.php new file mode 100644 index 0000000..217f847 --- /dev/null +++ b/lib/Model/ListFilings200ResponseResultsInnerEntitiesInner.php @@ -0,0 +1,479 @@ + + */ +class ListFilings200ResponseResultsInnerEntitiesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilings_200_response_results_inner_entities_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_data' => '\OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInnerCompanyData', + 'relation' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_data' => null, + 'relation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'company_data' => false, + 'relation' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_data' => 'company_data', + 'relation' => 'relation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_data' => 'setCompanyData', + 'relation' => 'setRelation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_data' => 'getCompanyData', + 'relation' => 'getRelation' + ]; + + /** + * 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; + } + + public const RELATION_FILER = 'filer'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRelationAllowableValues() + { + return [ + self::RELATION_FILER, + ]; + } + + /** + * 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->setIfExists('company_data', $data ?? [], null); + $this->setIfExists('relation', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['relation'] === null) { + $invalidProperties[] = "'relation' can't be null"; + } + $allowedValues = $this->getRelationAllowableValues(); + if (!is_null($this->container['relation']) && !in_array($this->container['relation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'relation', must be one of '%s'", + $this->container['relation'], + implode("', '", $allowedValues) + ); + } + + 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 company_data + * + * @return \OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInnerCompanyData|null + */ + public function getCompanyData() + { + return $this->container['company_data']; + } + + /** + * Sets company_data + * + * @param \OpenAPI\Client\Model\ListFilings200ResponseResultsInnerEntitiesInnerCompanyData|null $company_data company_data + * + * @return self + */ + public function setCompanyData($company_data) + { + if (is_null($company_data)) { + throw new \InvalidArgumentException('non-nullable company_data cannot be null'); + } + $this->container['company_data'] = $company_data; + + return $this; + } + + /** + * Gets relation + * + * @return string + */ + public function getRelation() + { + return $this->container['relation']; + } + + /** + * Sets relation + * + * @param string $relation Relationship of this entity to the filing. + * + * @return self + */ + public function setRelation($relation) + { + if (is_null($relation)) { + throw new \InvalidArgumentException('non-nullable relation cannot be null'); + } + $allowedValues = $this->getRelationAllowableValues(); + if (!in_array($relation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'relation', must be one of '%s'", + $relation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['relation'] = $relation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.php b/lib/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.php new file mode 100644 index 0000000..3ee56ce --- /dev/null +++ b/lib/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyData.php @@ -0,0 +1,520 @@ + + */ +class ListFilings200ResponseResultsInnerEntitiesInnerCompanyData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilings_200_response_results_inner_entities_inner_company_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cik' => 'string', + 'name' => 'string', + 'sic' => 'string', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cik' => null, + 'name' => null, + 'sic' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cik' => false, + 'name' => false, + 'sic' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cik' => 'cik', + 'name' => 'name', + 'sic' => 'sic', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cik' => 'setCik', + 'name' => 'setName', + 'sic' => 'setSic', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cik' => 'getCik', + 'name' => 'getName', + 'sic' => 'getSic', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('cik', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('sic', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cik'] === null) { + $invalidProperties[] = "'cik' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['sic'] === null) { + $invalidProperties[] = "'sic' can't be null"; + } + 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 cik + * + * @return string + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string $cik Central Index Key (CIK) Number + * + * @return self + */ + public function setCik($cik) + { + if (is_null($cik)) { + throw new \InvalidArgumentException('non-nullable cik cannot be null'); + } + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sic + * + * @return string + */ + public function getSic() + { + return $this->container['sic']; + } + + /** + * Sets sic + * + * @param string $sic Standard Industrial Classification (SIC) + * + * @return self + */ + public function setSic($sic) + { + if (is_null($sic)) { + throw new \InvalidArgumentException('non-nullable sic cannot be null'); + } + $this->container['sic'] = $sic; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker Ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFinancials200Response.php b/lib/Model/ListFinancials200Response.php new file mode 100644 index 0000000..6b77904 --- /dev/null +++ b/lib/Model/ListFinancials200Response.php @@ -0,0 +1,557 @@ + + */ +class ListFinancials200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFinancials_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListFinancials200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListFinancials200ResponseResultsInner[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListFinancials200ResponseResultsInner[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFinancials200ResponseResultsInner.php b/lib/Model/ListFinancials200ResponseResultsInner.php new file mode 100644 index 0000000..83d8df5 --- /dev/null +++ b/lib/Model/ListFinancials200ResponseResultsInner.php @@ -0,0 +1,853 @@ + + */ +class ListFinancials200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFinancials_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acceptance_datetime' => 'mixed', + 'cik' => 'string', + 'company_name' => 'string', + 'end_date' => 'string', + 'filing_date' => 'mixed', + 'financials' => '\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancials', + 'fiscal_period' => 'string', + 'fiscal_year' => 'string', + 'source_filing_file_url' => 'mixed', + 'source_filing_url' => 'string', + 'start_date' => 'string', + 'tickers' => 'string[]', + 'timeframe' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acceptance_datetime' => null, + 'cik' => null, + 'company_name' => null, + 'end_date' => null, + 'filing_date' => null, + 'financials' => null, + 'fiscal_period' => null, + 'fiscal_year' => null, + 'source_filing_file_url' => null, + 'source_filing_url' => null, + 'start_date' => null, + 'tickers' => null, + 'timeframe' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'acceptance_datetime' => true, + 'cik' => false, + 'company_name' => false, + 'end_date' => false, + 'filing_date' => true, + 'financials' => false, + 'fiscal_period' => false, + 'fiscal_year' => false, + 'source_filing_file_url' => true, + 'source_filing_url' => false, + 'start_date' => false, + 'tickers' => false, + 'timeframe' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acceptance_datetime' => 'acceptance_datetime', + 'cik' => 'cik', + 'company_name' => 'company_name', + 'end_date' => 'end_date', + 'filing_date' => 'filing_date', + 'financials' => 'financials', + 'fiscal_period' => 'fiscal_period', + 'fiscal_year' => 'fiscal_year', + 'source_filing_file_url' => 'source_filing_file_url', + 'source_filing_url' => 'source_filing_url', + 'start_date' => 'start_date', + 'tickers' => 'tickers', + 'timeframe' => 'timeframe' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acceptance_datetime' => 'setAcceptanceDatetime', + 'cik' => 'setCik', + 'company_name' => 'setCompanyName', + 'end_date' => 'setEndDate', + 'filing_date' => 'setFilingDate', + 'financials' => 'setFinancials', + 'fiscal_period' => 'setFiscalPeriod', + 'fiscal_year' => 'setFiscalYear', + 'source_filing_file_url' => 'setSourceFilingFileUrl', + 'source_filing_url' => 'setSourceFilingUrl', + 'start_date' => 'setStartDate', + 'tickers' => 'setTickers', + 'timeframe' => 'setTimeframe' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acceptance_datetime' => 'getAcceptanceDatetime', + 'cik' => 'getCik', + 'company_name' => 'getCompanyName', + 'end_date' => 'getEndDate', + 'filing_date' => 'getFilingDate', + 'financials' => 'getFinancials', + 'fiscal_period' => 'getFiscalPeriod', + 'fiscal_year' => 'getFiscalYear', + 'source_filing_file_url' => 'getSourceFilingFileUrl', + 'source_filing_url' => 'getSourceFilingUrl', + 'start_date' => 'getStartDate', + 'tickers' => 'getTickers', + 'timeframe' => 'getTimeframe' + ]; + + /** + * 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->setIfExists('acceptance_datetime', $data ?? [], null); + $this->setIfExists('cik', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('filing_date', $data ?? [], null); + $this->setIfExists('financials', $data ?? [], null); + $this->setIfExists('fiscal_period', $data ?? [], null); + $this->setIfExists('fiscal_year', $data ?? [], null); + $this->setIfExists('source_filing_file_url', $data ?? [], null); + $this->setIfExists('source_filing_url', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cik'] === null) { + $invalidProperties[] = "'cik' can't be null"; + } + if ($this->container['company_name'] === null) { + $invalidProperties[] = "'company_name' can't be null"; + } + if ($this->container['financials'] === null) { + $invalidProperties[] = "'financials' can't be null"; + } + if ($this->container['fiscal_period'] === null) { + $invalidProperties[] = "'fiscal_period' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + 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 acceptance_datetime + * + * @return mixed|null + */ + public function getAcceptanceDatetime() + { + return $this->container['acceptance_datetime']; + } + + /** + * Sets acceptance_datetime + * + * @param mixed|null $acceptance_datetime The datetime (EST timezone) the filing was accepted by EDGAR in YYYYMMDDHHMMSS format. + * + * @return self + */ + public function setAcceptanceDatetime($acceptance_datetime) + { + if (is_null($acceptance_datetime)) { + array_push($this->openAPINullablesSetToNull, 'acceptance_datetime'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('acceptance_datetime', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['acceptance_datetime'] = $acceptance_datetime; + + return $this; + } + + /** + * Gets cik + * + * @return string + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string $cik The CIK number for the company. + * + * @return self + */ + public function setCik($cik) + { + if (is_null($cik)) { + throw new \InvalidArgumentException('non-nullable cik cannot be null'); + } + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets company_name + * + * @return string + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string $company_name The company name. + * + * @return self + */ + public function setCompanyName($company_name) + { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets end_date + * + * @return string|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param string|null $end_date The end date of the period that these financials cover in YYYYMMDD format. + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets filing_date + * + * @return mixed|null + */ + public function getFilingDate() + { + return $this->container['filing_date']; + } + + /** + * Sets filing_date + * + * @param mixed|null $filing_date The date that the SEC filing which these financials were derived from was made available. Note that this is not necessarily the date when this information became public, as some companies may publish a press release before filing with the SEC. + * + * @return self + */ + public function setFilingDate($filing_date) + { + if (is_null($filing_date)) { + array_push($this->openAPINullablesSetToNull, 'filing_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filing_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['filing_date'] = $filing_date; + + return $this; + } + + /** + * Gets financials + * + * @return \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancials + */ + public function getFinancials() + { + return $this->container['financials']; + } + + /** + * Sets financials + * + * @param \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancials $financials financials + * + * @return self + */ + public function setFinancials($financials) + { + if (is_null($financials)) { + throw new \InvalidArgumentException('non-nullable financials cannot be null'); + } + $this->container['financials'] = $financials; + + return $this; + } + + /** + * Gets fiscal_period + * + * @return string + */ + public function getFiscalPeriod() + { + return $this->container['fiscal_period']; + } + + /** + * Sets fiscal_period + * + * @param string $fiscal_period Fiscal period of the report according to the company (Q1, Q2, Q3, Q4, or FY). + * + * @return self + */ + public function setFiscalPeriod($fiscal_period) + { + if (is_null($fiscal_period)) { + throw new \InvalidArgumentException('non-nullable fiscal_period cannot be null'); + } + $this->container['fiscal_period'] = $fiscal_period; + + return $this; + } + + /** + * Gets fiscal_year + * + * @return string|null + */ + public function getFiscalYear() + { + return $this->container['fiscal_year']; + } + + /** + * Sets fiscal_year + * + * @param string|null $fiscal_year Fiscal year of the report according to the company. + * + * @return self + */ + public function setFiscalYear($fiscal_year) + { + if (is_null($fiscal_year)) { + throw new \InvalidArgumentException('non-nullable fiscal_year cannot be null'); + } + $this->container['fiscal_year'] = $fiscal_year; + + return $this; + } + + /** + * Gets source_filing_file_url + * + * @return mixed|null + */ + public function getSourceFilingFileUrl() + { + return $this->container['source_filing_file_url']; + } + + /** + * Sets source_filing_file_url + * + * @param mixed|null $source_filing_file_url The URL of the specific XBRL instance document within the SEC filing that these financials were derived from. + * + * @return self + */ + public function setSourceFilingFileUrl($source_filing_file_url) + { + if (is_null($source_filing_file_url)) { + array_push($this->openAPINullablesSetToNull, 'source_filing_file_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('source_filing_file_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['source_filing_file_url'] = $source_filing_file_url; + + return $this; + } + + /** + * Gets source_filing_url + * + * @return string|null + */ + public function getSourceFilingUrl() + { + return $this->container['source_filing_url']; + } + + /** + * Sets source_filing_url + * + * @param string|null $source_filing_url The URL of the SEC filing that these financials were derived from. + * + * @return self + */ + public function setSourceFilingUrl($source_filing_url) + { + if (is_null($source_filing_url)) { + throw new \InvalidArgumentException('non-nullable source_filing_url cannot be null'); + } + $this->container['source_filing_url'] = $source_filing_url; + + return $this; + } + + /** + * Gets start_date + * + * @return string|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param string|null $start_date The start date of the period that these financials cover in YYYYMMDD format. + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets tickers + * + * @return string[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param string[]|null $tickers The list of ticker symbols for the company. + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The timeframe of the report (quarterly, annual or ttm). + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFinancials200ResponseResultsInnerFinancials.php b/lib/Model/ListFinancials200ResponseResultsInnerFinancials.php new file mode 100644 index 0000000..5073cdb --- /dev/null +++ b/lib/Model/ListFinancials200ResponseResultsInnerFinancials.php @@ -0,0 +1,511 @@ + + */ +class ListFinancials200ResponseResultsInnerFinancials implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFinancials_200_response_results_inner_financials'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_sheet' => '\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet', + 'cash_flow_statement' => 'object', + 'comprehensive_income' => 'object', + 'income_statement' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_sheet' => null, + 'cash_flow_statement' => null, + 'comprehensive_income' => null, + 'income_statement' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'balance_sheet' => false, + 'cash_flow_statement' => false, + 'comprehensive_income' => false, + 'income_statement' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_sheet' => 'balance_sheet', + 'cash_flow_statement' => 'cash_flow_statement', + 'comprehensive_income' => 'comprehensive_income', + 'income_statement' => 'income_statement' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_sheet' => 'setBalanceSheet', + 'cash_flow_statement' => 'setCashFlowStatement', + 'comprehensive_income' => 'setComprehensiveIncome', + 'income_statement' => 'setIncomeStatement' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_sheet' => 'getBalanceSheet', + 'cash_flow_statement' => 'getCashFlowStatement', + 'comprehensive_income' => 'getComprehensiveIncome', + 'income_statement' => 'getIncomeStatement' + ]; + + /** + * 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->setIfExists('balance_sheet', $data ?? [], null); + $this->setIfExists('cash_flow_statement', $data ?? [], null); + $this->setIfExists('comprehensive_income', $data ?? [], null); + $this->setIfExists('income_statement', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 balance_sheet + * + * @return \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet|null + */ + public function getBalanceSheet() + { + return $this->container['balance_sheet']; + } + + /** + * Sets balance_sheet + * + * @param \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet|null $balance_sheet balance_sheet + * + * @return self + */ + public function setBalanceSheet($balance_sheet) + { + if (is_null($balance_sheet)) { + throw new \InvalidArgumentException('non-nullable balance_sheet cannot be null'); + } + $this->container['balance_sheet'] = $balance_sheet; + + return $this; + } + + /** + * Gets cash_flow_statement + * + * @return object|null + */ + public function getCashFlowStatement() + { + return $this->container['cash_flow_statement']; + } + + /** + * Sets cash_flow_statement + * + * @param object|null $cash_flow_statement Cash flow statement. The keys in this object can be any of the fields listed in the Cash Flow Statement section of the financials API glossary of terms. See the attributes of the objects within `balance_sheet` for more details. + * + * @return self + */ + public function setCashFlowStatement($cash_flow_statement) + { + if (is_null($cash_flow_statement)) { + throw new \InvalidArgumentException('non-nullable cash_flow_statement cannot be null'); + } + $this->container['cash_flow_statement'] = $cash_flow_statement; + + return $this; + } + + /** + * Gets comprehensive_income + * + * @return object|null + */ + public function getComprehensiveIncome() + { + return $this->container['comprehensive_income']; + } + + /** + * Sets comprehensive_income + * + * @param object|null $comprehensive_income Comprehensive income. The keys in this object can be any of the fields listed in the Comprehensive Income section of the financials API glossary of terms. See the attributes of the objects within `balance_sheet` for more details. + * + * @return self + */ + public function setComprehensiveIncome($comprehensive_income) + { + if (is_null($comprehensive_income)) { + throw new \InvalidArgumentException('non-nullable comprehensive_income cannot be null'); + } + $this->container['comprehensive_income'] = $comprehensive_income; + + return $this; + } + + /** + * Gets income_statement + * + * @return object|null + */ + public function getIncomeStatement() + { + return $this->container['income_statement']; + } + + /** + * Sets income_statement + * + * @param object|null $income_statement Income statement. The keys in this object can be any of the fields listed in the Income Statement section of the financials API glossary of terms. See the attributes of the objects within `balance_sheet` for more details. + * + * @return self + */ + public function setIncomeStatement($income_statement) + { + if (is_null($income_statement)) { + throw new \InvalidArgumentException('non-nullable income_statement cannot be null'); + } + $this->container['income_statement'] = $income_statement; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.php b/lib/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.php new file mode 100644 index 0000000..421dc7c --- /dev/null +++ b/lib/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheet.php @@ -0,0 +1,410 @@ + + */ +class ListFinancials200ResponseResultsInnerFinancialsBalanceSheet implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFinancials_200_response_results_inner_financials_balance_sheet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '' => '\OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + '' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '' => '*' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '' => 'set' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '' => 'get' + ]; + + /** + * 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->setIfExists('', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 + * + * @return \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet|null + */ + public function get() + { + return $this->container['']; + } + + /** + * Sets + * + * @param \OpenAPI\Client\Model\ListFinancials200ResponseResultsInnerFinancialsBalanceSheet|null $ + * + * @return self + */ + public function set($) + { + if (is_null($)) { + throw new \InvalidArgumentException('non-nullable cannot be null'); + } + $this->container[''] = $; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListNews200Response.php b/lib/Model/ListNews200Response.php new file mode 100644 index 0000000..8f8e4fb --- /dev/null +++ b/lib/Model/ListNews200Response.php @@ -0,0 +1,545 @@ + + */ +class ListNews200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNews_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListNews200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListNews200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListNews200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListNews200ResponseResultsInner.php b/lib/Model/ListNews200ResponseResultsInner.php new file mode 100644 index 0000000..4882036 --- /dev/null +++ b/lib/Model/ListNews200ResponseResultsInner.php @@ -0,0 +1,770 @@ + + */ +class ListNews200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNews_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amp_url' => 'string', + 'article_url' => 'string', + 'author' => 'string', + 'description' => 'string', + 'id' => 'string', + 'image_url' => 'string', + 'keywords' => 'string[]', + 'published_utc' => '\DateTime', + 'publisher' => '\OpenAPI\Client\Model\ListNews200ResponseResultsInnerPublisher', + 'tickers' => 'string[]', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amp_url' => null, + 'article_url' => null, + 'author' => null, + 'description' => null, + 'id' => null, + 'image_url' => null, + 'keywords' => null, + 'published_utc' => 'date-time', + 'publisher' => null, + 'tickers' => null, + 'title' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'amp_url' => false, + 'article_url' => false, + 'author' => false, + 'description' => false, + 'id' => false, + 'image_url' => false, + 'keywords' => false, + 'published_utc' => false, + 'publisher' => false, + 'tickers' => false, + 'title' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amp_url' => 'amp_url', + 'article_url' => 'article_url', + 'author' => 'author', + 'description' => 'description', + 'id' => 'id', + 'image_url' => 'image_url', + 'keywords' => 'keywords', + 'published_utc' => 'published_utc', + 'publisher' => 'publisher', + 'tickers' => 'tickers', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amp_url' => 'setAmpUrl', + 'article_url' => 'setArticleUrl', + 'author' => 'setAuthor', + 'description' => 'setDescription', + 'id' => 'setId', + 'image_url' => 'setImageUrl', + 'keywords' => 'setKeywords', + 'published_utc' => 'setPublishedUtc', + 'publisher' => 'setPublisher', + 'tickers' => 'setTickers', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amp_url' => 'getAmpUrl', + 'article_url' => 'getArticleUrl', + 'author' => 'getAuthor', + 'description' => 'getDescription', + 'id' => 'getId', + 'image_url' => 'getImageUrl', + 'keywords' => 'getKeywords', + 'published_utc' => 'getPublishedUtc', + 'publisher' => 'getPublisher', + 'tickers' => 'getTickers', + 'title' => 'getTitle' + ]; + + /** + * 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->setIfExists('amp_url', $data ?? [], null); + $this->setIfExists('article_url', $data ?? [], null); + $this->setIfExists('author', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('image_url', $data ?? [], null); + $this->setIfExists('keywords', $data ?? [], null); + $this->setIfExists('published_utc', $data ?? [], null); + $this->setIfExists('publisher', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['article_url'] === null) { + $invalidProperties[] = "'article_url' can't be null"; + } + if ($this->container['author'] === null) { + $invalidProperties[] = "'author' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['published_utc'] === null) { + $invalidProperties[] = "'published_utc' can't be null"; + } + if ($this->container['publisher'] === null) { + $invalidProperties[] = "'publisher' can't be null"; + } + if ($this->container['tickers'] === null) { + $invalidProperties[] = "'tickers' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + 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 amp_url + * + * @return string|null + */ + public function getAmpUrl() + { + return $this->container['amp_url']; + } + + /** + * Sets amp_url + * + * @param string|null $amp_url The mobile friendly Accelerated Mobile Page (AMP) URL. + * + * @return self + */ + public function setAmpUrl($amp_url) + { + if (is_null($amp_url)) { + throw new \InvalidArgumentException('non-nullable amp_url cannot be null'); + } + $this->container['amp_url'] = $amp_url; + + return $this; + } + + /** + * Gets article_url + * + * @return string + */ + public function getArticleUrl() + { + return $this->container['article_url']; + } + + /** + * Sets article_url + * + * @param string $article_url A link to the news article. + * + * @return self + */ + public function setArticleUrl($article_url) + { + if (is_null($article_url)) { + throw new \InvalidArgumentException('non-nullable article_url cannot be null'); + } + $this->container['article_url'] = $article_url; + + return $this; + } + + /** + * Gets author + * + * @return string + */ + public function getAuthor() + { + return $this->container['author']; + } + + /** + * Sets author + * + * @param string $author The article's author. + * + * @return self + */ + public function setAuthor($author) + { + if (is_null($author)) { + throw new \InvalidArgumentException('non-nullable author cannot be null'); + } + $this->container['author'] = $author; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the article. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier for the article. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets image_url + * + * @return string|null + */ + public function getImageUrl() + { + return $this->container['image_url']; + } + + /** + * Sets image_url + * + * @param string|null $image_url The article's image URL. + * + * @return self + */ + public function setImageUrl($image_url) + { + if (is_null($image_url)) { + throw new \InvalidArgumentException('non-nullable image_url cannot be null'); + } + $this->container['image_url'] = $image_url; + + return $this; + } + + /** + * Gets keywords + * + * @return string[]|null + */ + public function getKeywords() + { + return $this->container['keywords']; + } + + /** + * Sets keywords + * + * @param string[]|null $keywords The keywords associated with the article (which will vary depending on the publishing source). + * + * @return self + */ + public function setKeywords($keywords) + { + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + } + $this->container['keywords'] = $keywords; + + return $this; + } + + /** + * Gets published_utc + * + * @return \DateTime + */ + public function getPublishedUtc() + { + return $this->container['published_utc']; + } + + /** + * Sets published_utc + * + * @param \DateTime $published_utc The date the article was published on. + * + * @return self + */ + public function setPublishedUtc($published_utc) + { + if (is_null($published_utc)) { + throw new \InvalidArgumentException('non-nullable published_utc cannot be null'); + } + $this->container['published_utc'] = $published_utc; + + return $this; + } + + /** + * Gets publisher + * + * @return \OpenAPI\Client\Model\ListNews200ResponseResultsInnerPublisher + */ + public function getPublisher() + { + return $this->container['publisher']; + } + + /** + * Sets publisher + * + * @param \OpenAPI\Client\Model\ListNews200ResponseResultsInnerPublisher $publisher publisher + * + * @return self + */ + public function setPublisher($publisher) + { + if (is_null($publisher)) { + throw new \InvalidArgumentException('non-nullable publisher cannot be null'); + } + $this->container['publisher'] = $publisher; + + return $this; + } + + /** + * Gets tickers + * + * @return string[] + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param string[] $tickers The ticker symbols associated with the article. + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The title of the news article. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListNews200ResponseResultsInnerPublisher.php b/lib/Model/ListNews200ResponseResultsInnerPublisher.php new file mode 100644 index 0000000..63cf4b9 --- /dev/null +++ b/lib/Model/ListNews200ResponseResultsInnerPublisher.php @@ -0,0 +1,520 @@ + + */ +class ListNews200ResponseResultsInnerPublisher implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNews_200_response_results_inner_publisher'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'favicon_url' => 'string', + 'homepage_url' => 'string', + 'logo_url' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'favicon_url' => null, + 'homepage_url' => null, + 'logo_url' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'favicon_url' => false, + 'homepage_url' => false, + 'logo_url' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'favicon_url' => 'favicon_url', + 'homepage_url' => 'homepage_url', + 'logo_url' => 'logo_url', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'favicon_url' => 'setFaviconUrl', + 'homepage_url' => 'setHomepageUrl', + 'logo_url' => 'setLogoUrl', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'favicon_url' => 'getFaviconUrl', + 'homepage_url' => 'getHomepageUrl', + 'logo_url' => 'getLogoUrl', + 'name' => 'getName' + ]; + + /** + * 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->setIfExists('favicon_url', $data ?? [], null); + $this->setIfExists('homepage_url', $data ?? [], null); + $this->setIfExists('logo_url', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['homepage_url'] === null) { + $invalidProperties[] = "'homepage_url' can't be null"; + } + if ($this->container['logo_url'] === null) { + $invalidProperties[] = "'logo_url' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + 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 favicon_url + * + * @return string|null + */ + public function getFaviconUrl() + { + return $this->container['favicon_url']; + } + + /** + * Sets favicon_url + * + * @param string|null $favicon_url The publisher's homepage favicon URL. + * + * @return self + */ + public function setFaviconUrl($favicon_url) + { + if (is_null($favicon_url)) { + throw new \InvalidArgumentException('non-nullable favicon_url cannot be null'); + } + $this->container['favicon_url'] = $favicon_url; + + return $this; + } + + /** + * Gets homepage_url + * + * @return string + */ + public function getHomepageUrl() + { + return $this->container['homepage_url']; + } + + /** + * Sets homepage_url + * + * @param string $homepage_url The publisher's homepage URL. + * + * @return self + */ + public function setHomepageUrl($homepage_url) + { + if (is_null($homepage_url)) { + throw new \InvalidArgumentException('non-nullable homepage_url cannot be null'); + } + $this->container['homepage_url'] = $homepage_url; + + return $this; + } + + /** + * Gets logo_url + * + * @return string + */ + public function getLogoUrl() + { + return $this->container['logo_url']; + } + + /** + * Sets logo_url + * + * @param string $logo_url The publisher's logo URL. + * + * @return self + */ + public function setLogoUrl($logo_url) + { + if (is_null($logo_url)) { + throw new \InvalidArgumentException('non-nullable logo_url cannot be null'); + } + $this->container['logo_url'] = $logo_url; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The publisher's name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListNewsPublishedUtcParameter.php b/lib/Model/ListNewsPublishedUtcParameter.php new file mode 100644 index 0000000..c3aede9 --- /dev/null +++ b/lib/Model/ListNewsPublishedUtcParameter.php @@ -0,0 +1,381 @@ + + */ +class ListNewsPublishedUtcParameter implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNews_published_utc_parameter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListOptionsContracts200Response.php b/lib/Model/ListOptionsContracts200Response.php new file mode 100644 index 0000000..1301942 --- /dev/null +++ b/lib/Model/ListOptionsContracts200Response.php @@ -0,0 +1,511 @@ + + */ +class ListOptionsContracts200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListOptionsContracts_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListOptionsContracts200ResponseResultsInner.php b/lib/Model/ListOptionsContracts200ResponseResultsInner.php new file mode 100644 index 0000000..bebeed7 --- /dev/null +++ b/lib/Model/ListOptionsContracts200ResponseResultsInner.php @@ -0,0 +1,785 @@ + + */ +class ListOptionsContracts200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListOptionsContracts_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_underlyings' => '\OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner[]', + 'cfi' => 'string', + 'contract_type' => 'string', + 'correction' => 'int', + 'exercise_style' => 'string', + 'expiration_date' => 'string', + 'primary_exchange' => 'string', + 'shares_per_contract' => 'float', + 'strike_price' => 'float', + 'ticker' => 'string', + 'underlying_ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_underlyings' => null, + 'cfi' => null, + 'contract_type' => null, + 'correction' => null, + 'exercise_style' => null, + 'expiration_date' => null, + 'primary_exchange' => null, + 'shares_per_contract' => null, + 'strike_price' => null, + 'ticker' => null, + 'underlying_ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'additional_underlyings' => false, + 'cfi' => false, + 'contract_type' => false, + 'correction' => false, + 'exercise_style' => false, + 'expiration_date' => false, + 'primary_exchange' => false, + 'shares_per_contract' => false, + 'strike_price' => false, + 'ticker' => false, + 'underlying_ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_underlyings' => 'additional_underlyings', + 'cfi' => 'cfi', + 'contract_type' => 'contract_type', + 'correction' => 'correction', + 'exercise_style' => 'exercise_style', + 'expiration_date' => 'expiration_date', + 'primary_exchange' => 'primary_exchange', + 'shares_per_contract' => 'shares_per_contract', + 'strike_price' => 'strike_price', + 'ticker' => 'ticker', + 'underlying_ticker' => 'underlying_ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_underlyings' => 'setAdditionalUnderlyings', + 'cfi' => 'setCfi', + 'contract_type' => 'setContractType', + 'correction' => 'setCorrection', + 'exercise_style' => 'setExerciseStyle', + 'expiration_date' => 'setExpirationDate', + 'primary_exchange' => 'setPrimaryExchange', + 'shares_per_contract' => 'setSharesPerContract', + 'strike_price' => 'setStrikePrice', + 'ticker' => 'setTicker', + 'underlying_ticker' => 'setUnderlyingTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_underlyings' => 'getAdditionalUnderlyings', + 'cfi' => 'getCfi', + 'contract_type' => 'getContractType', + 'correction' => 'getCorrection', + 'exercise_style' => 'getExerciseStyle', + 'expiration_date' => 'getExpirationDate', + 'primary_exchange' => 'getPrimaryExchange', + 'shares_per_contract' => 'getSharesPerContract', + 'strike_price' => 'getStrikePrice', + 'ticker' => 'getTicker', + 'underlying_ticker' => 'getUnderlyingTicker' + ]; + + /** + * 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; + } + + public const EXERCISE_STYLE_AMERICAN = 'american'; + public const EXERCISE_STYLE_EUROPEAN = 'european'; + public const EXERCISE_STYLE_BERMUDAN = 'bermudan'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExerciseStyleAllowableValues() + { + return [ + self::EXERCISE_STYLE_AMERICAN, + self::EXERCISE_STYLE_EUROPEAN, + self::EXERCISE_STYLE_BERMUDAN, + ]; + } + + /** + * 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->setIfExists('additional_underlyings', $data ?? [], null); + $this->setIfExists('cfi', $data ?? [], null); + $this->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('correction', $data ?? [], null); + $this->setIfExists('exercise_style', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('primary_exchange', $data ?? [], null); + $this->setIfExists('shares_per_contract', $data ?? [], null); + $this->setIfExists('strike_price', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('underlying_ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!is_null($this->container['exercise_style']) && !in_array($this->container['exercise_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exercise_style', must be one of '%s'", + $this->container['exercise_style'], + implode("', '", $allowedValues) + ); + } + + 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 additional_underlyings + * + * @return \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner[]|null + */ + public function getAdditionalUnderlyings() + { + return $this->container['additional_underlyings']; + } + + /** + * Sets additional_underlyings + * + * @param \OpenAPI\Client\Model\ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner[]|null $additional_underlyings If an option contract has additional underlyings or deliverables associated with it, they will appear here. See here for some examples of what might cause a contract to have additional underlyings. + * + * @return self + */ + public function setAdditionalUnderlyings($additional_underlyings) + { + if (is_null($additional_underlyings)) { + throw new \InvalidArgumentException('non-nullable additional_underlyings cannot be null'); + } + $this->container['additional_underlyings'] = $additional_underlyings; + + return $this; + } + + /** + * Gets cfi + * + * @return string|null + */ + public function getCfi() + { + return $this->container['cfi']; + } + + /** + * Sets cfi + * + * @param string|null $cfi The 6 letter CFI code of the contract (defined in ISO 10962) + * + * @return self + */ + public function setCfi($cfi) + { + if (is_null($cfi)) { + throw new \InvalidArgumentException('non-nullable cfi cannot be null'); + } + $this->container['cfi'] = $cfi; + + return $this; + } + + /** + * Gets contract_type + * + * @return string|null + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string|null $contract_type The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + throw new \InvalidArgumentException('non-nullable contract_type cannot be null'); + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets correction + * + * @return int|null + */ + public function getCorrection() + { + return $this->container['correction']; + } + + /** + * Sets correction + * + * @param int|null $correction The correction number for this option contract. + * + * @return self + */ + public function setCorrection($correction) + { + if (is_null($correction)) { + throw new \InvalidArgumentException('non-nullable correction cannot be null'); + } + $this->container['correction'] = $correction; + + return $this; + } + + /** + * Gets exercise_style + * + * @return string|null + */ + public function getExerciseStyle() + { + return $this->container['exercise_style']; + } + + /** + * Sets exercise_style + * + * @param string|null $exercise_style The exercise style of this contract. See this link for more details on exercise styles. + * + * @return self + */ + public function setExerciseStyle($exercise_style) + { + if (is_null($exercise_style)) { + throw new \InvalidArgumentException('non-nullable exercise_style cannot be null'); + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!in_array($exercise_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exercise_style', must be one of '%s'", + $exercise_style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exercise_style'] = $exercise_style; + + return $this; + } + + /** + * Gets expiration_date + * + * @return string|null + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param string|null $expiration_date The contract's expiration date in YYYY-MM-DD format. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets primary_exchange + * + * @return string|null + */ + public function getPrimaryExchange() + { + return $this->container['primary_exchange']; + } + + /** + * Sets primary_exchange + * + * @param string|null $primary_exchange The MIC code of the primary exchange that this contract is listed on. + * + * @return self + */ + public function setPrimaryExchange($primary_exchange) + { + if (is_null($primary_exchange)) { + throw new \InvalidArgumentException('non-nullable primary_exchange cannot be null'); + } + $this->container['primary_exchange'] = $primary_exchange; + + return $this; + } + + /** + * Gets shares_per_contract + * + * @return float|null + */ + public function getSharesPerContract() + { + return $this->container['shares_per_contract']; + } + + /** + * Sets shares_per_contract + * + * @param float|null $shares_per_contract The number of shares per contract for this contract. + * + * @return self + */ + public function setSharesPerContract($shares_per_contract) + { + if (is_null($shares_per_contract)) { + throw new \InvalidArgumentException('non-nullable shares_per_contract cannot be null'); + } + $this->container['shares_per_contract'] = $shares_per_contract; + + return $this; + } + + /** + * Gets strike_price + * + * @return float|null + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param float|null $strike_price The strike price of the option contract. + * + * @return self + */ + public function setStrikePrice($strike_price) + { + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + } + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The ticker for the option contract. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets underlying_ticker + * + * @return string|null + */ + public function getUnderlyingTicker() + { + return $this->container['underlying_ticker']; + } + + /** + * Sets underlying_ticker + * + * @param string|null $underlying_ticker The underlying ticker that the option contract relates to. + * + * @return self + */ + public function setUnderlyingTicker($underlying_ticker) + { + if (is_null($underlying_ticker)) { + throw new \InvalidArgumentException('non-nullable underlying_ticker cannot be null'); + } + $this->container['underlying_ticker'] = $underlying_ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.php b/lib/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.php new file mode 100644 index 0000000..2ca672f --- /dev/null +++ b/lib/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner.php @@ -0,0 +1,477 @@ + + */ +class ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListOptionsContracts_200_response_results_inner_additional_underlyings_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'float', + 'type' => 'string', + 'underlying' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'type' => null, + 'underlying' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'amount' => false, + 'type' => false, + 'underlying' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'type' => 'type', + 'underlying' => 'underlying' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'type' => 'setType', + 'underlying' => 'setUnderlying' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'type' => 'getType', + 'underlying' => 'getUnderlying' + ]; + + /** + * 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->setIfExists('amount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('underlying', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 amount + * + * @return float|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount The number of shares per contract of the additional underlying, or the cash-in-lieu amount of the currency. + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the additional underlying asset, either equity or currency. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets underlying + * + * @return string|null + */ + public function getUnderlying() + { + return $this->container['underlying']; + } + + /** + * Sets underlying + * + * @param string|null $underlying The name of the additional underlying asset. + * + * @return self + */ + public function setUnderlying($underlying) + { + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + } + $this->container['underlying'] = $underlying; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListStockSplits200Response.php b/lib/Model/ListStockSplits200Response.php new file mode 100644 index 0000000..ec73bab --- /dev/null +++ b/lib/Model/ListStockSplits200Response.php @@ -0,0 +1,511 @@ + + */ +class ListStockSplits200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListStockSplits_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListStockSplits200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListStockSplits200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListStockSplits200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListStockSplits200ResponseResultsInner.php b/lib/Model/ListStockSplits200ResponseResultsInner.php new file mode 100644 index 0000000..b647b71 --- /dev/null +++ b/lib/Model/ListStockSplits200ResponseResultsInner.php @@ -0,0 +1,517 @@ + + */ +class ListStockSplits200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListStockSplits_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'execution_date' => 'string', + 'split_from' => 'float', + 'split_to' => 'float', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'execution_date' => null, + 'split_from' => 'float', + 'split_to' => 'float', + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'execution_date' => false, + 'split_from' => false, + 'split_to' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'execution_date' => 'execution_date', + 'split_from' => 'split_from', + 'split_to' => 'split_to', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'execution_date' => 'setExecutionDate', + 'split_from' => 'setSplitFrom', + 'split_to' => 'setSplitTo', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'execution_date' => 'getExecutionDate', + 'split_from' => 'getSplitFrom', + 'split_to' => 'getSplitTo', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('execution_date', $data ?? [], null); + $this->setIfExists('split_from', $data ?? [], null); + $this->setIfExists('split_to', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['split_from'] === null) { + $invalidProperties[] = "'split_from' can't be null"; + } + if ($this->container['split_to'] === null) { + $invalidProperties[] = "'split_to' can't be null"; + } + 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 execution_date + * + * @return string|null + */ + public function getExecutionDate() + { + return $this->container['execution_date']; + } + + /** + * Sets execution_date + * + * @param string|null $execution_date The execution date of the stock split. On this date the stock split was applied. + * + * @return self + */ + public function setExecutionDate($execution_date) + { + if (is_null($execution_date)) { + throw new \InvalidArgumentException('non-nullable execution_date cannot be null'); + } + $this->container['execution_date'] = $execution_date; + + return $this; + } + + /** + * Gets split_from + * + * @return float + */ + public function getSplitFrom() + { + return $this->container['split_from']; + } + + /** + * Sets split_from + * + * @param float $split_from The second number in the split ratio. For example: In a 2-for-1 split, split_from would be 1. + * + * @return self + */ + public function setSplitFrom($split_from) + { + if (is_null($split_from)) { + throw new \InvalidArgumentException('non-nullable split_from cannot be null'); + } + $this->container['split_from'] = $split_from; + + return $this; + } + + /** + * Gets split_to + * + * @return float + */ + public function getSplitTo() + { + return $this->container['split_to']; + } + + /** + * Sets split_to + * + * @param float $split_to The first number in the split ratio. For example: In a 2-for-1 split, split_to would be 2. + * + * @return self + */ + public function setSplitTo($split_to) + { + if (is_null($split_to)) { + throw new \InvalidArgumentException('non-nullable split_to cannot be null'); + } + $this->container['split_to'] = $split_to; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The ticker symbol of the stock split. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickerTaxonomyClassifications200Response.php b/lib/Model/ListTickerTaxonomyClassifications200Response.php new file mode 100644 index 0000000..1180eba --- /dev/null +++ b/lib/Model/ListTickerTaxonomyClassifications200Response.php @@ -0,0 +1,517 @@ + + */ +class ListTickerTaxonomyClassifications200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickerTaxonomyClassifications_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListTickerTaxonomyClassifications200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListTickerTaxonomyClassifications200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickerTaxonomyClassifications200ResponseResultsInner.php b/lib/Model/ListTickerTaxonomyClassifications200ResponseResultsInner.php new file mode 100644 index 0000000..e87a9d1 --- /dev/null +++ b/lib/Model/ListTickerTaxonomyClassifications200ResponseResultsInner.php @@ -0,0 +1,545 @@ + + */ +class ListTickerTaxonomyClassifications200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickerTaxonomyClassifications_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'category' => 'string', + 'reason' => 'string', + 'relevance' => 'float', + 'tag' => 'string', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'category' => null, + 'reason' => null, + 'relevance' => 'double', + 'tag' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'category' => false, + 'reason' => false, + 'relevance' => false, + 'tag' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category' => 'category', + 'reason' => 'reason', + 'relevance' => 'relevance', + 'tag' => 'tag', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'reason' => 'setReason', + 'relevance' => 'setRelevance', + 'tag' => 'setTag', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'reason' => 'getReason', + 'relevance' => 'getRelevance', + 'tag' => 'getTag', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('category', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('relevance', $data ?? [], null); + $this->setIfExists('tag', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The classification category. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason why the classification was given. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets relevance + * + * @return float|null + */ + public function getRelevance() + { + return $this->container['relevance']; + } + + /** + * Sets relevance + * + * @param float|null $relevance The relevance score for the tag. This is a measure of confidence in the tag classification. + * + * @return self + */ + public function setRelevance($relevance) + { + if (is_null($relevance)) { + throw new \InvalidArgumentException('non-nullable relevance cannot be null'); + } + $this->container['relevance'] = $relevance; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag The classification tag. Each category has a set of associated tags. + * + * @return self + */ + public function setTag($tag) + { + if (is_null($tag)) { + throw new \InvalidArgumentException('non-nullable tag cannot be null'); + } + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The ticker symbol for the asset. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickerTypes200Response.php b/lib/Model/ListTickerTypes200Response.php new file mode 100644 index 0000000..3b05c65 --- /dev/null +++ b/lib/Model/ListTickerTypes200Response.php @@ -0,0 +1,517 @@ + + */ +class ListTickerTypes200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickerTypes_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListTickerTypes200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request ID assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListTickerTypes200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListTickerTypes200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickerTypes200ResponseResultsInner.php b/lib/Model/ListTickerTypes200ResponseResultsInner.php new file mode 100644 index 0000000..1e9ba16 --- /dev/null +++ b/lib/Model/ListTickerTypes200ResponseResultsInner.php @@ -0,0 +1,598 @@ + + */ +class ListTickerTypes200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickerTypes_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'asset_class' => 'string', + 'code' => 'string', + 'description' => 'string', + 'locale' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'asset_class' => null, + 'code' => null, + 'description' => null, + 'locale' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'asset_class' => false, + 'code' => false, + 'description' => false, + 'locale' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'asset_class' => 'asset_class', + 'code' => 'code', + 'description' => 'description', + 'locale' => 'locale' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'asset_class' => 'setAssetClass', + 'code' => 'setCode', + 'description' => 'setDescription', + 'locale' => 'setLocale' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'asset_class' => 'getAssetClass', + 'code' => 'getCode', + 'description' => 'getDescription', + 'locale' => 'getLocale' + ]; + + /** + * 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; + } + + public const ASSET_CLASS_STOCKS = 'stocks'; + public const ASSET_CLASS_OPTIONS = 'options'; + public const ASSET_CLASS_CRYPTO = 'crypto'; + public const ASSET_CLASS_FX = 'fx'; + public const ASSET_CLASS_INDICES = 'indices'; + public const LOCALE_US = 'us'; + public const LOCALE__GLOBAL = 'global'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAssetClassAllowableValues() + { + return [ + self::ASSET_CLASS_STOCKS, + self::ASSET_CLASS_OPTIONS, + self::ASSET_CLASS_CRYPTO, + self::ASSET_CLASS_FX, + self::ASSET_CLASS_INDICES, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLocaleAllowableValues() + { + return [ + self::LOCALE_US, + self::LOCALE__GLOBAL, + ]; + } + + /** + * 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->setIfExists('asset_class', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['asset_class'] === null) { + $invalidProperties[] = "'asset_class' can't be null"; + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!is_null($this->container['asset_class']) && !in_array($this->container['asset_class'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'asset_class', must be one of '%s'", + $this->container['asset_class'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['locale'] === null) { + $invalidProperties[] = "'locale' can't be null"; + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!is_null($this->container['locale']) && !in_array($this->container['locale'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'locale', must be one of '%s'", + $this->container['locale'], + implode("', '", $allowedValues) + ); + } + + 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 asset_class + * + * @return string + */ + public function getAssetClass() + { + return $this->container['asset_class']; + } + + /** + * Sets asset_class + * + * @param string $asset_class An identifier for a group of similar financial instruments. + * + * @return self + */ + public function setAssetClass($asset_class) + { + if (is_null($asset_class)) { + throw new \InvalidArgumentException('non-nullable asset_class cannot be null'); + } + $allowedValues = $this->getAssetClassAllowableValues(); + if (!in_array($asset_class, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'asset_class', must be one of '%s'", + $asset_class, + implode("', '", $allowedValues) + ) + ); + } + $this->container['asset_class'] = $asset_class; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code A code used by Polygon.io to refer to this ticker type. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description A short description of this ticker type. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets locale + * + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string $locale An identifier for a geographical location. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!in_array($locale, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'locale', must be one of '%s'", + $locale, + implode("', '", $allowedValues) + ) + ); + } + $this->container['locale'] = $locale; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickers200Response.php b/lib/Model/ListTickers200Response.php new file mode 100644 index 0000000..49fa53b --- /dev/null +++ b/lib/Model/ListTickers200Response.php @@ -0,0 +1,545 @@ + + */ +class ListTickers200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickers_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\ListTickers200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ListTickers200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ListTickers200ResponseResultsInner[]|null $results An array of tickers that match your query. Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ListTickers200ResponseResultsInner.php b/lib/Model/ListTickers200ResponseResultsInner.php new file mode 100644 index 0000000..8350983 --- /dev/null +++ b/lib/Model/ListTickers200ResponseResultsInner.php @@ -0,0 +1,903 @@ + + */ +class ListTickers200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTickers_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active' => 'bool', + 'cik' => 'string', + 'composite_figi' => 'string', + 'currency_name' => 'string', + 'delisted_utc' => '\DateTime', + 'last_updated_utc' => '\DateTime', + 'locale' => 'string', + 'market' => 'string', + 'name' => 'string', + 'primary_exchange' => 'string', + 'share_class_figi' => 'string', + 'ticker' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active' => null, + 'cik' => null, + 'composite_figi' => null, + 'currency_name' => null, + 'delisted_utc' => 'date-time', + 'last_updated_utc' => 'date-time', + 'locale' => null, + 'market' => null, + 'name' => null, + 'primary_exchange' => null, + 'share_class_figi' => null, + 'ticker' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'active' => false, + 'cik' => false, + 'composite_figi' => false, + 'currency_name' => false, + 'delisted_utc' => false, + 'last_updated_utc' => false, + 'locale' => false, + 'market' => false, + 'name' => false, + 'primary_exchange' => false, + 'share_class_figi' => false, + 'ticker' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'cik' => 'cik', + 'composite_figi' => 'composite_figi', + 'currency_name' => 'currency_name', + 'delisted_utc' => 'delisted_utc', + 'last_updated_utc' => 'last_updated_utc', + 'locale' => 'locale', + 'market' => 'market', + 'name' => 'name', + 'primary_exchange' => 'primary_exchange', + 'share_class_figi' => 'share_class_figi', + 'ticker' => 'ticker', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'cik' => 'setCik', + 'composite_figi' => 'setCompositeFigi', + 'currency_name' => 'setCurrencyName', + 'delisted_utc' => 'setDelistedUtc', + 'last_updated_utc' => 'setLastUpdatedUtc', + 'locale' => 'setLocale', + 'market' => 'setMarket', + 'name' => 'setName', + 'primary_exchange' => 'setPrimaryExchange', + 'share_class_figi' => 'setShareClassFigi', + 'ticker' => 'setTicker', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'cik' => 'getCik', + 'composite_figi' => 'getCompositeFigi', + 'currency_name' => 'getCurrencyName', + 'delisted_utc' => 'getDelistedUtc', + 'last_updated_utc' => 'getLastUpdatedUtc', + 'locale' => 'getLocale', + 'market' => 'getMarket', + 'name' => 'getName', + 'primary_exchange' => 'getPrimaryExchange', + 'share_class_figi' => 'getShareClassFigi', + 'ticker' => 'getTicker', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const LOCALE_US = 'us'; + public const LOCALE__GLOBAL = 'global'; + public const MARKET_STOCKS = 'stocks'; + public const MARKET_CRYPTO = 'crypto'; + public const MARKET_FX = 'fx'; + public const MARKET_OTC = 'otc'; + public const MARKET_INDICES = 'indices'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLocaleAllowableValues() + { + return [ + self::LOCALE_US, + self::LOCALE__GLOBAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMarketAllowableValues() + { + return [ + self::MARKET_STOCKS, + self::MARKET_CRYPTO, + self::MARKET_FX, + self::MARKET_OTC, + self::MARKET_INDICES, + ]; + } + + /** + * 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->setIfExists('active', $data ?? [], null); + $this->setIfExists('cik', $data ?? [], null); + $this->setIfExists('composite_figi', $data ?? [], null); + $this->setIfExists('currency_name', $data ?? [], null); + $this->setIfExists('delisted_utc', $data ?? [], null); + $this->setIfExists('last_updated_utc', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('primary_exchange', $data ?? [], null); + $this->setIfExists('share_class_figi', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['locale'] === null) { + $invalidProperties[] = "'locale' can't be null"; + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!is_null($this->container['locale']) && !in_array($this->container['locale'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'locale', must be one of '%s'", + $this->container['locale'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['market'] === null) { + $invalidProperties[] = "'market' can't be null"; + } + $allowedValues = $this->getMarketAllowableValues(); + if (!is_null($this->container['market']) && !in_array($this->container['market'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'market', must be one of '%s'", + $this->container['market'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether or not the asset is actively traded. False means the asset has been delisted. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets cik + * + * @return string|null + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string|null $cik The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key). + * + * @return self + */ + public function setCik($cik) + { + if (is_null($cik)) { + throw new \InvalidArgumentException('non-nullable cik cannot be null'); + } + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets composite_figi + * + * @return string|null + */ + public function getCompositeFigi() + { + return $this->container['composite_figi']; + } + + /** + * Sets composite_figi + * + * @param string|null $composite_figi The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) + * + * @return self + */ + public function setCompositeFigi($composite_figi) + { + if (is_null($composite_figi)) { + throw new \InvalidArgumentException('non-nullable composite_figi cannot be null'); + } + $this->container['composite_figi'] = $composite_figi; + + return $this; + } + + /** + * Gets currency_name + * + * @return string|null + */ + public function getCurrencyName() + { + return $this->container['currency_name']; + } + + /** + * Sets currency_name + * + * @param string|null $currency_name The name of the currency that this asset is traded with. + * + * @return self + */ + public function setCurrencyName($currency_name) + { + if (is_null($currency_name)) { + throw new \InvalidArgumentException('non-nullable currency_name cannot be null'); + } + $this->container['currency_name'] = $currency_name; + + return $this; + } + + /** + * Gets delisted_utc + * + * @return \DateTime|null + */ + public function getDelistedUtc() + { + return $this->container['delisted_utc']; + } + + /** + * Sets delisted_utc + * + * @param \DateTime|null $delisted_utc The last date that the asset was traded. + * + * @return self + */ + public function setDelistedUtc($delisted_utc) + { + if (is_null($delisted_utc)) { + throw new \InvalidArgumentException('non-nullable delisted_utc cannot be null'); + } + $this->container['delisted_utc'] = $delisted_utc; + + return $this; + } + + /** + * Gets last_updated_utc + * + * @return \DateTime|null + */ + public function getLastUpdatedUtc() + { + return $this->container['last_updated_utc']; + } + + /** + * Sets last_updated_utc + * + * @param \DateTime|null $last_updated_utc The information is accurate up to this time. + * + * @return self + */ + public function setLastUpdatedUtc($last_updated_utc) + { + if (is_null($last_updated_utc)) { + throw new \InvalidArgumentException('non-nullable last_updated_utc cannot be null'); + } + $this->container['last_updated_utc'] = $last_updated_utc; + + return $this; + } + + /** + * Gets locale + * + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string $locale The locale of the asset. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $allowedValues = $this->getLocaleAllowableValues(); + if (!in_array($locale, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'locale', must be one of '%s'", + $locale, + implode("', '", $allowedValues) + ) + ); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets market + * + * @return string + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string $market The market type of the asset. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $allowedValues = $this->getMarketAllowableValues(); + if (!in_array($market, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'market', must be one of '%s'", + $market, + implode("', '", $allowedValues) + ) + ); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets primary_exchange + * + * @return string|null + */ + public function getPrimaryExchange() + { + return $this->container['primary_exchange']; + } + + /** + * Sets primary_exchange + * + * @param string|null $primary_exchange The ISO code of the primary listing exchange for this asset. + * + * @return self + */ + public function setPrimaryExchange($primary_exchange) + { + if (is_null($primary_exchange)) { + throw new \InvalidArgumentException('non-nullable primary_exchange cannot be null'); + } + $this->container['primary_exchange'] = $primary_exchange; + + 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 The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi) + * + * @return self + */ + public function setShareClassFigi($share_class_figi) + { + if (is_null($share_class_figi)) { + throw new \InvalidArgumentException('non-nullable share_class_figi cannot be null'); + } + $this->container['share_class_figi'] = $share_class_figi; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the asset. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Locales.php b/lib/Model/Locales.php new file mode 100644 index 0000000..bc7fa56 --- /dev/null +++ b/lib/Model/Locales.php @@ -0,0 +1,409 @@ + + */ +class Locales implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Locales'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\LocalesResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\LocalesResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\LocalesResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/LocalesResultsInner.php b/lib/Model/LocalesResultsInner.php new file mode 100644 index 0000000..83ba28e --- /dev/null +++ b/lib/Model/LocalesResultsInner.php @@ -0,0 +1,443 @@ + + */ +class LocalesResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Locales_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'locale' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'locale' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'locale' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'locale' => 'locale', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'locale' => 'setLocale', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'locale' => 'getLocale', + 'name' => 'getName' + ]; + + /** + * 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->setIfExists('locale', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale An abbreviated country name. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the country. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Map.php b/lib/Model/Map.php new file mode 100644 index 0000000..41949f2 --- /dev/null +++ b/lib/Model/Map.php @@ -0,0 +1,410 @@ + + */ +class Map implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Map'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => '\OpenAPI\Client\Model\MapKey' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey' + ]; + + /** + * 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->setIfExists('key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 key + * + * @return \OpenAPI\Client\Model\MapKey|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param \OpenAPI\Client\Model\MapKey|null $key key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/MapKey.php b/lib/Model/MapKey.php new file mode 100644 index 0000000..c153d4c --- /dev/null +++ b/lib/Model/MapKey.php @@ -0,0 +1,482 @@ + + */ +class MapKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Map_key'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const TYPE_STRING = 'string'; + public const TYPE_INT = 'int'; + public const TYPE_INT64 = 'int64'; + public const TYPE_FLOAT64 = 'float64'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STRING, + self::TYPE_INT, + self::TYPE_INT64, + self::TYPE_FLOAT64, + ]; + } + + /** + * 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->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The descriptive name of this results key + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The data type of this results key + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/MarketHolidayInner.php b/lib/Model/MarketHolidayInner.php new file mode 100644 index 0000000..313410c --- /dev/null +++ b/lib/Model/MarketHolidayInner.php @@ -0,0 +1,579 @@ + + */ +class MarketHolidayInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketHoliday_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'close' => '\DateTime', + 'date' => '\DateTime', + 'exchange' => 'string', + 'name' => 'string', + 'open' => '\DateTime', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'close' => 'date-time', + 'date' => 'date', + 'exchange' => null, + 'name' => null, + 'open' => 'date-time', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'close' => false, + 'date' => false, + 'exchange' => false, + 'name' => false, + 'open' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'close' => 'close', + 'date' => 'date', + 'exchange' => 'exchange', + 'name' => 'name', + 'open' => 'open', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'close' => 'setClose', + 'date' => 'setDate', + 'exchange' => 'setExchange', + 'name' => 'setName', + 'open' => 'setOpen', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'close' => 'getClose', + 'date' => 'getDate', + 'exchange' => 'getExchange', + 'name' => 'getName', + 'open' => 'getOpen', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('close', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 close + * + * @return \DateTime|null + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param \DateTime|null $close The market close time on the holiday (if it's not closed). + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date The date of the holiday. + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange Which market the record is for. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the holiday. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets open + * + * @return \DateTime|null + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param \DateTime|null $open The market open time on the holiday (if it's not closed). + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the market on the holiday. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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..0c8f7b6 --- /dev/null +++ b/lib/Model/MarketStatus.php @@ -0,0 +1,579 @@ + + */ +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 = [ + 'after_hours' => 'bool', + 'currencies' => '\OpenAPI\Client\Model\MarketStatusCurrencies', + 'early_hours' => 'bool', + 'exchanges' => '\OpenAPI\Client\Model\MarketStatusExchanges', + 'market' => 'string', + 'server_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => null, + 'currencies' => null, + 'early_hours' => null, + 'exchanges' => null, + 'market' => null, + 'server_time' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'currencies' => false, + 'early_hours' => false, + 'exchanges' => false, + 'market' => false, + 'server_time' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'currencies' => 'currencies', + 'early_hours' => 'earlyHours', + 'exchanges' => 'exchanges', + 'market' => 'market', + 'server_time' => 'serverTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'currencies' => 'setCurrencies', + 'early_hours' => 'setEarlyHours', + 'exchanges' => 'setExchanges', + 'market' => 'setMarket', + 'server_time' => 'setServerTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'currencies' => 'getCurrencies', + 'early_hours' => 'getEarlyHours', + 'exchanges' => 'getExchanges', + 'market' => 'getMarket', + 'server_time' => 'getServerTime' + ]; + + /** + * 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->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('early_hours', $data ?? [], null); + $this->setIfExists('exchanges', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + $this->setIfExists('server_time', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 after_hours + * + * @return bool|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param bool|null $after_hours Whether or not the market is in post-market hours. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets currencies + * + * @return \OpenAPI\Client\Model\MarketStatusCurrencies|null + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param \OpenAPI\Client\Model\MarketStatusCurrencies|null $currencies currencies + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets early_hours + * + * @return bool|null + */ + public function getEarlyHours() + { + return $this->container['early_hours']; + } + + /** + * Sets early_hours + * + * @param bool|null $early_hours Whether or not the market is in pre-market hours. + * + * @return self + */ + public function setEarlyHours($early_hours) + { + if (is_null($early_hours)) { + throw new \InvalidArgumentException('non-nullable early_hours cannot be null'); + } + $this->container['early_hours'] = $early_hours; + + return $this; + } + + /** + * Gets exchanges + * + * @return \OpenAPI\Client\Model\MarketStatusExchanges|null + */ + public function getExchanges() + { + return $this->container['exchanges']; + } + + /** + * Sets exchanges + * + * @param \OpenAPI\Client\Model\MarketStatusExchanges|null $exchanges exchanges + * + * @return self + */ + public function setExchanges($exchanges) + { + if (is_null($exchanges)) { + throw new \InvalidArgumentException('non-nullable exchanges cannot be null'); + } + $this->container['exchanges'] = $exchanges; + + return $this; + } + + /** + * Gets market + * + * @return string|null + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string|null $market The status of the market as a whole. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $this->container['market'] = $market; + + return $this; + } + + /** + * Gets server_time + * + * @return \DateTime|null + */ + public function getServerTime() + { + return $this->container['server_time']; + } + + /** + * Sets server_time + * + * @param \DateTime|null $server_time The current time of the server. + * + * @return self + */ + public function setServerTime($server_time) + { + if (is_null($server_time)) { + throw new \InvalidArgumentException('non-nullable server_time cannot be null'); + } + $this->container['server_time'] = $server_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/MarketStatusCurrencies.php b/lib/Model/MarketStatusCurrencies.php new file mode 100644 index 0000000..868d006 --- /dev/null +++ b/lib/Model/MarketStatusCurrencies.php @@ -0,0 +1,443 @@ + + */ +class MarketStatusCurrencies implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketStatus_currencies'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'crypto' => 'string', + 'fx' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'crypto' => null, + 'fx' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'crypto' => false, + 'fx' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'crypto' => 'crypto', + 'fx' => 'fx' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'crypto' => 'setCrypto', + 'fx' => 'setFx' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'crypto' => 'getCrypto', + 'fx' => 'getFx' + ]; + + /** + * 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->setIfExists('crypto', $data ?? [], null); + $this->setIfExists('fx', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 crypto + * + * @return string|null + */ + public function getCrypto() + { + return $this->container['crypto']; + } + + /** + * Sets crypto + * + * @param string|null $crypto The status of the crypto market. + * + * @return self + */ + public function setCrypto($crypto) + { + if (is_null($crypto)) { + throw new \InvalidArgumentException('non-nullable crypto cannot be null'); + } + $this->container['crypto'] = $crypto; + + return $this; + } + + /** + * Gets fx + * + * @return string|null + */ + public function getFx() + { + return $this->container['fx']; + } + + /** + * Sets fx + * + * @param string|null $fx The status of the forex market. + * + * @return self + */ + public function setFx($fx) + { + if (is_null($fx)) { + throw new \InvalidArgumentException('non-nullable fx cannot be null'); + } + $this->container['fx'] = $fx; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/MarketStatusExchanges.php b/lib/Model/MarketStatusExchanges.php new file mode 100644 index 0000000..8bbc739 --- /dev/null +++ b/lib/Model/MarketStatusExchanges.php @@ -0,0 +1,477 @@ + + */ +class MarketStatusExchanges implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketStatus_exchanges'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nasdaq' => 'string', + 'nyse' => 'string', + 'otc' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nasdaq' => null, + 'nyse' => null, + 'otc' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nasdaq' => false, + 'nyse' => false, + 'otc' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'nasdaq' => 'nasdaq', + 'nyse' => 'nyse', + 'otc' => 'otc' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nasdaq' => 'setNasdaq', + 'nyse' => 'setNyse', + 'otc' => 'setOtc' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nasdaq' => 'getNasdaq', + 'nyse' => 'getNyse', + 'otc' => 'getOtc' + ]; + + /** + * 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->setIfExists('nasdaq', $data ?? [], null); + $this->setIfExists('nyse', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 nasdaq + * + * @return string|null + */ + public function getNasdaq() + { + return $this->container['nasdaq']; + } + + /** + * Sets nasdaq + * + * @param string|null $nasdaq The status of the Nasdaq market. + * + * @return self + */ + public function setNasdaq($nasdaq) + { + if (is_null($nasdaq)) { + throw new \InvalidArgumentException('non-nullable nasdaq cannot be null'); + } + $this->container['nasdaq'] = $nasdaq; + + return $this; + } + + /** + * Gets nyse + * + * @return string|null + */ + public function getNyse() + { + return $this->container['nyse']; + } + + /** + * Sets nyse + * + * @param string|null $nyse The status of the NYSE market. + * + * @return self + */ + public function setNyse($nyse) + { + if (is_null($nyse)) { + throw new \InvalidArgumentException('non-nullable nyse cannot be null'); + } + $this->container['nyse'] = $nyse; + + return $this; + } + + /** + * Gets otc + * + * @return string|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param string|null $otc The status of the OTC market. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Markets.php b/lib/Model/Markets.php new file mode 100644 index 0000000..4726de3 --- /dev/null +++ b/lib/Model/Markets.php @@ -0,0 +1,409 @@ + + */ +class Markets implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Markets'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\MarketsResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\MarketsResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\MarketsResultsInner[]|null $results A list of supported markets. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/MarketsResultsInner.php b/lib/Model/MarketsResultsInner.php new file mode 100644 index 0000000..bb3ec86 --- /dev/null +++ b/lib/Model/MarketsResultsInner.php @@ -0,0 +1,443 @@ + + */ +class MarketsResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Markets_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'desc' => 'string', + 'market' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'desc' => null, + 'market' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'desc' => false, + 'market' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'desc' => 'desc', + 'market' => 'market' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'desc' => 'setDesc', + 'market' => 'setMarket' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'desc' => 'getDesc', + 'market' => 'getMarket' + ]; + + /** + * 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->setIfExists('desc', $data ?? [], null); + $this->setIfExists('market', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 desc + * + * @return string|null + */ + public function getDesc() + { + return $this->container['desc']; + } + + /** + * Sets desc + * + * @param string|null $desc A description of the market. + * + * @return self + */ + public function setDesc($desc) + { + if (is_null($desc)) { + throw new \InvalidArgumentException('non-nullable desc cannot be null'); + } + $this->container['desc'] = $desc; + + return $this; + } + + /** + * Gets market + * + * @return string|null + */ + public function getMarket() + { + return $this->container['market']; + } + + /** + * Sets market + * + * @param string|null $market The name of the market. + * + * @return self + */ + public function setMarket($market) + { + if (is_null($market)) { + throw new \InvalidArgumentException('non-nullable market cannot be null'); + } + $this->container['market'] = $market; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..a468c71 --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,111 @@ + + */ +class NewsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'News_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'image' => 'string', + 'keywords' => 'string[]', + 'source' => 'string', + 'summary' => 'string', + 'symbols' => 'string[]', + 'timestamp' => '\DateTime', + 'title' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'image' => null, + 'keywords' => null, + 'source' => null, + 'summary' => null, + 'symbols' => null, + 'timestamp' => 'date-time', + 'title' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'image' => false, + 'keywords' => false, + 'source' => false, + 'summary' => false, + 'symbols' => false, + 'timestamp' => false, + 'title' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'image' => 'image', + 'keywords' => 'keywords', + 'source' => 'source', + 'summary' => 'summary', + 'symbols' => 'symbols', + 'timestamp' => 'timestamp', + 'title' => 'title', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'image' => 'setImage', + 'keywords' => 'setKeywords', + 'source' => 'setSource', + 'summary' => 'setSummary', + 'symbols' => 'setSymbols', + 'timestamp' => 'setTimestamp', + 'title' => 'setTitle', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'image' => 'getImage', + 'keywords' => 'getKeywords', + 'source' => 'getSource', + 'summary' => 'getSummary', + 'symbols' => 'getSymbols', + 'timestamp' => 'getTimestamp', + 'title' => 'getTitle', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('image', $data ?? [], null); + $this->setIfExists('keywords', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('summary', $data ?? [], null); + $this->setIfExists('symbols', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 image + * + * @return string|null + */ + public function getImage() + { + return $this->container['image']; + } + + /** + * Sets image + * + * @param string|null $image A URL of the image for the news article, if found. + * + * @return self + */ + public function setImage($image) + { + if (is_null($image)) { + throw new \InvalidArgumentException('non-nullable image cannot be null'); + } + $this->container['image'] = $image; + + return $this; + } + + /** + * Gets keywords + * + * @return string[]|null + */ + public function getKeywords() + { + return $this->container['keywords']; + } + + /** + * Sets keywords + * + * @param string[]|null $keywords A list of common keywords related to the news article. + * + * @return self + */ + public function setKeywords($keywords) + { + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + } + $this->container['keywords'] = $keywords; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source The publication source of the article. + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets summary + * + * @return string|null + */ + public function getSummary() + { + return $this->container['summary']; + } + + /** + * Sets summary + * + * @param string|null $summary A summary of the news article. + * + * @return self + */ + public function setSummary($summary) + { + if (is_null($summary)) { + throw new \InvalidArgumentException('non-nullable summary cannot be null'); + } + $this->container['summary'] = $summary; + + return $this; + } + + /** + * Gets symbols + * + * @return string[]|null + */ + public function getSymbols() + { + return $this->container['symbols']; + } + + /** + * Sets symbols + * + * @param string[]|null $symbols A list of ticker symbols relating to the article. + * + * @return self + */ + public function setSymbols($symbols) + { + if (is_null($symbols)) { + throw new \InvalidArgumentException('non-nullable symbols cannot be null'); + } + $this->container['symbols'] = $symbols; + + return $this; + } + + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp The timestamp of the news article. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the news article. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url A direct link to the news article from its source publication. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionContract200Response.php b/lib/Model/OptionContract200Response.php new file mode 100644 index 0000000..377e7c4 --- /dev/null +++ b/lib/Model/OptionContract200Response.php @@ -0,0 +1,517 @@ + + */ +class OptionContract200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionContract_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInner', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInner|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInner|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200Response.php b/lib/Model/OptionsChain200Response.php new file mode 100644 index 0000000..c11b9a4 --- /dev/null +++ b/lib/Model/OptionsChain200Response.php @@ -0,0 +1,517 @@ + + */ +class OptionsChain200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200ResponseResultsInner.php b/lib/Model/OptionsChain200ResponseResultsInner.php new file mode 100644 index 0000000..2faeb0a --- /dev/null +++ b/lib/Model/OptionsChain200ResponseResultsInner.php @@ -0,0 +1,733 @@ + + */ +class OptionsChain200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'break_even_price' => 'float', + 'day' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDay', + 'details' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDetails', + 'fmv' => 'float', + 'greeks' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks', + 'implied_volatility' => 'float', + 'last_quote' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastQuote', + 'last_trade' => '\OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastTrade', + 'open_interest' => 'float', + 'underlying_asset' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'break_even_price' => 'double', + 'day' => null, + 'details' => null, + 'fmv' => null, + 'greeks' => null, + 'implied_volatility' => 'double', + 'last_quote' => null, + 'last_trade' => null, + 'open_interest' => 'double', + 'underlying_asset' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'break_even_price' => false, + 'day' => false, + 'details' => false, + 'fmv' => false, + 'greeks' => false, + 'implied_volatility' => false, + 'last_quote' => false, + 'last_trade' => false, + 'open_interest' => false, + 'underlying_asset' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'break_even_price' => 'break_even_price', + 'day' => 'day', + 'details' => 'details', + 'fmv' => 'fmv', + 'greeks' => 'greeks', + 'implied_volatility' => 'implied_volatility', + 'last_quote' => 'last_quote', + 'last_trade' => 'last_trade', + 'open_interest' => 'open_interest', + 'underlying_asset' => 'underlying_asset' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'break_even_price' => 'setBreakEvenPrice', + 'day' => 'setDay', + 'details' => 'setDetails', + 'fmv' => 'setFmv', + 'greeks' => 'setGreeks', + 'implied_volatility' => 'setImpliedVolatility', + 'last_quote' => 'setLastQuote', + 'last_trade' => 'setLastTrade', + 'open_interest' => 'setOpenInterest', + 'underlying_asset' => 'setUnderlyingAsset' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'break_even_price' => 'getBreakEvenPrice', + 'day' => 'getDay', + 'details' => 'getDetails', + 'fmv' => 'getFmv', + 'greeks' => 'getGreeks', + 'implied_volatility' => 'getImpliedVolatility', + 'last_quote' => 'getLastQuote', + 'last_trade' => 'getLastTrade', + 'open_interest' => 'getOpenInterest', + 'underlying_asset' => 'getUnderlyingAsset' + ]; + + /** + * 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->setIfExists('break_even_price', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('details', $data ?? [], null); + $this->setIfExists('fmv', $data ?? [], null); + $this->setIfExists('greeks', $data ?? [], null); + $this->setIfExists('implied_volatility', $data ?? [], null); + $this->setIfExists('last_quote', $data ?? [], null); + $this->setIfExists('last_trade', $data ?? [], null); + $this->setIfExists('open_interest', $data ?? [], null); + $this->setIfExists('underlying_asset', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['break_even_price'] === null) { + $invalidProperties[] = "'break_even_price' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['details'] === null) { + $invalidProperties[] = "'details' can't be null"; + } + if ($this->container['last_quote'] === null) { + $invalidProperties[] = "'last_quote' can't be null"; + } + if ($this->container['open_interest'] === null) { + $invalidProperties[] = "'open_interest' can't be null"; + } + if ($this->container['underlying_asset'] === null) { + $invalidProperties[] = "'underlying_asset' can't be null"; + } + 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 break_even_price + * + * @return float + */ + public function getBreakEvenPrice() + { + return $this->container['break_even_price']; + } + + /** + * Sets break_even_price + * + * @param float $break_even_price The price of the underlying asset for the contract to break even. For a call, this value is (strike price + premium paid). For a put, this value is (strike price - premium paid). + * + * @return self + */ + public function setBreakEvenPrice($break_even_price) + { + if (is_null($break_even_price)) { + throw new \InvalidArgumentException('non-nullable break_even_price cannot be null'); + } + $this->container['break_even_price'] = $break_even_price; + + return $this; + } + + /** + * Gets day + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDay + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDay $day day + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets details + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDetails + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerDetails $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets fmv + * + * @return float|null + */ + public function getFmv() + { + return $this->container['fmv']; + } + + /** + * Sets fmv + * + * @param float|null $fmv Fair market value is only available on Business plans. It's it our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us. + * + * @return self + */ + public function setFmv($fmv) + { + if (is_null($fmv)) { + throw new \InvalidArgumentException('non-nullable fmv cannot be null'); + } + $this->container['fmv'] = $fmv; + + return $this; + } + + /** + * Gets greeks + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks|null + */ + public function getGreeks() + { + return $this->container['greeks']; + } + + /** + * Sets greeks + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks|null $greeks greeks + * + * @return self + */ + public function setGreeks($greeks) + { + if (is_null($greeks)) { + throw new \InvalidArgumentException('non-nullable greeks cannot be null'); + } + $this->container['greeks'] = $greeks; + + return $this; + } + + /** + * Gets implied_volatility + * + * @return float|null + */ + public function getImpliedVolatility() + { + return $this->container['implied_volatility']; + } + + /** + * Sets implied_volatility + * + * @param float|null $implied_volatility The market's forecast for the volatility of the underlying asset, based on this option's current price. + * + * @return self + */ + public function setImpliedVolatility($implied_volatility) + { + if (is_null($implied_volatility)) { + throw new \InvalidArgumentException('non-nullable implied_volatility cannot be null'); + } + $this->container['implied_volatility'] = $implied_volatility; + + return $this; + } + + /** + * Gets last_quote + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastQuote + */ + public function getLastQuote() + { + return $this->container['last_quote']; + } + + /** + * Sets last_quote + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastQuote $last_quote last_quote + * + * @return self + */ + public function setLastQuote($last_quote) + { + if (is_null($last_quote)) { + throw new \InvalidArgumentException('non-nullable last_quote cannot be null'); + } + $this->container['last_quote'] = $last_quote; + + return $this; + } + + /** + * Gets last_trade + * + * @return \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastTrade|null + */ + public function getLastTrade() + { + return $this->container['last_trade']; + } + + /** + * Sets last_trade + * + * @param \OpenAPI\Client\Model\OptionsChain200ResponseResultsInnerLastTrade|null $last_trade last_trade + * + * @return self + */ + public function setLastTrade($last_trade) + { + if (is_null($last_trade)) { + throw new \InvalidArgumentException('non-nullable last_trade cannot be null'); + } + $this->container['last_trade'] = $last_trade; + + return $this; + } + + /** + * Gets open_interest + * + * @return float + */ + public function getOpenInterest() + { + return $this->container['open_interest']; + } + + /** + * Sets open_interest + * + * @param float $open_interest The quantity of this contract held at the end of the last trading day. + * + * @return self + */ + public function setOpenInterest($open_interest) + { + if (is_null($open_interest)) { + throw new \InvalidArgumentException('non-nullable open_interest cannot be null'); + } + $this->container['open_interest'] = $open_interest; + + return $this; + } + + /** + * Gets underlying_asset + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset + */ + public function getUnderlyingAsset() + { + return $this->container['underlying_asset']; + } + + /** + * Sets underlying_asset + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset $underlying_asset underlying_asset + * + * @return self + */ + public function setUnderlyingAsset($underlying_asset) + { + if (is_null($underlying_asset)) { + throw new \InvalidArgumentException('non-nullable underlying_asset cannot be null'); + } + $this->container['underlying_asset'] = $underlying_asset; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200ResponseResultsInnerDay.php b/lib/Model/OptionsChain200ResponseResultsInnerDay.php new file mode 100644 index 0000000..4be6d10 --- /dev/null +++ b/lib/Model/OptionsChain200ResponseResultsInnerDay.php @@ -0,0 +1,746 @@ + + */ +class OptionsChain200ResponseResultsInnerDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response_results_inner_day'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'change' => 'float', + 'change_percent' => 'float', + 'close' => 'float', + 'high' => 'float', + 'last_updated' => 'int', + 'low' => 'float', + 'open' => 'float', + 'previous_close' => 'float', + 'volume' => 'float', + 'vwap' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'change' => 'double', + 'change_percent' => 'double', + 'close' => 'double', + 'high' => 'double', + 'last_updated' => 'int64', + 'low' => 'double', + 'open' => 'double', + 'previous_close' => 'double', + 'volume' => 'double', + 'vwap' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'change' => false, + 'change_percent' => false, + 'close' => false, + 'high' => false, + 'last_updated' => false, + 'low' => false, + 'open' => false, + 'previous_close' => false, + 'volume' => false, + 'vwap' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'change' => 'change', + 'change_percent' => 'change_percent', + 'close' => 'close', + 'high' => 'high', + 'last_updated' => 'last_updated', + 'low' => 'low', + 'open' => 'open', + 'previous_close' => 'previous_close', + 'volume' => 'volume', + 'vwap' => 'vwap' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'change' => 'setChange', + 'change_percent' => 'setChangePercent', + 'close' => 'setClose', + 'high' => 'setHigh', + 'last_updated' => 'setLastUpdated', + 'low' => 'setLow', + 'open' => 'setOpen', + 'previous_close' => 'setPreviousClose', + 'volume' => 'setVolume', + 'vwap' => 'setVwap' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'change' => 'getChange', + 'change_percent' => 'getChangePercent', + 'close' => 'getClose', + 'high' => 'getHigh', + 'last_updated' => 'getLastUpdated', + 'low' => 'getLow', + 'open' => 'getOpen', + 'previous_close' => 'getPreviousClose', + 'volume' => 'getVolume', + 'vwap' => 'getVwap' + ]; + + /** + * 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->setIfExists('change', $data ?? [], null); + $this->setIfExists('change_percent', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('previous_close', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + $this->setIfExists('vwap', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['change'] === null) { + $invalidProperties[] = "'change' can't be null"; + } + if ($this->container['change_percent'] === null) { + $invalidProperties[] = "'change_percent' can't be null"; + } + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['previous_close'] === null) { + $invalidProperties[] = "'previous_close' can't be null"; + } + if ($this->container['volume'] === null) { + $invalidProperties[] = "'volume' can't be null"; + } + if ($this->container['vwap'] === null) { + $invalidProperties[] = "'vwap' can't be null"; + } + 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 change + * + * @return float + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param float $change The value of the price change for the contract from the previous trading day. + * + * @return self + */ + public function setChange($change) + { + if (is_null($change)) { + throw new \InvalidArgumentException('non-nullable change cannot be null'); + } + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets change_percent + * + * @return float + */ + public function getChangePercent() + { + return $this->container['change_percent']; + } + + /** + * Sets change_percent + * + * @param float $change_percent The percent of the price change for the contract from the previous trading day. + * + * @return self + */ + public function setChangePercent($change_percent) + { + if (is_null($change_percent)) { + throw new \InvalidArgumentException('non-nullable change_percent cannot be null'); + } + $this->container['change_percent'] = $change_percent; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The closing price for the contract of the day. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest price for the contract of the day. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest price for the contract of the day. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price for the contract of the day. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets previous_close + * + * @return float + */ + public function getPreviousClose() + { + return $this->container['previous_close']; + } + + /** + * Sets previous_close + * + * @param float $previous_close The closing price for the contract of previous trading day. + * + * @return self + */ + public function setPreviousClose($previous_close) + { + if (is_null($previous_close)) { + throw new \InvalidArgumentException('non-nullable previous_close cannot be null'); + } + $this->container['previous_close'] = $previous_close; + + return $this; + } + + /** + * Gets volume + * + * @return float + */ + public function getVolume() + { + return $this->container['volume']; + } + + /** + * Sets volume + * + * @param float $volume The trading volume for the contract of the day. + * + * @return self + */ + public function setVolume($volume) + { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } + $this->container['volume'] = $volume; + + return $this; + } + + /** + * Gets vwap + * + * @return float + */ + public function getVwap() + { + return $this->container['vwap']; + } + + /** + * Sets vwap + * + * @param float $vwap The trading volume weighted average price for the contract of the day. + * + * @return self + */ + public function setVwap($vwap) + { + if (is_null($vwap)) { + throw new \InvalidArgumentException('non-nullable vwap cannot be null'); + } + $this->container['vwap'] = $vwap; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200ResponseResultsInnerDetails.php b/lib/Model/OptionsChain200ResponseResultsInnerDetails.php new file mode 100644 index 0000000..6b6e84f --- /dev/null +++ b/lib/Model/OptionsChain200ResponseResultsInnerDetails.php @@ -0,0 +1,670 @@ + + */ +class OptionsChain200ResponseResultsInnerDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response_results_inner_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract_type' => 'string', + 'exercise_style' => 'string', + 'expiration_date' => '\DateTime', + 'shares_per_contract' => 'float', + 'strike_price' => 'float', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract_type' => null, + 'exercise_style' => null, + 'expiration_date' => 'date', + 'shares_per_contract' => null, + 'strike_price' => 'double', + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contract_type' => false, + 'exercise_style' => false, + 'expiration_date' => false, + 'shares_per_contract' => false, + 'strike_price' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_type' => 'contract_type', + 'exercise_style' => 'exercise_style', + 'expiration_date' => 'expiration_date', + 'shares_per_contract' => 'shares_per_contract', + 'strike_price' => 'strike_price', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_type' => 'setContractType', + 'exercise_style' => 'setExerciseStyle', + 'expiration_date' => 'setExpirationDate', + 'shares_per_contract' => 'setSharesPerContract', + 'strike_price' => 'setStrikePrice', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_type' => 'getContractType', + 'exercise_style' => 'getExerciseStyle', + 'expiration_date' => 'getExpirationDate', + 'shares_per_contract' => 'getSharesPerContract', + 'strike_price' => 'getStrikePrice', + 'ticker' => 'getTicker' + ]; + + /** + * 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; + } + + public const CONTRACT_TYPE_PUT = 'put'; + public const CONTRACT_TYPE_CALL = 'call'; + public const CONTRACT_TYPE_OTHER = 'other'; + public const EXERCISE_STYLE_AMERICAN = 'american'; + public const EXERCISE_STYLE_EUROPEAN = 'european'; + public const EXERCISE_STYLE_BERMUDAN = 'bermudan'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractTypeAllowableValues() + { + return [ + self::CONTRACT_TYPE_PUT, + self::CONTRACT_TYPE_CALL, + self::CONTRACT_TYPE_OTHER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExerciseStyleAllowableValues() + { + return [ + self::EXERCISE_STYLE_AMERICAN, + self::EXERCISE_STYLE_EUROPEAN, + self::EXERCISE_STYLE_BERMUDAN, + ]; + } + + /** + * 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->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('exercise_style', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('shares_per_contract', $data ?? [], null); + $this->setIfExists('strike_price', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contract_type'] === null) { + $invalidProperties[] = "'contract_type' can't be null"; + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!is_null($this->container['contract_type']) && !in_array($this->container['contract_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contract_type', must be one of '%s'", + $this->container['contract_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['exercise_style'] === null) { + $invalidProperties[] = "'exercise_style' can't be null"; + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!is_null($this->container['exercise_style']) && !in_array($this->container['exercise_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exercise_style', must be one of '%s'", + $this->container['exercise_style'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['expiration_date'] === null) { + $invalidProperties[] = "'expiration_date' can't be null"; + } + if ($this->container['shares_per_contract'] === null) { + $invalidProperties[] = "'shares_per_contract' can't be null"; + } + if ($this->container['strike_price'] === null) { + $invalidProperties[] = "'strike_price' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 contract_type + * + * @return string + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string $contract_type The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + throw new \InvalidArgumentException('non-nullable contract_type cannot be null'); + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!in_array($contract_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contract_type', must be one of '%s'", + $contract_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets exercise_style + * + * @return string + */ + public function getExerciseStyle() + { + return $this->container['exercise_style']; + } + + /** + * Sets exercise_style + * + * @param string $exercise_style The exercise style of this contract. See this link for more details on exercise styles. + * + * @return self + */ + public function setExerciseStyle($exercise_style) + { + if (is_null($exercise_style)) { + throw new \InvalidArgumentException('non-nullable exercise_style cannot be null'); + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!in_array($exercise_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exercise_style', must be one of '%s'", + $exercise_style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exercise_style'] = $exercise_style; + + return $this; + } + + /** + * Gets expiration_date + * + * @return \DateTime + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime $expiration_date The contract's expiration date in YYYY-MM-DD format. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets shares_per_contract + * + * @return float + */ + public function getSharesPerContract() + { + return $this->container['shares_per_contract']; + } + + /** + * Sets shares_per_contract + * + * @param float $shares_per_contract The number of shares per contract for this contract. + * + * @return self + */ + public function setSharesPerContract($shares_per_contract) + { + if (is_null($shares_per_contract)) { + throw new \InvalidArgumentException('non-nullable shares_per_contract cannot be null'); + } + $this->container['shares_per_contract'] = $shares_per_contract; + + return $this; + } + + /** + * Gets strike_price + * + * @return float + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param float $strike_price The strike price of the option contract. + * + * @return self + */ + public function setStrikePrice($strike_price) + { + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + } + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The ticker symbol for the asset. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200ResponseResultsInnerLastQuote.php b/lib/Model/OptionsChain200ResponseResultsInnerLastQuote.php new file mode 100644 index 0000000..099db18 --- /dev/null +++ b/lib/Model/OptionsChain200ResponseResultsInnerLastQuote.php @@ -0,0 +1,737 @@ + + */ +class OptionsChain200ResponseResultsInnerLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response_results_inner_last_quote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask' => 'float', + 'ask_exchange' => 'float', + 'ask_size' => 'float', + 'bid' => 'float', + 'bid_exchange' => 'float', + 'bid_size' => 'float', + 'last_updated' => 'int', + 'midpoint' => 'float', + 'timeframe' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask' => 'double', + 'ask_exchange' => 'int32', + 'ask_size' => 'double', + 'bid' => 'double', + 'bid_exchange' => 'int32', + 'bid_size' => 'double', + 'last_updated' => 'int64', + 'midpoint' => 'double', + 'timeframe' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask' => false, + 'ask_exchange' => false, + 'ask_size' => false, + 'bid' => false, + 'bid_exchange' => false, + 'bid_size' => false, + 'last_updated' => false, + 'midpoint' => false, + 'timeframe' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask' => 'ask', + 'ask_exchange' => 'ask_exchange', + 'ask_size' => 'ask_size', + 'bid' => 'bid', + 'bid_exchange' => 'bid_exchange', + 'bid_size' => 'bid_size', + 'last_updated' => 'last_updated', + 'midpoint' => 'midpoint', + 'timeframe' => 'timeframe' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask' => 'setAsk', + 'ask_exchange' => 'setAskExchange', + 'ask_size' => 'setAskSize', + 'bid' => 'setBid', + 'bid_exchange' => 'setBidExchange', + 'bid_size' => 'setBidSize', + 'last_updated' => 'setLastUpdated', + 'midpoint' => 'setMidpoint', + 'timeframe' => 'setTimeframe' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask' => 'getAsk', + 'ask_exchange' => 'getAskExchange', + 'ask_size' => 'getAskSize', + 'bid' => 'getBid', + 'bid_exchange' => 'getBidExchange', + 'bid_size' => 'getBidSize', + 'last_updated' => 'getLastUpdated', + 'midpoint' => 'getMidpoint', + 'timeframe' => 'getTimeframe' + ]; + + /** + * 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; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * 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->setIfExists('ask', $data ?? [], null); + $this->setIfExists('ask_exchange', $data ?? [], null); + $this->setIfExists('ask_size', $data ?? [], null); + $this->setIfExists('bid', $data ?? [], null); + $this->setIfExists('bid_exchange', $data ?? [], null); + $this->setIfExists('bid_size', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('midpoint', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ask'] === null) { + $invalidProperties[] = "'ask' can't be null"; + } + if ($this->container['ask_size'] === null) { + $invalidProperties[] = "'ask_size' can't be null"; + } + if ($this->container['bid'] === null) { + $invalidProperties[] = "'bid' can't be null"; + } + if ($this->container['bid_size'] === null) { + $invalidProperties[] = "'bid_size' can't be null"; + } + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['midpoint'] === null) { + $invalidProperties[] = "'midpoint' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + 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 ask + * + * @return float + */ + public function getAsk() + { + return $this->container['ask']; + } + + /** + * Sets ask + * + * @param float $ask The ask price. + * + * @return self + */ + public function setAsk($ask) + { + if (is_null($ask)) { + throw new \InvalidArgumentException('non-nullable ask cannot be null'); + } + $this->container['ask'] = $ask; + + return $this; + } + + /** + * Gets ask_exchange + * + * @return float|null + */ + public function getAskExchange() + { + return $this->container['ask_exchange']; + } + + /** + * Sets ask_exchange + * + * @param float|null $ask_exchange The ask side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setAskExchange($ask_exchange) + { + if (is_null($ask_exchange)) { + throw new \InvalidArgumentException('non-nullable ask_exchange cannot be null'); + } + $this->container['ask_exchange'] = $ask_exchange; + + return $this; + } + + /** + * Gets ask_size + * + * @return float + */ + public function getAskSize() + { + return $this->container['ask_size']; + } + + /** + * Sets ask_size + * + * @param float $ask_size The ask size. + * + * @return self + */ + public function setAskSize($ask_size) + { + if (is_null($ask_size)) { + throw new \InvalidArgumentException('non-nullable ask_size cannot be null'); + } + $this->container['ask_size'] = $ask_size; + + return $this; + } + + /** + * Gets bid + * + * @return float + */ + public function getBid() + { + return $this->container['bid']; + } + + /** + * Sets bid + * + * @param float $bid The bid price. + * + * @return self + */ + public function setBid($bid) + { + if (is_null($bid)) { + throw new \InvalidArgumentException('non-nullable bid cannot be null'); + } + $this->container['bid'] = $bid; + + return $this; + } + + /** + * Gets bid_exchange + * + * @return float|null + */ + public function getBidExchange() + { + return $this->container['bid_exchange']; + } + + /** + * Sets bid_exchange + * + * @param float|null $bid_exchange The bid side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setBidExchange($bid_exchange) + { + if (is_null($bid_exchange)) { + throw new \InvalidArgumentException('non-nullable bid_exchange cannot be null'); + } + $this->container['bid_exchange'] = $bid_exchange; + + return $this; + } + + /** + * Gets bid_size + * + * @return float + */ + public function getBidSize() + { + return $this->container['bid_size']; + } + + /** + * Sets bid_size + * + * @param float $bid_size The bid size. + * + * @return self + */ + public function setBidSize($bid_size) + { + if (is_null($bid_size)) { + throw new \InvalidArgumentException('non-nullable bid_size cannot be null'); + } + $this->container['bid_size'] = $bid_size; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets midpoint + * + * @return float + */ + public function getMidpoint() + { + return $this->container['midpoint']; + } + + /** + * Sets midpoint + * + * @param float $midpoint The average of the bid and ask price. + * + * @return self + */ + public function setMidpoint($midpoint) + { + if (is_null($midpoint)) { + throw new \InvalidArgumentException('non-nullable midpoint cannot be null'); + } + $this->container['midpoint'] = $midpoint; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/OptionsChain200ResponseResultsInnerLastTrade.php b/lib/Model/OptionsChain200ResponseResultsInnerLastTrade.php new file mode 100644 index 0000000..23984b1 --- /dev/null +++ b/lib/Model/OptionsChain200ResponseResultsInnerLastTrade.php @@ -0,0 +1,629 @@ + + */ +class OptionsChain200ResponseResultsInnerLastTrade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OptionsChain_200_response_results_inner_last_trade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'exchange' => 'int', + 'price' => 'float', + 'sip_timestamp' => 'int', + 'size' => 'int', + 'timeframe' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'exchange' => null, + 'price' => 'double', + 'sip_timestamp' => 'int64', + 'size' => 'int32', + 'timeframe' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'exchange' => false, + 'price' => false, + 'sip_timestamp' => false, + 'size' => false, + 'timeframe' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'exchange' => 'exchange', + 'price' => 'price', + 'sip_timestamp' => 'sip_timestamp', + 'size' => 'size', + 'timeframe' => 'timeframe' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'exchange' => 'setExchange', + 'price' => 'setPrice', + 'sip_timestamp' => 'setSipTimestamp', + 'size' => 'setSize', + 'timeframe' => 'setTimeframe' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'exchange' => 'getExchange', + 'price' => 'getPrice', + 'sip_timestamp' => 'getSipTimestamp', + 'size' => 'getSize', + 'timeframe' => 'getTimeframe' + ]; + + /** + * 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; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['sip_timestamp'] === null) { + $invalidProperties[] = "'sip_timestamp' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + + /** + * Gets size + * + * @return int + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/PaginationHooksBase.php b/lib/Model/PaginationHooksBase.php new file mode 100644 index 0000000..689ed83 --- /dev/null +++ b/lib/Model/PaginationHooksBase.php @@ -0,0 +1,409 @@ + + */ +class PaginationHooksBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginationHooksBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Quotes200Response.php b/lib/Model/Quotes200Response.php new file mode 100644 index 0000000..d4f1679 --- /dev/null +++ b/lib/Model/Quotes200Response.php @@ -0,0 +1,480 @@ + + */ +class Quotes200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Quotes_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\Quotes200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\Quotes200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\Quotes200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Quotes200ResponseResultsInner.php b/lib/Model/Quotes200ResponseResultsInner.php new file mode 100644 index 0000000..d4f2a7a --- /dev/null +++ b/lib/Model/Quotes200ResponseResultsInner.php @@ -0,0 +1,826 @@ + + */ +class Quotes200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Quotes_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_exchange' => 'int', + 'ask_price' => 'float', + 'ask_size' => 'float', + 'bid_exchange' => 'int', + 'bid_price' => 'float', + 'bid_size' => 'float', + 'conditions' => 'int[]', + 'indicators' => 'int[]', + 'participant_timestamp' => 'int', + 'sequence_number' => 'int', + 'sip_timestamp' => 'int', + 'tape' => 'int', + 'trf_timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_exchange' => null, + 'ask_price' => 'double', + 'ask_size' => 'double', + 'bid_exchange' => null, + 'bid_price' => 'double', + 'bid_size' => 'double', + 'conditions' => 'int32', + 'indicators' => 'int32', + 'participant_timestamp' => 'int64', + 'sequence_number' => 'int64', + 'sip_timestamp' => 'int64', + 'tape' => 'int32', + 'trf_timestamp' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask_exchange' => false, + 'ask_price' => false, + 'ask_size' => false, + 'bid_exchange' => false, + 'bid_price' => false, + 'bid_size' => false, + 'conditions' => false, + 'indicators' => false, + 'participant_timestamp' => false, + 'sequence_number' => false, + 'sip_timestamp' => false, + 'tape' => false, + 'trf_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_exchange' => 'ask_exchange', + 'ask_price' => 'ask_price', + 'ask_size' => 'ask_size', + 'bid_exchange' => 'bid_exchange', + 'bid_price' => 'bid_price', + 'bid_size' => 'bid_size', + 'conditions' => 'conditions', + 'indicators' => 'indicators', + 'participant_timestamp' => 'participant_timestamp', + 'sequence_number' => 'sequence_number', + 'sip_timestamp' => 'sip_timestamp', + 'tape' => 'tape', + 'trf_timestamp' => 'trf_timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_exchange' => 'setAskExchange', + 'ask_price' => 'setAskPrice', + 'ask_size' => 'setAskSize', + 'bid_exchange' => 'setBidExchange', + 'bid_price' => 'setBidPrice', + 'bid_size' => 'setBidSize', + 'conditions' => 'setConditions', + 'indicators' => 'setIndicators', + 'participant_timestamp' => 'setParticipantTimestamp', + 'sequence_number' => 'setSequenceNumber', + 'sip_timestamp' => 'setSipTimestamp', + 'tape' => 'setTape', + 'trf_timestamp' => 'setTrfTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_exchange' => 'getAskExchange', + 'ask_price' => 'getAskPrice', + 'ask_size' => 'getAskSize', + 'bid_exchange' => 'getBidExchange', + 'bid_price' => 'getBidPrice', + 'bid_size' => 'getBidSize', + 'conditions' => 'getConditions', + 'indicators' => 'getIndicators', + 'participant_timestamp' => 'getParticipantTimestamp', + 'sequence_number' => 'getSequenceNumber', + 'sip_timestamp' => 'getSipTimestamp', + 'tape' => 'getTape', + 'trf_timestamp' => 'getTrfTimestamp' + ]; + + /** + * 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->setIfExists('ask_exchange', $data ?? [], null); + $this->setIfExists('ask_price', $data ?? [], null); + $this->setIfExists('ask_size', $data ?? [], null); + $this->setIfExists('bid_exchange', $data ?? [], null); + $this->setIfExists('bid_price', $data ?? [], null); + $this->setIfExists('bid_size', $data ?? [], null); + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('indicators', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + $this->setIfExists('tape', $data ?? [], null); + $this->setIfExists('trf_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['participant_timestamp'] === null) { + $invalidProperties[] = "'participant_timestamp' can't be null"; + } + if ($this->container['sequence_number'] === null) { + $invalidProperties[] = "'sequence_number' can't be null"; + } + if ($this->container['sip_timestamp'] === null) { + $invalidProperties[] = "'sip_timestamp' can't be null"; + } + 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 ask_exchange + * + * @return int|null + */ + public function getAskExchange() + { + return $this->container['ask_exchange']; + } + + /** + * Sets ask_exchange + * + * @param int|null $ask_exchange The ask exchange ID + * + * @return self + */ + public function setAskExchange($ask_exchange) + { + if (is_null($ask_exchange)) { + throw new \InvalidArgumentException('non-nullable ask_exchange cannot be null'); + } + $this->container['ask_exchange'] = $ask_exchange; + + return $this; + } + + /** + * Gets ask_price + * + * @return float|null + */ + public function getAskPrice() + { + return $this->container['ask_price']; + } + + /** + * Sets ask_price + * + * @param float|null $ask_price The ask price. + * + * @return self + */ + public function setAskPrice($ask_price) + { + if (is_null($ask_price)) { + throw new \InvalidArgumentException('non-nullable ask_price cannot be null'); + } + $this->container['ask_price'] = $ask_price; + + return $this; + } + + /** + * Gets ask_size + * + * @return float|null + */ + public function getAskSize() + { + return $this->container['ask_size']; + } + + /** + * Sets ask_size + * + * @param float|null $ask_size The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setAskSize($ask_size) + { + if (is_null($ask_size)) { + throw new \InvalidArgumentException('non-nullable ask_size cannot be null'); + } + $this->container['ask_size'] = $ask_size; + + return $this; + } + + /** + * Gets bid_exchange + * + * @return int|null + */ + public function getBidExchange() + { + return $this->container['bid_exchange']; + } + + /** + * Sets bid_exchange + * + * @param int|null $bid_exchange The bid exchange ID + * + * @return self + */ + public function setBidExchange($bid_exchange) + { + if (is_null($bid_exchange)) { + throw new \InvalidArgumentException('non-nullable bid_exchange cannot be null'); + } + $this->container['bid_exchange'] = $bid_exchange; + + return $this; + } + + /** + * Gets bid_price + * + * @return float|null + */ + public function getBidPrice() + { + return $this->container['bid_price']; + } + + /** + * Sets bid_price + * + * @param float|null $bid_price The bid price. + * + * @return self + */ + public function setBidPrice($bid_price) + { + if (is_null($bid_price)) { + throw new \InvalidArgumentException('non-nullable bid_price cannot be null'); + } + $this->container['bid_price'] = $bid_price; + + return $this; + } + + /** + * Gets bid_size + * + * @return float|null + */ + public function getBidSize() + { + return $this->container['bid_size']; + } + + /** + * Sets bid_size + * + * @param float|null $bid_size The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setBidSize($bid_size) + { + if (is_null($bid_size)) { + throw new \InvalidArgumentException('non-nullable bid_size cannot be null'); + } + $this->container['bid_size'] = $bid_size; + + return $this; + } + + /** + * Gets conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets indicators + * + * @return int[]|null + */ + public function getIndicators() + { + return $this->container['indicators']; + } + + /** + * Sets indicators + * + * @param int[]|null $indicators A list of indicator codes. + * + * @return self + */ + public function setIndicators($indicators) + { + if (is_null($indicators)) { + throw new \InvalidArgumentException('non-nullable indicators cannot be null'); + } + $this->container['indicators'] = $indicators; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int $participant_timestamp The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + + /** + * Gets sequence_number + * + * @return int + */ + public function getSequenceNumber() + { + return $this->container['sequence_number']; + } + + /** + * Sets sequence_number + * + * @param int $sequence_number The sequence number represents the sequence in which quote events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day. + * + * @return self + */ + public function setSequenceNumber($sequence_number) + { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } + $this->container['sequence_number'] = $sequence_number; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + + /** + * Gets tape + * + * @return int|null + */ + public function getTape() + { + return $this->container['tape']; + } + + /** + * Sets tape + * + * @param int|null $tape There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setTape($tape) + { + if (is_null($tape)) { + throw new \InvalidArgumentException('non-nullable tape cannot be null'); + } + $this->container['tape'] = $tape; + + return $this; + } + + /** + * Gets trf_timestamp + * + * @return int|null + */ + public function getTrfTimestamp() + { + return $this->container['trf_timestamp']; + } + + /** + * Sets trf_timestamp + * + * @param int|null $trf_timestamp The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this quote. + * + * @return self + */ + public function setTrfTimestamp($trf_timestamp) + { + if (is_null($trf_timestamp)) { + throw new \InvalidArgumentException('non-nullable trf_timestamp cannot be null'); + } + $this->container['trf_timestamp'] = $trf_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/QuotesFx200Response.php b/lib/Model/QuotesFx200Response.php new file mode 100644 index 0000000..ea480c8 --- /dev/null +++ b/lib/Model/QuotesFx200Response.php @@ -0,0 +1,480 @@ + + */ +class QuotesFx200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuotesFx_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\QuotesFx200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\QuotesFx200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\QuotesFx200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/QuotesFx200ResponseResultsInner.php b/lib/Model/QuotesFx200ResponseResultsInner.php new file mode 100644 index 0000000..2355c7f --- /dev/null +++ b/lib/Model/QuotesFx200ResponseResultsInner.php @@ -0,0 +1,548 @@ + + */ +class QuotesFx200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuotesFx_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_exchange' => 'int', + 'ask_price' => 'float', + 'bid_exchange' => 'int', + 'bid_price' => 'float', + 'participant_timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_exchange' => null, + 'ask_price' => 'double', + 'bid_exchange' => null, + 'bid_price' => 'double', + 'participant_timestamp' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask_exchange' => false, + 'ask_price' => false, + 'bid_exchange' => false, + 'bid_price' => false, + 'participant_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_exchange' => 'ask_exchange', + 'ask_price' => 'ask_price', + 'bid_exchange' => 'bid_exchange', + 'bid_price' => 'bid_price', + 'participant_timestamp' => 'participant_timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_exchange' => 'setAskExchange', + 'ask_price' => 'setAskPrice', + 'bid_exchange' => 'setBidExchange', + 'bid_price' => 'setBidPrice', + 'participant_timestamp' => 'setParticipantTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_exchange' => 'getAskExchange', + 'ask_price' => 'getAskPrice', + 'bid_exchange' => 'getBidExchange', + 'bid_price' => 'getBidPrice', + 'participant_timestamp' => 'getParticipantTimestamp' + ]; + + /** + * 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->setIfExists('ask_exchange', $data ?? [], null); + $this->setIfExists('ask_price', $data ?? [], null); + $this->setIfExists('bid_exchange', $data ?? [], null); + $this->setIfExists('bid_price', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['participant_timestamp'] === null) { + $invalidProperties[] = "'participant_timestamp' can't be null"; + } + 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 ask_exchange + * + * @return int|null + */ + public function getAskExchange() + { + return $this->container['ask_exchange']; + } + + /** + * Sets ask_exchange + * + * @param int|null $ask_exchange The ask exchange ID + * + * @return self + */ + public function setAskExchange($ask_exchange) + { + if (is_null($ask_exchange)) { + throw new \InvalidArgumentException('non-nullable ask_exchange cannot be null'); + } + $this->container['ask_exchange'] = $ask_exchange; + + return $this; + } + + /** + * Gets ask_price + * + * @return float|null + */ + public function getAskPrice() + { + return $this->container['ask_price']; + } + + /** + * Sets ask_price + * + * @param float|null $ask_price The ask price. + * + * @return self + */ + public function setAskPrice($ask_price) + { + if (is_null($ask_price)) { + throw new \InvalidArgumentException('non-nullable ask_price cannot be null'); + } + $this->container['ask_price'] = $ask_price; + + return $this; + } + + /** + * Gets bid_exchange + * + * @return int|null + */ + public function getBidExchange() + { + return $this->container['bid_exchange']; + } + + /** + * Sets bid_exchange + * + * @param int|null $bid_exchange The bid exchange ID + * + * @return self + */ + public function setBidExchange($bid_exchange) + { + if (is_null($bid_exchange)) { + throw new \InvalidArgumentException('non-nullable bid_exchange cannot be null'); + } + $this->container['bid_exchange'] = $bid_exchange; + + return $this; + } + + /** + * Gets bid_price + * + * @return float|null + */ + public function getBidPrice() + { + return $this->container['bid_price']; + } + + /** + * Sets bid_price + * + * @param float|null $bid_price The bid price. + * + * @return self + */ + public function setBidPrice($bid_price) + { + if (is_null($bid_price)) { + throw new \InvalidArgumentException('non-nullable bid_price cannot be null'); + } + $this->container['bid_price'] = $bid_price; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int $participant_timestamp The nanosecond Exchange Unix Timestamp. This is the timestamp of when the quote was generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/QuotesOptions200Response.php b/lib/Model/QuotesOptions200Response.php new file mode 100644 index 0000000..789bfdd --- /dev/null +++ b/lib/Model/QuotesOptions200Response.php @@ -0,0 +1,480 @@ + + */ +class QuotesOptions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuotesOptions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\QuotesOptions200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\QuotesOptions200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\QuotesOptions200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/QuotesOptions200ResponseResultsInner.php b/lib/Model/QuotesOptions200ResponseResultsInner.php new file mode 100644 index 0000000..33e22e5 --- /dev/null +++ b/lib/Model/QuotesOptions200ResponseResultsInner.php @@ -0,0 +1,653 @@ + + */ +class QuotesOptions200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuotesOptions_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_exchange' => 'int', + 'ask_price' => 'float', + 'ask_size' => 'float', + 'bid_exchange' => 'int', + 'bid_price' => 'float', + 'bid_size' => 'float', + 'sequence_number' => 'int', + 'sip_timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_exchange' => null, + 'ask_price' => 'double', + 'ask_size' => 'double', + 'bid_exchange' => null, + 'bid_price' => 'double', + 'bid_size' => 'double', + 'sequence_number' => 'int64', + 'sip_timestamp' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask_exchange' => false, + 'ask_price' => false, + 'ask_size' => false, + 'bid_exchange' => false, + 'bid_price' => false, + 'bid_size' => false, + 'sequence_number' => false, + 'sip_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_exchange' => 'ask_exchange', + 'ask_price' => 'ask_price', + 'ask_size' => 'ask_size', + 'bid_exchange' => 'bid_exchange', + 'bid_price' => 'bid_price', + 'bid_size' => 'bid_size', + 'sequence_number' => 'sequence_number', + 'sip_timestamp' => 'sip_timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_exchange' => 'setAskExchange', + 'ask_price' => 'setAskPrice', + 'ask_size' => 'setAskSize', + 'bid_exchange' => 'setBidExchange', + 'bid_price' => 'setBidPrice', + 'bid_size' => 'setBidSize', + 'sequence_number' => 'setSequenceNumber', + 'sip_timestamp' => 'setSipTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_exchange' => 'getAskExchange', + 'ask_price' => 'getAskPrice', + 'ask_size' => 'getAskSize', + 'bid_exchange' => 'getBidExchange', + 'bid_price' => 'getBidPrice', + 'bid_size' => 'getBidSize', + 'sequence_number' => 'getSequenceNumber', + 'sip_timestamp' => 'getSipTimestamp' + ]; + + /** + * 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->setIfExists('ask_exchange', $data ?? [], null); + $this->setIfExists('ask_price', $data ?? [], null); + $this->setIfExists('ask_size', $data ?? [], null); + $this->setIfExists('bid_exchange', $data ?? [], null); + $this->setIfExists('bid_price', $data ?? [], null); + $this->setIfExists('bid_size', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sequence_number'] === null) { + $invalidProperties[] = "'sequence_number' can't be null"; + } + if ($this->container['sip_timestamp'] === null) { + $invalidProperties[] = "'sip_timestamp' can't be null"; + } + 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 ask_exchange + * + * @return int|null + */ + public function getAskExchange() + { + return $this->container['ask_exchange']; + } + + /** + * Sets ask_exchange + * + * @param int|null $ask_exchange The ask exchange ID + * + * @return self + */ + public function setAskExchange($ask_exchange) + { + if (is_null($ask_exchange)) { + throw new \InvalidArgumentException('non-nullable ask_exchange cannot be null'); + } + $this->container['ask_exchange'] = $ask_exchange; + + return $this; + } + + /** + * Gets ask_price + * + * @return float|null + */ + public function getAskPrice() + { + return $this->container['ask_price']; + } + + /** + * Sets ask_price + * + * @param float|null $ask_price The ask price. + * + * @return self + */ + public function setAskPrice($ask_price) + { + if (is_null($ask_price)) { + throw new \InvalidArgumentException('non-nullable ask_price cannot be null'); + } + $this->container['ask_price'] = $ask_price; + + return $this; + } + + /** + * Gets ask_size + * + * @return float|null + */ + public function getAskSize() + { + return $this->container['ask_size']; + } + + /** + * Sets ask_size + * + * @param float|null $ask_size The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setAskSize($ask_size) + { + if (is_null($ask_size)) { + throw new \InvalidArgumentException('non-nullable ask_size cannot be null'); + } + $this->container['ask_size'] = $ask_size; + + return $this; + } + + /** + * Gets bid_exchange + * + * @return int|null + */ + public function getBidExchange() + { + return $this->container['bid_exchange']; + } + + /** + * Sets bid_exchange + * + * @param int|null $bid_exchange The bid exchange ID + * + * @return self + */ + public function setBidExchange($bid_exchange) + { + if (is_null($bid_exchange)) { + throw new \InvalidArgumentException('non-nullable bid_exchange cannot be null'); + } + $this->container['bid_exchange'] = $bid_exchange; + + return $this; + } + + /** + * Gets bid_price + * + * @return float|null + */ + public function getBidPrice() + { + return $this->container['bid_price']; + } + + /** + * Sets bid_price + * + * @param float|null $bid_price The bid price. + * + * @return self + */ + public function setBidPrice($bid_price) + { + if (is_null($bid_price)) { + throw new \InvalidArgumentException('non-nullable bid_price cannot be null'); + } + $this->container['bid_price'] = $bid_price; + + return $this; + } + + /** + * Gets bid_size + * + * @return float|null + */ + public function getBidSize() + { + return $this->container['bid_size']; + } + + /** + * Sets bid_size + * + * @param float|null $bid_size The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setBidSize($bid_size) + { + if (is_null($bid_size)) { + throw new \InvalidArgumentException('non-nullable bid_size cannot be null'); + } + $this->container['bid_size'] = $bid_size; + + return $this; + } + + /** + * Gets sequence_number + * + * @return int + */ + public function getSequenceNumber() + { + return $this->container['sequence_number']; + } + + /** + * Sets sequence_number + * + * @param int $sequence_number The sequence number represents the sequence in which quote events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setSequenceNumber($sequence_number) + { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } + $this->container['sequence_number'] = $sequence_number; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/RatingSection.php b/lib/Model/RatingSection.php new file mode 100644 index 0000000..99c0bfc --- /dev/null +++ b/lib/Model/RatingSection.php @@ -0,0 +1,591 @@ + + */ +class RatingSection implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RatingSection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'current' => 'float', + 'month1' => 'float', + 'month2' => 'float', + 'month3' => 'float', + 'month4' => 'float', + 'month5' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'current' => null, + 'month1' => null, + 'month2' => null, + 'month3' => null, + 'month4' => null, + 'month5' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'current' => false, + 'month1' => false, + 'month2' => false, + 'month3' => false, + 'month4' => false, + 'month5' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'current' => 'current', + 'month1' => 'month1', + 'month2' => 'month2', + 'month3' => 'month3', + 'month4' => 'month4', + 'month5' => 'month5' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'current' => 'setCurrent', + 'month1' => 'setMonth1', + 'month2' => 'setMonth2', + 'month3' => 'setMonth3', + 'month4' => 'setMonth4', + 'month5' => 'setMonth5' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'current' => 'getCurrent', + 'month1' => 'getMonth1', + 'month2' => 'getMonth2', + 'month3' => 'getMonth3', + 'month4' => 'getMonth4', + 'month5' => 'getMonth5' + ]; + + /** + * 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->setIfExists('current', $data ?? [], null); + $this->setIfExists('month1', $data ?? [], null); + $this->setIfExists('month2', $data ?? [], null); + $this->setIfExists('month3', $data ?? [], null); + $this->setIfExists('month4', $data ?? [], null); + $this->setIfExists('month5', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['current'] === null) { + $invalidProperties[] = "'current' can't be null"; + } + if ($this->container['month1'] === null) { + $invalidProperties[] = "'month1' can't be null"; + } + if ($this->container['month2'] === null) { + $invalidProperties[] = "'month2' can't be null"; + } + if ($this->container['month3'] === null) { + $invalidProperties[] = "'month3' can't be null"; + } + 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 current + * + * @return float + */ + public function getCurrent() + { + return $this->container['current']; + } + + /** + * Sets current + * + * @param float $current Analyst Rating at current month + * + * @return self + */ + public function setCurrent($current) + { + if (is_null($current)) { + throw new \InvalidArgumentException('non-nullable current cannot be null'); + } + $this->container['current'] = $current; + + return $this; + } + + /** + * Gets month1 + * + * @return float + */ + public function getMonth1() + { + return $this->container['month1']; + } + + /** + * Sets month1 + * + * @param float $month1 Analyst Ratings at 1 month in the future + * + * @return self + */ + public function setMonth1($month1) + { + if (is_null($month1)) { + throw new \InvalidArgumentException('non-nullable month1 cannot be null'); + } + $this->container['month1'] = $month1; + + return $this; + } + + /** + * Gets month2 + * + * @return float + */ + public function getMonth2() + { + return $this->container['month2']; + } + + /** + * Sets month2 + * + * @param float $month2 Analyst Ratings at 2 month in the future + * + * @return self + */ + public function setMonth2($month2) + { + if (is_null($month2)) { + throw new \InvalidArgumentException('non-nullable month2 cannot be null'); + } + $this->container['month2'] = $month2; + + return $this; + } + + /** + * Gets month3 + * + * @return float + */ + public function getMonth3() + { + return $this->container['month3']; + } + + /** + * Sets month3 + * + * @param float $month3 Analyst Ratings at 3 month in the future + * + * @return self + */ + public function setMonth3($month3) + { + if (is_null($month3)) { + throw new \InvalidArgumentException('non-nullable month3 cannot be null'); + } + $this->container['month3'] = $month3; + + return $this; + } + + /** + * Gets month4 + * + * @return float|null + */ + public function getMonth4() + { + return $this->container['month4']; + } + + /** + * Sets month4 + * + * @param float|null $month4 Analyst Ratings at 4 month in the future + * + * @return self + */ + public function setMonth4($month4) + { + if (is_null($month4)) { + throw new \InvalidArgumentException('non-nullable month4 cannot be null'); + } + $this->container['month4'] = $month4; + + return $this; + } + + /** + * Gets month5 + * + * @return float|null + */ + public function getMonth5() + { + return $this->container['month5']; + } + + /** + * Sets month5 + * + * @param float|null $month5 Analyst Ratings at 5 month in the future + * + * @return self + */ + public function setMonth5($month5) + { + if (is_null($month5)) { + throw new \InvalidArgumentException('non-nullable month5 cannot be null'); + } + $this->container['month5'] = $month5; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/RealTimeCurrencyConversion200Response.php b/lib/Model/RealTimeCurrencyConversion200Response.php new file mode 100644 index 0000000..42671f1 --- /dev/null +++ b/lib/Model/RealTimeCurrencyConversion200Response.php @@ -0,0 +1,668 @@ + + */ +class RealTimeCurrencyConversion200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RealTimeCurrencyConversion_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'converted' => 'float', + 'from' => 'string', + 'initial_amount' => 'float', + 'last' => '\OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast', + 'request_id' => 'string', + 'status' => 'string', + 'symbol' => 'string', + 'to' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'converted' => 'double', + 'from' => null, + 'initial_amount' => 'double', + 'last' => null, + 'request_id' => null, + 'status' => null, + 'symbol' => null, + 'to' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'converted' => false, + 'from' => false, + 'initial_amount' => false, + 'last' => false, + 'request_id' => false, + 'status' => false, + 'symbol' => false, + 'to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'converted' => 'converted', + 'from' => 'from', + 'initial_amount' => 'initialAmount', + 'last' => 'last', + 'request_id' => 'request_id', + 'status' => 'status', + 'symbol' => 'symbol', + 'to' => 'to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'converted' => 'setConverted', + 'from' => 'setFrom', + 'initial_amount' => 'setInitialAmount', + 'last' => 'setLast', + 'request_id' => 'setRequestId', + 'status' => 'setStatus', + 'symbol' => 'setSymbol', + 'to' => 'setTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'converted' => 'getConverted', + 'from' => 'getFrom', + 'initial_amount' => 'getInitialAmount', + 'last' => 'getLast', + 'request_id' => 'getRequestId', + 'status' => 'getStatus', + 'symbol' => 'getSymbol', + 'to' => 'getTo' + ]; + + /** + * 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->setIfExists('converted', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('initial_amount', $data ?? [], null); + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['converted'] === null) { + $invalidProperties[] = "'converted' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['initial_amount'] === null) { + $invalidProperties[] = "'initial_amount' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + if ($this->container['to'] === null) { + $invalidProperties[] = "'to' can't be null"; + } + 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 converted + * + * @return float + */ + public function getConverted() + { + return $this->container['converted']; + } + + /** + * Sets converted + * + * @param float $converted The result of the conversion. + * + * @return self + */ + public function setConverted($converted) + { + if (is_null($converted)) { + throw new \InvalidArgumentException('non-nullable converted cannot be null'); + } + $this->container['converted'] = $converted; + + return $this; + } + + /** + * Gets from + * + * @return string + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param string $from The \"from\" currency symbol. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets initial_amount + * + * @return float + */ + public function getInitialAmount() + { + return $this->container['initial_amount']; + } + + /** + * Sets initial_amount + * + * @param float $initial_amount The amount to convert. + * + * @return self + */ + public function setInitialAmount($initial_amount) + { + if (is_null($initial_amount)) { + throw new \InvalidArgumentException('non-nullable initial_amount cannot be null'); + } + $this->container['initial_amount'] = $initial_amount; + + return $this; + } + + /** + * Gets last + * + * @return \OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \OpenAPI\Client\Model\RealTimeCurrencyConversion200ResponseLast|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets to + * + * @return string + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param string $to The \"to\" currency symbol. + * + * @return self + */ + public function setTo($to) + { + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/RealTimeCurrencyConversion200ResponseLast.php b/lib/Model/RealTimeCurrencyConversion200ResponseLast.php new file mode 100644 index 0000000..9e76626 --- /dev/null +++ b/lib/Model/RealTimeCurrencyConversion200ResponseLast.php @@ -0,0 +1,523 @@ + + */ +class RealTimeCurrencyConversion200ResponseLast implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RealTimeCurrencyConversion_200_response_last'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask' => 'float', + 'bid' => 'float', + 'exchange' => 'int', + 'timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask' => 'double', + 'bid' => 'double', + 'exchange' => null, + 'timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask' => false, + 'bid' => false, + 'exchange' => false, + 'timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask' => 'ask', + 'bid' => 'bid', + 'exchange' => 'exchange', + 'timestamp' => 'timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask' => 'setAsk', + 'bid' => 'setBid', + 'exchange' => 'setExchange', + 'timestamp' => 'setTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask' => 'getAsk', + 'bid' => 'getBid', + 'exchange' => 'getExchange', + 'timestamp' => 'getTimestamp' + ]; + + /** + * 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->setIfExists('ask', $data ?? [], null); + $this->setIfExists('bid', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ask'] === null) { + $invalidProperties[] = "'ask' can't be null"; + } + if ($this->container['bid'] === null) { + $invalidProperties[] = "'bid' can't be null"; + } + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + 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 ask + * + * @return float + */ + public function getAsk() + { + return $this->container['ask']; + } + + /** + * Sets ask + * + * @param float $ask The ask price. + * + * @return self + */ + public function setAsk($ask) + { + if (is_null($ask)) { + throw new \InvalidArgumentException('non-nullable ask cannot be null'); + } + $this->container['ask'] = $ask; + + return $this; + } + + /** + * Gets bid + * + * @return float + */ + public function getBid() + { + return $this->container['bid']; + } + + /** + * Sets bid + * + * @param float $bid The bid price. + * + * @return self + */ + public function setBid($bid) + { + if (is_null($bid)) { + throw new \InvalidArgumentException('non-nullable bid cannot be null'); + } + $this->container['bid'] = $bid; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The Unix millisecond timestamp. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/RequestIdBase.php b/lib/Model/RequestIdBase.php new file mode 100644 index 0000000..aea03b7 --- /dev/null +++ b/lib/Model/RequestIdBase.php @@ -0,0 +1,412 @@ + + */ +class RequestIdBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RequestIdBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotMinOHLCV.php b/lib/Model/SnapshotMinOHLCV.php new file mode 100644 index 0000000..8eae512 --- /dev/null +++ b/lib/Model/SnapshotMinOHLCV.php @@ -0,0 +1,613 @@ + + */ +class SnapshotMinOHLCV implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotMinOHLCV'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 c + * + * @return float|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float|null $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float|null $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float|null + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float|null $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float|null + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float|null $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int|null $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float|null + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float|null $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotOHLCV.php b/lib/Model/SnapshotOHLCV.php new file mode 100644 index 0000000..332b2ba --- /dev/null +++ b/lib/Model/SnapshotOHLCV.php @@ -0,0 +1,560 @@ + + */ +class SnapshotOHLCV implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotOHLCV'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotOHLCVVW.php b/lib/Model/SnapshotOHLCVVW.php new file mode 100644 index 0000000..3e91b2b --- /dev/null +++ b/lib/Model/SnapshotOHLCVVW.php @@ -0,0 +1,597 @@ + + */ +class SnapshotOHLCVVW implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotOHLCVVW'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotOHLCVVWOtc.php b/lib/Model/SnapshotOHLCVVWOtc.php new file mode 100644 index 0000000..508aa20 --- /dev/null +++ b/lib/Model/SnapshotOHLCVVWOtc.php @@ -0,0 +1,631 @@ + + */ +class SnapshotOHLCVVWOtc implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotOHLCVVWOtc'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'otc' => 'bool', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'otc' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'otc' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'otc' => 'otc', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'otc' => 'setOtc', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'otc' => 'getOtc', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotSummary200Response.php b/lib/Model/SnapshotSummary200Response.php new file mode 100644 index 0000000..f7f3162 --- /dev/null +++ b/lib/Model/SnapshotSummary200Response.php @@ -0,0 +1,483 @@ + + */ +class SnapshotSummary200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotSummary_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotSummary200ResponseResultsInner.php b/lib/Model/SnapshotSummary200ResponseResultsInner.php new file mode 100644 index 0000000..9b5d6d5 --- /dev/null +++ b/lib/Model/SnapshotSummary200ResponseResultsInner.php @@ -0,0 +1,814 @@ + + */ +class SnapshotSummary200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotSummary_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'branding' => '\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerBranding', + 'error' => 'string', + 'last_updated' => 'int', + 'market_status' => 'string', + 'message' => 'string', + 'name' => 'string', + 'options' => '\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerOptions', + 'price' => 'float', + 'session' => '\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession', + 'ticker' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'branding' => null, + 'error' => null, + 'last_updated' => 'int64', + 'market_status' => null, + 'message' => null, + 'name' => null, + 'options' => null, + 'price' => 'double', + 'session' => null, + 'ticker' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'branding' => false, + 'error' => false, + 'last_updated' => false, + 'market_status' => false, + 'message' => false, + 'name' => false, + 'options' => false, + 'price' => false, + 'session' => false, + 'ticker' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'branding' => 'branding', + 'error' => 'error', + 'last_updated' => 'last_updated', + 'market_status' => 'market_status', + 'message' => 'message', + 'name' => 'name', + 'options' => 'options', + 'price' => 'price', + 'session' => 'session', + 'ticker' => 'ticker', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'branding' => 'setBranding', + 'error' => 'setError', + 'last_updated' => 'setLastUpdated', + 'market_status' => 'setMarketStatus', + 'message' => 'setMessage', + 'name' => 'setName', + 'options' => 'setOptions', + 'price' => 'setPrice', + 'session' => 'setSession', + 'ticker' => 'setTicker', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'branding' => 'getBranding', + 'error' => 'getError', + 'last_updated' => 'getLastUpdated', + 'market_status' => 'getMarketStatus', + 'message' => 'getMessage', + 'name' => 'getName', + 'options' => 'getOptions', + 'price' => 'getPrice', + 'session' => 'getSession', + 'ticker' => 'getTicker', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const TYPE_STOCKS = 'stocks'; + public const TYPE_CRYPTO = 'crypto'; + public const TYPE_OPTIONS = 'options'; + public const TYPE_FX = 'fx'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STOCKS, + self::TYPE_CRYPTO, + self::TYPE_OPTIONS, + self::TYPE_FX, + ]; + } + + /** + * 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->setIfExists('branding', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('market_status', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('session', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['branding'] === null) { + $invalidProperties[] = "'branding' can't be null"; + } + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['market_status'] === null) { + $invalidProperties[] = "'market_status' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['session'] === null) { + $invalidProperties[] = "'session' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 branding + * + * @return \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerBranding + */ + public function getBranding() + { + return $this->container['branding']; + } + + /** + * Sets branding + * + * @param \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerBranding $branding branding + * + * @return self + */ + public function setBranding($branding) + { + if (is_null($branding)) { + throw new \InvalidArgumentException('non-nullable branding cannot be null'); + } + $this->container['branding'] = $branding; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error while looking for this ticker. + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets market_status + * + * @return string + */ + public function getMarketStatus() + { + return $this->container['market_status']; + } + + /** + * Sets market_status + * + * @param string $market_status The market status for the market that trades this ticker. + * + * @return self + */ + public function setMarketStatus($market_status) + { + if (is_null($market_status)) { + throw new \InvalidArgumentException('non-nullable market_status cannot be null'); + } + $this->container['market_status'] = $market_status; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The error message while looking for this ticker. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of ticker, forex, or crypto asset. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerOptions + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerOptions $options options + * + * @return self + */ + public function setOptions($options) + { + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); + } + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The most up to date ticker price. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets session + * + * @return \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession + */ + public function getSession() + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession $session session + * + * @return self + */ + public function setSession($session) + { + if (is_null($session)) { + throw new \InvalidArgumentException('non-nullable session cannot be null'); + } + $this->container['session'] = $session; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker Ticker of asset queried. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The market for this ticker of stock, crypto, fx, option. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotSummary200ResponseResultsInnerBranding.php b/lib/Model/SnapshotSummary200ResponseResultsInnerBranding.php new file mode 100644 index 0000000..bc80ff8 --- /dev/null +++ b/lib/Model/SnapshotSummary200ResponseResultsInnerBranding.php @@ -0,0 +1,443 @@ + + */ +class SnapshotSummary200ResponseResultsInnerBranding implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotSummary_200_response_results_inner_branding'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'icon_url' => 'string', + 'logo_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'icon_url' => null, + 'logo_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'icon_url' => false, + 'logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'icon_url' => 'icon_url', + 'logo_url' => 'logo_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'icon_url' => 'setIconUrl', + 'logo_url' => 'setLogoUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'icon_url' => 'getIconUrl', + 'logo_url' => 'getLogoUrl' + ]; + + /** + * 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->setIfExists('icon_url', $data ?? [], null); + $this->setIfExists('logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. + * + * @return self + */ + public function setIconUrl($icon_url) + { + if (is_null($icon_url)) { + throw new \InvalidArgumentException('non-nullable icon_url cannot be null'); + } + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets logo_url + * + * @return string|null + */ + public function getLogoUrl() + { + return $this->container['logo_url']; + } + + /** + * Sets logo_url + * + * @param string|null $logo_url A link to this ticker's company's logo. Note that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details. + * + * @return self + */ + public function setLogoUrl($logo_url) + { + if (is_null($logo_url)) { + throw new \InvalidArgumentException('non-nullable logo_url cannot be null'); + } + $this->container['logo_url'] = $logo_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotSummary200ResponseResultsInnerOptions.php b/lib/Model/SnapshotSummary200ResponseResultsInnerOptions.php new file mode 100644 index 0000000..184529a --- /dev/null +++ b/lib/Model/SnapshotSummary200ResponseResultsInnerOptions.php @@ -0,0 +1,669 @@ + + */ +class SnapshotSummary200ResponseResultsInnerOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotSummary_200_response_results_inner_options'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract_type' => 'string', + 'exercise_style' => 'string', + 'expiration_date' => '\DateTime', + 'shares_per_contract' => 'float', + 'strike_price' => 'float', + 'underlying_ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract_type' => null, + 'exercise_style' => null, + 'expiration_date' => 'date', + 'shares_per_contract' => 'double', + 'strike_price' => 'double', + 'underlying_ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contract_type' => false, + 'exercise_style' => false, + 'expiration_date' => false, + 'shares_per_contract' => false, + 'strike_price' => false, + 'underlying_ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_type' => 'contract_type', + 'exercise_style' => 'exercise_style', + 'expiration_date' => 'expiration_date', + 'shares_per_contract' => 'shares_per_contract', + 'strike_price' => 'strike_price', + 'underlying_ticker' => 'underlying_ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_type' => 'setContractType', + 'exercise_style' => 'setExerciseStyle', + 'expiration_date' => 'setExpirationDate', + 'shares_per_contract' => 'setSharesPerContract', + 'strike_price' => 'setStrikePrice', + 'underlying_ticker' => 'setUnderlyingTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_type' => 'getContractType', + 'exercise_style' => 'getExerciseStyle', + 'expiration_date' => 'getExpirationDate', + 'shares_per_contract' => 'getSharesPerContract', + 'strike_price' => 'getStrikePrice', + 'underlying_ticker' => 'getUnderlyingTicker' + ]; + + /** + * 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; + } + + public const CONTRACT_TYPE_PUT = 'put'; + public const CONTRACT_TYPE_CALL = 'call'; + public const CONTRACT_TYPE_OTHER = 'other'; + public const EXERCISE_STYLE_AMERICAN = 'american'; + public const EXERCISE_STYLE_EUROPEAN = 'european'; + public const EXERCISE_STYLE_BERMUDAN = 'bermudan'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractTypeAllowableValues() + { + return [ + self::CONTRACT_TYPE_PUT, + self::CONTRACT_TYPE_CALL, + self::CONTRACT_TYPE_OTHER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExerciseStyleAllowableValues() + { + return [ + self::EXERCISE_STYLE_AMERICAN, + self::EXERCISE_STYLE_EUROPEAN, + self::EXERCISE_STYLE_BERMUDAN, + ]; + } + + /** + * 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->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('exercise_style', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('shares_per_contract', $data ?? [], null); + $this->setIfExists('strike_price', $data ?? [], null); + $this->setIfExists('underlying_ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contract_type'] === null) { + $invalidProperties[] = "'contract_type' can't be null"; + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!is_null($this->container['contract_type']) && !in_array($this->container['contract_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contract_type', must be one of '%s'", + $this->container['contract_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['exercise_style'] === null) { + $invalidProperties[] = "'exercise_style' can't be null"; + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!is_null($this->container['exercise_style']) && !in_array($this->container['exercise_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exercise_style', must be one of '%s'", + $this->container['exercise_style'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['expiration_date'] === null) { + $invalidProperties[] = "'expiration_date' can't be null"; + } + if ($this->container['shares_per_contract'] === null) { + $invalidProperties[] = "'shares_per_contract' can't be null"; + } + if ($this->container['strike_price'] === null) { + $invalidProperties[] = "'strike_price' can't be null"; + } + if ($this->container['underlying_ticker'] === null) { + $invalidProperties[] = "'underlying_ticker' can't be null"; + } + 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 contract_type + * + * @return string + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string $contract_type The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + throw new \InvalidArgumentException('non-nullable contract_type cannot be null'); + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!in_array($contract_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contract_type', must be one of '%s'", + $contract_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets exercise_style + * + * @return string + */ + public function getExerciseStyle() + { + return $this->container['exercise_style']; + } + + /** + * Sets exercise_style + * + * @param string $exercise_style The exercise style of this contract. See this link for more details on exercise styles. + * + * @return self + */ + public function setExerciseStyle($exercise_style) + { + if (is_null($exercise_style)) { + throw new \InvalidArgumentException('non-nullable exercise_style cannot be null'); + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!in_array($exercise_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exercise_style', must be one of '%s'", + $exercise_style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exercise_style'] = $exercise_style; + + return $this; + } + + /** + * Gets expiration_date + * + * @return \DateTime + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime $expiration_date The contract's expiration date in YYYY-MM-DD format. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets shares_per_contract + * + * @return float + */ + public function getSharesPerContract() + { + return $this->container['shares_per_contract']; + } + + /** + * Sets shares_per_contract + * + * @param float $shares_per_contract The number of shares per contract for this contract. + * + * @return self + */ + public function setSharesPerContract($shares_per_contract) + { + if (is_null($shares_per_contract)) { + throw new \InvalidArgumentException('non-nullable shares_per_contract cannot be null'); + } + $this->container['shares_per_contract'] = $shares_per_contract; + + return $this; + } + + /** + * Gets strike_price + * + * @return float + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param float $strike_price The strike price of the option contract. + * + * @return self + */ + public function setStrikePrice($strike_price) + { + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + } + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets underlying_ticker + * + * @return string + */ + public function getUnderlyingTicker() + { + return $this->container['underlying_ticker']; + } + + /** + * Sets underlying_ticker + * + * @param string $underlying_ticker The ticker for the option contract. + * + * @return self + */ + public function setUnderlyingTicker($underlying_ticker) + { + if (is_null($underlying_ticker)) { + throw new \InvalidArgumentException('non-nullable underlying_ticker cannot be null'); + } + $this->container['underlying_ticker'] = $underlying_ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/SnapshotSummary200ResponseResultsInnerSession.php b/lib/Model/SnapshotSummary200ResponseResultsInnerSession.php new file mode 100644 index 0000000..a61149b --- /dev/null +++ b/lib/Model/SnapshotSummary200ResponseResultsInnerSession.php @@ -0,0 +1,838 @@ + + */ +class SnapshotSummary200ResponseResultsInnerSession implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SnapshotSummary_200_response_results_inner_session'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'change' => 'float', + 'change_percent' => 'float', + 'close' => 'float', + 'early_trading_change' => 'float', + 'early_trading_change_percent' => 'float', + 'high' => 'float', + 'late_trading_change' => 'float', + 'late_trading_change_percent' => 'float', + 'low' => 'float', + 'open' => 'float', + 'previous_close' => 'float', + 'price' => 'float', + 'volume' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'change' => 'double', + 'change_percent' => 'double', + 'close' => 'double', + 'early_trading_change' => 'double', + 'early_trading_change_percent' => 'double', + 'high' => 'double', + 'late_trading_change' => 'double', + 'late_trading_change_percent' => 'double', + 'low' => 'double', + 'open' => 'double', + 'previous_close' => 'double', + 'price' => 'double', + 'volume' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'change' => false, + 'change_percent' => false, + 'close' => false, + 'early_trading_change' => false, + 'early_trading_change_percent' => false, + 'high' => false, + 'late_trading_change' => false, + 'late_trading_change_percent' => false, + 'low' => false, + 'open' => false, + 'previous_close' => false, + 'price' => false, + 'volume' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'change' => 'change', + 'change_percent' => 'change_percent', + 'close' => 'close', + 'early_trading_change' => 'early_trading_change', + 'early_trading_change_percent' => 'early_trading_change_percent', + 'high' => 'high', + 'late_trading_change' => 'late_trading_change', + 'late_trading_change_percent' => 'late_trading_change_percent', + 'low' => 'low', + 'open' => 'open', + 'previous_close' => 'previous_close', + 'price' => 'price', + 'volume' => 'volume' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'change' => 'setChange', + 'change_percent' => 'setChangePercent', + 'close' => 'setClose', + 'early_trading_change' => 'setEarlyTradingChange', + 'early_trading_change_percent' => 'setEarlyTradingChangePercent', + 'high' => 'setHigh', + 'late_trading_change' => 'setLateTradingChange', + 'late_trading_change_percent' => 'setLateTradingChangePercent', + 'low' => 'setLow', + 'open' => 'setOpen', + 'previous_close' => 'setPreviousClose', + 'price' => 'setPrice', + 'volume' => 'setVolume' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'change' => 'getChange', + 'change_percent' => 'getChangePercent', + 'close' => 'getClose', + 'early_trading_change' => 'getEarlyTradingChange', + 'early_trading_change_percent' => 'getEarlyTradingChangePercent', + 'high' => 'getHigh', + 'late_trading_change' => 'getLateTradingChange', + 'late_trading_change_percent' => 'getLateTradingChangePercent', + 'low' => 'getLow', + 'open' => 'getOpen', + 'previous_close' => 'getPreviousClose', + 'price' => 'getPrice', + 'volume' => 'getVolume' + ]; + + /** + * 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->setIfExists('change', $data ?? [], null); + $this->setIfExists('change_percent', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('early_trading_change', $data ?? [], null); + $this->setIfExists('early_trading_change_percent', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('late_trading_change', $data ?? [], null); + $this->setIfExists('late_trading_change_percent', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('previous_close', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['change'] === null) { + $invalidProperties[] = "'change' can't be null"; + } + if ($this->container['change_percent'] === null) { + $invalidProperties[] = "'change_percent' can't be null"; + } + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['previous_close'] === null) { + $invalidProperties[] = "'previous_close' can't be null"; + } + 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 change + * + * @return float + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param float $change The value of the price change for the asset from the previous trading day. + * + * @return self + */ + public function setChange($change) + { + if (is_null($change)) { + throw new \InvalidArgumentException('non-nullable change cannot be null'); + } + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets change_percent + * + * @return float + */ + public function getChangePercent() + { + return $this->container['change_percent']; + } + + /** + * Sets change_percent + * + * @param float $change_percent The percent of the price change for the asset from the previous trading day. + * + * @return self + */ + public function setChangePercent($change_percent) + { + if (is_null($change_percent)) { + throw new \InvalidArgumentException('non-nullable change_percent cannot be null'); + } + $this->container['change_percent'] = $change_percent; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The closing price of the asset for the day. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets early_trading_change + * + * @return float|null + */ + public function getEarlyTradingChange() + { + return $this->container['early_trading_change']; + } + + /** + * Sets early_trading_change + * + * @param float|null $early_trading_change Today's early trading change amount, difference between price and previous close if in early trading hours, otherwise difference between last price during early trading and previous close. + * + * @return self + */ + public function setEarlyTradingChange($early_trading_change) + { + if (is_null($early_trading_change)) { + throw new \InvalidArgumentException('non-nullable early_trading_change cannot be null'); + } + $this->container['early_trading_change'] = $early_trading_change; + + return $this; + } + + /** + * Gets early_trading_change_percent + * + * @return float|null + */ + public function getEarlyTradingChangePercent() + { + return $this->container['early_trading_change_percent']; + } + + /** + * Sets early_trading_change_percent + * + * @param float|null $early_trading_change_percent Today's early trading change as a percentage. + * + * @return self + */ + public function setEarlyTradingChangePercent($early_trading_change_percent) + { + if (is_null($early_trading_change_percent)) { + throw new \InvalidArgumentException('non-nullable early_trading_change_percent cannot be null'); + } + $this->container['early_trading_change_percent'] = $early_trading_change_percent; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest price of the asset for the day. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets late_trading_change + * + * @return float|null + */ + public function getLateTradingChange() + { + return $this->container['late_trading_change']; + } + + /** + * Sets late_trading_change + * + * @param float|null $late_trading_change Today's late trading change amount, difference between price and today's close if in late trading hours, otherwise difference between last price during late trading and today's close. + * + * @return self + */ + public function setLateTradingChange($late_trading_change) + { + if (is_null($late_trading_change)) { + throw new \InvalidArgumentException('non-nullable late_trading_change cannot be null'); + } + $this->container['late_trading_change'] = $late_trading_change; + + return $this; + } + + /** + * Gets late_trading_change_percent + * + * @return float|null + */ + public function getLateTradingChangePercent() + { + return $this->container['late_trading_change_percent']; + } + + /** + * Sets late_trading_change_percent + * + * @param float|null $late_trading_change_percent Today's late trading change as a percentage. + * + * @return self + */ + public function setLateTradingChangePercent($late_trading_change_percent) + { + if (is_null($late_trading_change_percent)) { + throw new \InvalidArgumentException('non-nullable late_trading_change_percent cannot be null'); + } + $this->container['late_trading_change_percent'] = $late_trading_change_percent; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest price of the asset for the day. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price of the asset for the day. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets previous_close + * + * @return float + */ + public function getPreviousClose() + { + return $this->container['previous_close']; + } + + /** + * Sets previous_close + * + * @param float $previous_close The closing price of the asset for the previous trading day. + * + * @return self + */ + public function setPreviousClose($previous_close) + { + if (is_null($previous_close)) { + throw new \InvalidArgumentException('non-nullable previous_close cannot be null'); + } + $this->container['previous_close'] = $previous_close; + + return $this; + } + + /** + * Gets price + * + * @return float|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float|null $price The price of the most recent trade or bid price for this asset. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets volume + * + * @return float|null + */ + public function getVolume() + { + return $this->container['volume']; + } + + /** + * Sets volume + * + * @param float|null $volume The trading volume for the asset for the day. + * + * @return self + */ + public function setVolume($volume) + { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } + $this->container['volume'] = $volume; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200Response.php b/lib/Model/Snapshots200Response.php new file mode 100644 index 0000000..a0fa504 --- /dev/null +++ b/lib/Model/Snapshots200Response.php @@ -0,0 +1,517 @@ + + */ +class Snapshots200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'request_id' => 'string', + 'results' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'request_id' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'request_id' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'request_id' => 'request_id', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'request_id' => 'setRequestId', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'request_id' => 'getRequestId', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInner.php b/lib/Model/Snapshots200ResponseResultsInner.php new file mode 100644 index 0000000..39c3931 --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInner.php @@ -0,0 +1,996 @@ + + */ +class Snapshots200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'break_even_price' => 'float', + 'details' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerDetails', + 'error' => 'string', + 'fmv' => 'float', + 'greeks' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks', + 'implied_volatility' => 'float', + 'last_quote' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastQuote', + 'last_trade' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastTrade', + 'market_status' => 'string', + 'message' => 'string', + 'name' => 'string', + 'open_interest' => 'float', + 'session' => '\OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession', + 'ticker' => 'string', + 'type' => 'string', + 'underlying_asset' => '\OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'break_even_price' => 'double', + 'details' => null, + 'error' => null, + 'fmv' => null, + 'greeks' => null, + 'implied_volatility' => 'double', + 'last_quote' => null, + 'last_trade' => null, + 'market_status' => null, + 'message' => null, + 'name' => null, + 'open_interest' => 'double', + 'session' => null, + 'ticker' => null, + 'type' => null, + 'underlying_asset' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'break_even_price' => false, + 'details' => false, + 'error' => false, + 'fmv' => false, + 'greeks' => false, + 'implied_volatility' => false, + 'last_quote' => false, + 'last_trade' => false, + 'market_status' => false, + 'message' => false, + 'name' => false, + 'open_interest' => false, + 'session' => false, + 'ticker' => false, + 'type' => false, + 'underlying_asset' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'break_even_price' => 'break_even_price', + 'details' => 'details', + 'error' => 'error', + 'fmv' => 'fmv', + 'greeks' => 'greeks', + 'implied_volatility' => 'implied_volatility', + 'last_quote' => 'last_quote', + 'last_trade' => 'last_trade', + 'market_status' => 'market_status', + 'message' => 'message', + 'name' => 'name', + 'open_interest' => 'open_interest', + 'session' => 'session', + 'ticker' => 'ticker', + 'type' => 'type', + 'underlying_asset' => 'underlying_asset', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'break_even_price' => 'setBreakEvenPrice', + 'details' => 'setDetails', + 'error' => 'setError', + 'fmv' => 'setFmv', + 'greeks' => 'setGreeks', + 'implied_volatility' => 'setImpliedVolatility', + 'last_quote' => 'setLastQuote', + 'last_trade' => 'setLastTrade', + 'market_status' => 'setMarketStatus', + 'message' => 'setMessage', + 'name' => 'setName', + 'open_interest' => 'setOpenInterest', + 'session' => 'setSession', + 'ticker' => 'setTicker', + 'type' => 'setType', + 'underlying_asset' => 'setUnderlyingAsset', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'break_even_price' => 'getBreakEvenPrice', + 'details' => 'getDetails', + 'error' => 'getError', + 'fmv' => 'getFmv', + 'greeks' => 'getGreeks', + 'implied_volatility' => 'getImpliedVolatility', + 'last_quote' => 'getLastQuote', + 'last_trade' => 'getLastTrade', + 'market_status' => 'getMarketStatus', + 'message' => 'getMessage', + 'name' => 'getName', + 'open_interest' => 'getOpenInterest', + 'session' => 'getSession', + 'ticker' => 'getTicker', + 'type' => 'getType', + 'underlying_asset' => 'getUnderlyingAsset', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_STOCKS = 'stocks'; + public const TYPE_OPTIONS = 'options'; + public const TYPE_FX = 'fx'; + public const TYPE_CRYPTO = 'crypto'; + public const TYPE_INDICES = 'indices'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STOCKS, + self::TYPE_OPTIONS, + self::TYPE_FX, + self::TYPE_CRYPTO, + self::TYPE_INDICES, + ]; + } + + /** + * 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->setIfExists('break_even_price', $data ?? [], null); + $this->setIfExists('details', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + $this->setIfExists('fmv', $data ?? [], null); + $this->setIfExists('greeks', $data ?? [], null); + $this->setIfExists('implied_volatility', $data ?? [], null); + $this->setIfExists('last_quote', $data ?? [], null); + $this->setIfExists('last_trade', $data ?? [], null); + $this->setIfExists('market_status', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('open_interest', $data ?? [], null); + $this->setIfExists('session', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('underlying_asset', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 break_even_price + * + * @return float|null + */ + public function getBreakEvenPrice() + { + return $this->container['break_even_price']; + } + + /** + * Sets break_even_price + * + * @param float|null $break_even_price The price of the underlying asset for the contract to break even. For a call, this value is (strike price + premium paid). For a put, this value is (strike price - premium paid). + * + * @return self + */ + public function setBreakEvenPrice($break_even_price) + { + if (is_null($break_even_price)) { + throw new \InvalidArgumentException('non-nullable break_even_price cannot be null'); + } + $this->container['break_even_price'] = $break_even_price; + + return $this; + } + + /** + * Gets details + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerDetails|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerDetails|null $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error while looking for this ticker. + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets fmv + * + * @return float|null + */ + public function getFmv() + { + return $this->container['fmv']; + } + + /** + * Sets fmv + * + * @param float|null $fmv Fair market value is only available on Business plans. It's it our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us. + * + * @return self + */ + public function setFmv($fmv) + { + if (is_null($fmv)) { + throw new \InvalidArgumentException('non-nullable fmv cannot be null'); + } + $this->container['fmv'] = $fmv; + + return $this; + } + + /** + * Gets greeks + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks|null + */ + public function getGreeks() + { + return $this->container['greeks']; + } + + /** + * Sets greeks + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerGreeks|null $greeks greeks + * + * @return self + */ + public function setGreeks($greeks) + { + if (is_null($greeks)) { + throw new \InvalidArgumentException('non-nullable greeks cannot be null'); + } + $this->container['greeks'] = $greeks; + + return $this; + } + + /** + * Gets implied_volatility + * + * @return float|null + */ + public function getImpliedVolatility() + { + return $this->container['implied_volatility']; + } + + /** + * Sets implied_volatility + * + * @param float|null $implied_volatility The market's forecast for the volatility of the underlying asset, based on this option's current price. + * + * @return self + */ + public function setImpliedVolatility($implied_volatility) + { + if (is_null($implied_volatility)) { + throw new \InvalidArgumentException('non-nullable implied_volatility cannot be null'); + } + $this->container['implied_volatility'] = $implied_volatility; + + return $this; + } + + /** + * Gets last_quote + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastQuote|null + */ + public function getLastQuote() + { + return $this->container['last_quote']; + } + + /** + * Sets last_quote + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastQuote|null $last_quote last_quote + * + * @return self + */ + public function setLastQuote($last_quote) + { + if (is_null($last_quote)) { + throw new \InvalidArgumentException('non-nullable last_quote cannot be null'); + } + $this->container['last_quote'] = $last_quote; + + return $this; + } + + /** + * Gets last_trade + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastTrade|null + */ + public function getLastTrade() + { + return $this->container['last_trade']; + } + + /** + * Sets last_trade + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerLastTrade|null $last_trade last_trade + * + * @return self + */ + public function setLastTrade($last_trade) + { + if (is_null($last_trade)) { + throw new \InvalidArgumentException('non-nullable last_trade cannot be null'); + } + $this->container['last_trade'] = $last_trade; + + return $this; + } + + /** + * Gets market_status + * + * @return string|null + */ + public function getMarketStatus() + { + return $this->container['market_status']; + } + + /** + * Sets market_status + * + * @param string|null $market_status The market status for the market that trades this ticker. Possible values for stocks, options, crypto, and forex snapshots are open, closed, early_trading, or late_trading. Possible values for indices snapshots are regular_trading, closed, early_trading, and late_trading. + * + * @return self + */ + public function setMarketStatus($market_status) + { + if (is_null($market_status)) { + throw new \InvalidArgumentException('non-nullable market_status cannot be null'); + } + $this->container['market_status'] = $market_status; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The error message while looking for this ticker. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of this contract. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets open_interest + * + * @return float|null + */ + public function getOpenInterest() + { + return $this->container['open_interest']; + } + + /** + * Sets open_interest + * + * @param float|null $open_interest The quantity of this contract held at the end of the last trading day. + * + * @return self + */ + public function setOpenInterest($open_interest) + { + if (is_null($open_interest)) { + throw new \InvalidArgumentException('non-nullable open_interest cannot be null'); + } + $this->container['open_interest'] = $open_interest; + + return $this; + } + + /** + * Gets session + * + * @return \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession|null + */ + public function getSession() + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param \OpenAPI\Client\Model\SnapshotSummary200ResponseResultsInnerSession|null $session session + * + * @return self + */ + public function setSession($session) + { + if (is_null($session)) { + throw new \InvalidArgumentException('non-nullable session cannot be null'); + } + $this->container['session'] = $session; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The ticker symbol for the asset. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The asset class for this ticker. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets underlying_asset + * + * @return \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset|null + */ + public function getUnderlyingAsset() + { + return $this->container['underlying_asset']; + } + + /** + * Sets underlying_asset + * + * @param \OpenAPI\Client\Model\Snapshots200ResponseResultsInnerUnderlyingAsset|null $underlying_asset underlying_asset + * + * @return self + */ + public function setUnderlyingAsset($underlying_asset) + { + if (is_null($underlying_asset)) { + throw new \InvalidArgumentException('non-nullable underlying_asset cannot be null'); + } + $this->container['underlying_asset'] = $underlying_asset; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Value of Index. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInnerDetails.php b/lib/Model/Snapshots200ResponseResultsInnerDetails.php new file mode 100644 index 0000000..15885ba --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInnerDetails.php @@ -0,0 +1,633 @@ + + */ +class Snapshots200ResponseResultsInnerDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract_type' => 'string', + 'exercise_style' => 'string', + 'expiration_date' => '\DateTime', + 'shares_per_contract' => 'float', + 'strike_price' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract_type' => null, + 'exercise_style' => null, + 'expiration_date' => 'date', + 'shares_per_contract' => null, + 'strike_price' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contract_type' => false, + 'exercise_style' => false, + 'expiration_date' => false, + 'shares_per_contract' => false, + 'strike_price' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_type' => 'contract_type', + 'exercise_style' => 'exercise_style', + 'expiration_date' => 'expiration_date', + 'shares_per_contract' => 'shares_per_contract', + 'strike_price' => 'strike_price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_type' => 'setContractType', + 'exercise_style' => 'setExerciseStyle', + 'expiration_date' => 'setExpirationDate', + 'shares_per_contract' => 'setSharesPerContract', + 'strike_price' => 'setStrikePrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_type' => 'getContractType', + 'exercise_style' => 'getExerciseStyle', + 'expiration_date' => 'getExpirationDate', + 'shares_per_contract' => 'getSharesPerContract', + 'strike_price' => 'getStrikePrice' + ]; + + /** + * 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; + } + + public const CONTRACT_TYPE_PUT = 'put'; + public const CONTRACT_TYPE_CALL = 'call'; + public const CONTRACT_TYPE_OTHER = 'other'; + public const EXERCISE_STYLE_AMERICAN = 'american'; + public const EXERCISE_STYLE_EUROPEAN = 'european'; + public const EXERCISE_STYLE_BERMUDAN = 'bermudan'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractTypeAllowableValues() + { + return [ + self::CONTRACT_TYPE_PUT, + self::CONTRACT_TYPE_CALL, + self::CONTRACT_TYPE_OTHER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExerciseStyleAllowableValues() + { + return [ + self::EXERCISE_STYLE_AMERICAN, + self::EXERCISE_STYLE_EUROPEAN, + self::EXERCISE_STYLE_BERMUDAN, + ]; + } + + /** + * 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->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('exercise_style', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('shares_per_contract', $data ?? [], null); + $this->setIfExists('strike_price', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contract_type'] === null) { + $invalidProperties[] = "'contract_type' can't be null"; + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!is_null($this->container['contract_type']) && !in_array($this->container['contract_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contract_type', must be one of '%s'", + $this->container['contract_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['exercise_style'] === null) { + $invalidProperties[] = "'exercise_style' can't be null"; + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!is_null($this->container['exercise_style']) && !in_array($this->container['exercise_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exercise_style', must be one of '%s'", + $this->container['exercise_style'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['expiration_date'] === null) { + $invalidProperties[] = "'expiration_date' can't be null"; + } + if ($this->container['shares_per_contract'] === null) { + $invalidProperties[] = "'shares_per_contract' can't be null"; + } + if ($this->container['strike_price'] === null) { + $invalidProperties[] = "'strike_price' can't be null"; + } + 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 contract_type + * + * @return string + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string $contract_type The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\". + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + throw new \InvalidArgumentException('non-nullable contract_type cannot be null'); + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!in_array($contract_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contract_type', must be one of '%s'", + $contract_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets exercise_style + * + * @return string + */ + public function getExerciseStyle() + { + return $this->container['exercise_style']; + } + + /** + * Sets exercise_style + * + * @param string $exercise_style The exercise style of this contract. See this link for more details on exercise styles. + * + * @return self + */ + public function setExerciseStyle($exercise_style) + { + if (is_null($exercise_style)) { + throw new \InvalidArgumentException('non-nullable exercise_style cannot be null'); + } + $allowedValues = $this->getExerciseStyleAllowableValues(); + if (!in_array($exercise_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exercise_style', must be one of '%s'", + $exercise_style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exercise_style'] = $exercise_style; + + return $this; + } + + /** + * Gets expiration_date + * + * @return \DateTime + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime $expiration_date The contract's expiration date in YYYY-MM-DD format. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets shares_per_contract + * + * @return float + */ + public function getSharesPerContract() + { + return $this->container['shares_per_contract']; + } + + /** + * Sets shares_per_contract + * + * @param float $shares_per_contract The number of shares per contract for this contract. + * + * @return self + */ + public function setSharesPerContract($shares_per_contract) + { + if (is_null($shares_per_contract)) { + throw new \InvalidArgumentException('non-nullable shares_per_contract cannot be null'); + } + $this->container['shares_per_contract'] = $shares_per_contract; + + return $this; + } + + /** + * Gets strike_price + * + * @return float + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param float $strike_price The strike price of the option contract. + * + * @return self + */ + public function setStrikePrice($strike_price) + { + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + } + $this->container['strike_price'] = $strike_price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInnerGreeks.php b/lib/Model/Snapshots200ResponseResultsInnerGreeks.php new file mode 100644 index 0000000..453f49b --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInnerGreeks.php @@ -0,0 +1,524 @@ + + */ +class Snapshots200ResponseResultsInnerGreeks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner_greeks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'delta' => 'float', + 'gamma' => 'float', + 'theta' => 'float', + 'vega' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'delta' => 'double', + 'gamma' => 'double', + 'theta' => 'double', + 'vega' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'delta' => false, + 'gamma' => false, + 'theta' => false, + 'vega' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'delta' => 'delta', + 'gamma' => 'gamma', + 'theta' => 'theta', + 'vega' => 'vega' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'delta' => 'setDelta', + 'gamma' => 'setGamma', + 'theta' => 'setTheta', + 'vega' => 'setVega' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'delta' => 'getDelta', + 'gamma' => 'getGamma', + 'theta' => 'getTheta', + 'vega' => 'getVega' + ]; + + /** + * 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->setIfExists('delta', $data ?? [], null); + $this->setIfExists('gamma', $data ?? [], null); + $this->setIfExists('theta', $data ?? [], null); + $this->setIfExists('vega', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['delta'] === null) { + $invalidProperties[] = "'delta' can't be null"; + } + if ($this->container['gamma'] === null) { + $invalidProperties[] = "'gamma' can't be null"; + } + if ($this->container['theta'] === null) { + $invalidProperties[] = "'theta' can't be null"; + } + if ($this->container['vega'] === null) { + $invalidProperties[] = "'vega' can't be null"; + } + 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 delta + * + * @return float + */ + public function getDelta() + { + return $this->container['delta']; + } + + /** + * Sets delta + * + * @param float $delta The change in the option's price per $0.01 increment in the price of the underlying asset. + * + * @return self + */ + public function setDelta($delta) + { + if (is_null($delta)) { + throw new \InvalidArgumentException('non-nullable delta cannot be null'); + } + $this->container['delta'] = $delta; + + return $this; + } + + /** + * Gets gamma + * + * @return float + */ + public function getGamma() + { + return $this->container['gamma']; + } + + /** + * Sets gamma + * + * @param float $gamma The change in delta per $0.01 change in the price of the underlying asset. + * + * @return self + */ + public function setGamma($gamma) + { + if (is_null($gamma)) { + throw new \InvalidArgumentException('non-nullable gamma cannot be null'); + } + $this->container['gamma'] = $gamma; + + return $this; + } + + /** + * Gets theta + * + * @return float + */ + public function getTheta() + { + return $this->container['theta']; + } + + /** + * Sets theta + * + * @param float $theta The change in the option's price per day. + * + * @return self + */ + public function setTheta($theta) + { + if (is_null($theta)) { + throw new \InvalidArgumentException('non-nullable theta cannot be null'); + } + $this->container['theta'] = $theta; + + return $this; + } + + /** + * Gets vega + * + * @return float + */ + public function getVega() + { + return $this->container['vega']; + } + + /** + * Sets vega + * + * @param float $vega The change in the option's price per 1% increment in volatility. + * + * @return self + */ + public function setVega($vega) + { + if (is_null($vega)) { + throw new \InvalidArgumentException('non-nullable vega cannot be null'); + } + $this->container['vega'] = $vega; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInnerLastQuote.php b/lib/Model/Snapshots200ResponseResultsInnerLastQuote.php new file mode 100644 index 0000000..6ac72ca --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInnerLastQuote.php @@ -0,0 +1,728 @@ + + */ +class Snapshots200ResponseResultsInnerLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner_last_quote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask' => 'float', + 'ask_exchange' => 'int', + 'ask_size' => 'float', + 'bid' => 'float', + 'bid_exchange' => 'int', + 'bid_size' => 'float', + 'last_updated' => 'int', + 'midpoint' => 'float', + 'timeframe' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask' => 'double', + 'ask_exchange' => null, + 'ask_size' => 'double', + 'bid' => 'double', + 'bid_exchange' => null, + 'bid_size' => 'double', + 'last_updated' => 'int64', + 'midpoint' => 'double', + 'timeframe' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask' => false, + 'ask_exchange' => false, + 'ask_size' => false, + 'bid' => false, + 'bid_exchange' => false, + 'bid_size' => false, + 'last_updated' => false, + 'midpoint' => false, + 'timeframe' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask' => 'ask', + 'ask_exchange' => 'ask_exchange', + 'ask_size' => 'ask_size', + 'bid' => 'bid', + 'bid_exchange' => 'bid_exchange', + 'bid_size' => 'bid_size', + 'last_updated' => 'last_updated', + 'midpoint' => 'midpoint', + 'timeframe' => 'timeframe' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask' => 'setAsk', + 'ask_exchange' => 'setAskExchange', + 'ask_size' => 'setAskSize', + 'bid' => 'setBid', + 'bid_exchange' => 'setBidExchange', + 'bid_size' => 'setBidSize', + 'last_updated' => 'setLastUpdated', + 'midpoint' => 'setMidpoint', + 'timeframe' => 'setTimeframe' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask' => 'getAsk', + 'ask_exchange' => 'getAskExchange', + 'ask_size' => 'getAskSize', + 'bid' => 'getBid', + 'bid_exchange' => 'getBidExchange', + 'bid_size' => 'getBidSize', + 'last_updated' => 'getLastUpdated', + 'midpoint' => 'getMidpoint', + 'timeframe' => 'getTimeframe' + ]; + + /** + * 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; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * 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->setIfExists('ask', $data ?? [], null); + $this->setIfExists('ask_exchange', $data ?? [], null); + $this->setIfExists('ask_size', $data ?? [], null); + $this->setIfExists('bid', $data ?? [], null); + $this->setIfExists('bid_exchange', $data ?? [], null); + $this->setIfExists('bid_size', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('midpoint', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ask'] === null) { + $invalidProperties[] = "'ask' can't be null"; + } + if ($this->container['bid'] === null) { + $invalidProperties[] = "'bid' can't be null"; + } + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + 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 ask + * + * @return float + */ + public function getAsk() + { + return $this->container['ask']; + } + + /** + * Sets ask + * + * @param float $ask The ask price. + * + * @return self + */ + public function setAsk($ask) + { + if (is_null($ask)) { + throw new \InvalidArgumentException('non-nullable ask cannot be null'); + } + $this->container['ask'] = $ask; + + return $this; + } + + /** + * Gets ask_exchange + * + * @return int|null + */ + public function getAskExchange() + { + return $this->container['ask_exchange']; + } + + /** + * Sets ask_exchange + * + * @param int|null $ask_exchange The ask side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setAskExchange($ask_exchange) + { + if (is_null($ask_exchange)) { + throw new \InvalidArgumentException('non-nullable ask_exchange cannot be null'); + } + $this->container['ask_exchange'] = $ask_exchange; + + return $this; + } + + /** + * Gets ask_size + * + * @return float|null + */ + public function getAskSize() + { + return $this->container['ask_size']; + } + + /** + * Sets ask_size + * + * @param float|null $ask_size The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setAskSize($ask_size) + { + if (is_null($ask_size)) { + throw new \InvalidArgumentException('non-nullable ask_size cannot be null'); + } + $this->container['ask_size'] = $ask_size; + + return $this; + } + + /** + * Gets bid + * + * @return float + */ + public function getBid() + { + return $this->container['bid']; + } + + /** + * Sets bid + * + * @param float $bid The bid price. + * + * @return self + */ + public function setBid($bid) + { + if (is_null($bid)) { + throw new \InvalidArgumentException('non-nullable bid cannot be null'); + } + $this->container['bid'] = $bid; + + return $this; + } + + /** + * Gets bid_exchange + * + * @return int|null + */ + public function getBidExchange() + { + return $this->container['bid_exchange']; + } + + /** + * Sets bid_exchange + * + * @param int|null $bid_exchange The bid side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setBidExchange($bid_exchange) + { + if (is_null($bid_exchange)) { + throw new \InvalidArgumentException('non-nullable bid_exchange cannot be null'); + } + $this->container['bid_exchange'] = $bid_exchange; + + return $this; + } + + /** + * Gets bid_size + * + * @return float|null + */ + public function getBidSize() + { + return $this->container['bid_size']; + } + + /** + * Sets bid_size + * + * @param float|null $bid_size The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setBidSize($bid_size) + { + if (is_null($bid_size)) { + throw new \InvalidArgumentException('non-nullable bid_size cannot be null'); + } + $this->container['bid_size'] = $bid_size; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets midpoint + * + * @return float|null + */ + public function getMidpoint() + { + return $this->container['midpoint']; + } + + /** + * Sets midpoint + * + * @param float|null $midpoint The average of the bid and ask price. + * + * @return self + */ + public function setMidpoint($midpoint) + { + if (is_null($midpoint)) { + throw new \InvalidArgumentException('non-nullable midpoint cannot be null'); + } + $this->container['midpoint'] = $midpoint; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInnerLastTrade.php b/lib/Model/Snapshots200ResponseResultsInnerLastTrade.php new file mode 100644 index 0000000..69f8df7 --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInnerLastTrade.php @@ -0,0 +1,731 @@ + + */ +class Snapshots200ResponseResultsInnerLastTrade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner_last_trade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'exchange' => 'int', + 'id' => 'string', + 'last_updated' => 'int', + 'participant_timestamp' => 'int', + 'price' => 'float', + 'sip_timestamp' => 'int', + 'size' => 'int', + 'timeframe' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'exchange' => null, + 'id' => null, + 'last_updated' => 'int64', + 'participant_timestamp' => 'int64', + 'price' => 'double', + 'sip_timestamp' => 'int64', + 'size' => 'int32', + 'timeframe' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'exchange' => false, + 'id' => false, + 'last_updated' => false, + 'participant_timestamp' => false, + 'price' => false, + 'sip_timestamp' => false, + 'size' => false, + 'timeframe' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'exchange' => 'exchange', + 'id' => 'id', + 'last_updated' => 'last_updated', + 'participant_timestamp' => 'participant_timestamp', + 'price' => 'price', + 'sip_timestamp' => 'sip_timestamp', + 'size' => 'size', + 'timeframe' => 'timeframe' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'exchange' => 'setExchange', + 'id' => 'setId', + 'last_updated' => 'setLastUpdated', + 'participant_timestamp' => 'setParticipantTimestamp', + 'price' => 'setPrice', + 'sip_timestamp' => 'setSipTimestamp', + 'size' => 'setSize', + 'timeframe' => 'setTimeframe' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'exchange' => 'getExchange', + 'id' => 'getId', + 'last_updated' => 'getLastUpdated', + 'participant_timestamp' => 'getParticipantTimestamp', + 'price' => 'getPrice', + 'sip_timestamp' => 'getSipTimestamp', + 'size' => 'getSize', + 'timeframe' => 'getTimeframe' + ]; + + /** + * 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; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['participant_timestamp'] === null) { + $invalidProperties[] = "'participant_timestamp' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets exchange + * + * @return int|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int|null $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int $participant_timestamp The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int|null + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int|null $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + + /** + * Gets size + * + * @return int + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Snapshots200ResponseResultsInnerUnderlyingAsset.php b/lib/Model/Snapshots200ResponseResultsInnerUnderlyingAsset.php new file mode 100644 index 0000000..29f054e --- /dev/null +++ b/lib/Model/Snapshots200ResponseResultsInnerUnderlyingAsset.php @@ -0,0 +1,626 @@ + + */ +class Snapshots200ResponseResultsInnerUnderlyingAsset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Snapshots_200_response_results_inner_underlying_asset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'change_to_break_even' => 'float', + 'last_updated' => 'int', + 'price' => 'float', + 'ticker' => 'string', + 'timeframe' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'change_to_break_even' => 'double', + 'last_updated' => 'int64', + 'price' => 'double', + 'ticker' => null, + 'timeframe' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'change_to_break_even' => false, + 'last_updated' => false, + 'price' => false, + 'ticker' => false, + 'timeframe' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'change_to_break_even' => 'change_to_break_even', + 'last_updated' => 'last_updated', + 'price' => 'price', + 'ticker' => 'ticker', + 'timeframe' => 'timeframe', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'change_to_break_even' => 'setChangeToBreakEven', + 'last_updated' => 'setLastUpdated', + 'price' => 'setPrice', + 'ticker' => 'setTicker', + 'timeframe' => 'setTimeframe', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'change_to_break_even' => 'getChangeToBreakEven', + 'last_updated' => 'getLastUpdated', + 'price' => 'getPrice', + 'ticker' => 'getTicker', + 'timeframe' => 'getTimeframe', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TIMEFRAME_DELAYED = 'DELAYED'; + public const TIMEFRAME_REAL_TIME = 'REAL-TIME'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeframeAllowableValues() + { + return [ + self::TIMEFRAME_DELAYED, + self::TIMEFRAME_REAL_TIME, + ]; + } + + /** + * 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->setIfExists('change_to_break_even', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['change_to_break_even'] === null) { + $invalidProperties[] = "'change_to_break_even' can't be null"; + } + if ($this->container['last_updated'] === null) { + $invalidProperties[] = "'last_updated' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!is_null($this->container['timeframe']) && !in_array($this->container['timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'timeframe', must be one of '%s'", + $this->container['timeframe'], + implode("', '", $allowedValues) + ); + } + + 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 change_to_break_even + * + * @return float + */ + public function getChangeToBreakEven() + { + return $this->container['change_to_break_even']; + } + + /** + * Sets change_to_break_even + * + * @param float $change_to_break_even The change in price for the contract to break even. + * + * @return self + */ + public function setChangeToBreakEven($change_to_break_even) + { + if (is_null($change_to_break_even)) { + throw new \InvalidArgumentException('non-nullable change_to_break_even cannot be null'); + } + $this->container['change_to_break_even'] = $change_to_break_even; + + return $this; + } + + /** + * Gets last_updated + * + * @return int + */ + public function getLastUpdated() + { + return $this->container['last_updated']; + } + + /** + * Sets last_updated + * + * @param int $last_updated The nanosecond timestamp of when this information was updated. + * + * @return self + */ + public function setLastUpdated($last_updated) + { + if (is_null($last_updated)) { + throw new \InvalidArgumentException('non-nullable last_updated cannot be null'); + } + $this->container['last_updated'] = $last_updated; + + return $this; + } + + /** + * Gets price + * + * @return float|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float|null $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The ticker symbol for the contract's underlying asset. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets timeframe + * + * @return string + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param string $timeframe The time relevance of the data. + * + * @return self + */ + public function setTimeframe($timeframe) + { + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + $allowedValues = $this->getTimeframeAllowableValues(); + if (!in_array($timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'timeframe', must be one of '%s'", + $timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the underlying index. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StandardBase.php b/lib/Model/StandardBase.php new file mode 100644 index 0000000..47d668c --- /dev/null +++ b/lib/Model/StandardBase.php @@ -0,0 +1,483 @@ + + */ +class StandardBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StandardBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'count' => 'int', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'count' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'count' => 'count', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'count' => 'setCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'count' => 'getCount', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StatusBase.php b/lib/Model/StatusBase.php new file mode 100644 index 0000000..13386bb --- /dev/null +++ b/lib/Model/StatusBase.php @@ -0,0 +1,412 @@ + + */ +class StatusBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StatusBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StatusCountBase.php b/lib/Model/StatusCountBase.php new file mode 100644 index 0000000..494542f --- /dev/null +++ b/lib/Model/StatusCountBase.php @@ -0,0 +1,446 @@ + + */ +class StatusCountBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StatusCountBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksGroupedResults.php b/lib/Model/StocksGroupedResults.php new file mode 100644 index 0000000..e716823 --- /dev/null +++ b/lib/Model/StocksGroupedResults.php @@ -0,0 +1,409 @@ + + */ +class StocksGroupedResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksGroupedResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksOpenClose.php b/lib/Model/StocksOpenClose.php new file mode 100644 index 0000000..2c7dfb1 --- /dev/null +++ b/lib/Model/StocksOpenClose.php @@ -0,0 +1,773 @@ + + */ +class StocksOpenClose implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksOpenClose'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after_hours' => 'float', + 'close' => 'float', + 'from' => '\DateTime', + 'high' => 'float', + 'low' => 'float', + 'open' => 'float', + 'otc' => 'bool', + 'pre_market' => 'int', + 'status' => 'string', + 'symbol' => 'string', + 'volume' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => 'double', + 'close' => 'double', + 'from' => 'date', + 'high' => 'double', + 'low' => 'double', + 'open' => 'double', + 'otc' => null, + 'pre_market' => null, + 'status' => null, + 'symbol' => null, + 'volume' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'close' => false, + 'from' => false, + 'high' => false, + 'low' => false, + 'open' => false, + 'otc' => false, + 'pre_market' => false, + 'status' => false, + 'symbol' => false, + 'volume' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'close' => 'close', + 'from' => 'from', + 'high' => 'high', + 'low' => 'low', + 'open' => 'open', + 'otc' => 'otc', + 'pre_market' => 'preMarket', + 'status' => 'status', + 'symbol' => 'symbol', + 'volume' => 'volume' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'close' => 'setClose', + 'from' => 'setFrom', + 'high' => 'setHigh', + 'low' => 'setLow', + 'open' => 'setOpen', + 'otc' => 'setOtc', + 'pre_market' => 'setPreMarket', + 'status' => 'setStatus', + 'symbol' => 'setSymbol', + 'volume' => 'setVolume' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'close' => 'getClose', + 'from' => 'getFrom', + 'high' => 'getHigh', + 'low' => 'getLow', + 'open' => 'getOpen', + 'otc' => 'getOtc', + 'pre_market' => 'getPreMarket', + 'status' => 'getStatus', + 'symbol' => 'getSymbol', + 'volume' => 'getVolume' + ]; + + /** + * 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->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('pre_market', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + if ($this->container['volume'] === null) { + $invalidProperties[] = "'volume' can't be null"; + } + 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 after_hours + * + * @return float|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param float|null $after_hours The close price of the ticker symbol in after hours trading. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close price for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime $from The requested date. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest price for the symbol in the given time period. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets pre_market + * + * @return int|null + */ + public function getPreMarket() + { + return $this->container['pre_market']; + } + + /** + * Sets pre_market + * + * @param int|null $pre_market The open price of the ticker symbol in pre-market trading. + * + * @return self + */ + public function setPreMarket($pre_market) + { + if (is_null($pre_market)) { + throw new \InvalidArgumentException('non-nullable pre_market cannot be null'); + } + $this->container['pre_market'] = $pre_market; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets volume + * + * @return float + */ + public function getVolume() + { + return $this->container['volume']; + } + + /** + * Sets volume + * + * @param float $volume The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setVolume($volume) + { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } + $this->container['volume'] = $volume; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksSnapshotLastQuote.php b/lib/Model/StocksSnapshotLastQuote.php new file mode 100644 index 0000000..3d68365 --- /dev/null +++ b/lib/Model/StocksSnapshotLastQuote.php @@ -0,0 +1,560 @@ + + */ +class StocksSnapshotLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksSnapshotLastQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'p' => 'float', + 's' => 'int', + 'p' => 'float', + 's' => 'int', + 't' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'p' => 'double', + 's' => null, + 'p' => 'double', + 's' => null, + 't' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'p' => false, + 's' => false, + 'p' => false, + 's' => false, + 't' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'p' => 'P', + 's' => 'S', + 'p' => 'p', + 's' => 's', + 't' => 't' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'p' => 'setP', + 's' => 'setS', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'p' => 'getP', + 's' => 'getS', + 'p' => 'getP', + 's' => 'getS', + '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->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + 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 p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The ask price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The ask size in lots. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The bid price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The bid size in lots. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksSnapshotMinute.php b/lib/Model/StocksSnapshotMinute.php new file mode 100644 index 0000000..54ca44d --- /dev/null +++ b/lib/Model/StocksSnapshotMinute.php @@ -0,0 +1,708 @@ + + */ +class StocksSnapshotMinute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksSnapshotMinute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'av' => 'int', + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'av' => null, + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'av' => false, + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'av' => 'av', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'av' => 'setAv', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'av' => 'getAv', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('av', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['av'] === null) { + $invalidProperties[] = "'av' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 av + * + * @return int + */ + public function getAv() + { + return $this->container['av']; + } + + /** + * Sets av + * + * @param int $av The accumulated volume. + * + * @return self + */ + public function setAv($av) + { + if (is_null($av)) { + throw new \InvalidArgumentException('non-nullable av cannot be null'); + } + $this->container['av'] = $av; + + return $this; + } + + /** + * Gets c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksSnapshotMinuteOTC.php b/lib/Model/StocksSnapshotMinuteOTC.php new file mode 100644 index 0000000..a7dcb72 --- /dev/null +++ b/lib/Model/StocksSnapshotMinuteOTC.php @@ -0,0 +1,742 @@ + + */ +class StocksSnapshotMinuteOTC implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksSnapshotMinuteOTC'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'av' => 'int', + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 'otc' => 'bool', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'av' => null, + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 'otc' => null, + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'av' => false, + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 'otc' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'av' => 'av', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 'otc' => 'otc', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'av' => 'setAv', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 'otc' => 'setOtc', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'av' => 'getAv', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 'otc' => 'getOtc', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('av', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['av'] === null) { + $invalidProperties[] = "'av' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 av + * + * @return int + */ + public function getAv() + { + return $this->container['av']; + } + + /** + * Sets av + * + * @param int $av The accumulated volume. + * + * @return self + */ + public function setAv($av) + { + if (is_null($av)) { + throw new \InvalidArgumentException('non-nullable av cannot be null'); + } + $this->container['av'] = $av; + + return $this; + } + + /** + * Gets c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksSnapshotTicker.php b/lib/Model/StocksSnapshotTicker.php new file mode 100644 index 0000000..078d3be --- /dev/null +++ b/lib/Model/StocksSnapshotTicker.php @@ -0,0 +1,409 @@ + + */ +class StocksSnapshotTicker implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksSnapshotTicker'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksSnapshotTickers.php b/lib/Model/StocksSnapshotTickers.php new file mode 100644 index 0000000..e1997b3 --- /dev/null +++ b/lib/Model/StocksSnapshotTickers.php @@ -0,0 +1,409 @@ + + */ +class StocksSnapshotTickers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksSnapshotTickers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksTickerResultsOTC.php b/lib/Model/StocksTickerResultsOTC.php new file mode 100644 index 0000000..d8d9791 --- /dev/null +++ b/lib/Model/StocksTickerResultsOTC.php @@ -0,0 +1,409 @@ + + */ +class StocksTickerResultsOTC implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksTickerResultsOTC'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2Base.php b/lib/Model/StocksV2Base.php new file mode 100644 index 0000000..8d3f98b --- /dev/null +++ b/lib/Model/StocksV2Base.php @@ -0,0 +1,560 @@ + + */ +class StocksV2Base implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2Base'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'f' => 'int', + 'q' => 'int', + 't' => 'int', + 'y' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'f' => null, + 'q' => 'int64', + 't' => null, + 'y' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'f' => false, + 'q' => false, + 't' => false, + 'y' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'f' => 'f', + 'q' => 'q', + 't' => 't', + 'y' => 'y' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'f' => 'setF', + 'q' => 'setQ', + 't' => 'setT', + 'y' => 'setY' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'f' => 'getF', + 'q' => 'getQ', + 't' => 'getT', + 'y' => 'getY' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['f'] === null) { + $invalidProperties[] = "'f' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets f + * + * @return int + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2NBBO.php b/lib/Model/StocksV2NBBO.php new file mode 100644 index 0000000..44064bb --- /dev/null +++ b/lib/Model/StocksV2NBBO.php @@ -0,0 +1,893 @@ + + */ +class StocksV2NBBO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2NBBO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'f' => 'int', + 'q' => 'int', + 't' => 'int', + 'y' => 'int', + 'p' => 'float', + 's' => 'int', + 'x' => '\OpenAPI\Client\Model\StocksV2NBBOAllOfX', + 'c' => 'int[]', + 'i' => 'int[]', + 'p' => 'float', + 's' => 'int', + 'x' => '\OpenAPI\Client\Model\StocksV2NBBOAllOfX', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'f' => null, + 'q' => 'int64', + 't' => null, + 'y' => null, + 'p' => 'double', + 's' => null, + 'x' => null, + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => null, + 'x' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'f' => false, + 'q' => false, + 't' => false, + 'y' => false, + 'p' => false, + 's' => false, + 'x' => false, + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 'x' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'f' => 'f', + 'q' => 'q', + 't' => 't', + 'y' => 'y', + 'p' => 'P', + 's' => 'S', + 'x' => 'X', + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 'x' => 'x', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'f' => 'setF', + 'q' => 'setQ', + 't' => 'setT', + 'y' => 'setY', + 'p' => 'setP', + 's' => 'setS', + 'x' => 'setX', + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 'x' => 'setX', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'f' => 'getF', + 'q' => 'getQ', + 't' => 'getT', + 'y' => 'getY', + 'p' => 'getP', + 's' => 'getS', + 'x' => 'getX', + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 'x' => 'getX', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['f'] === null) { + $invalidProperties[] = "'f' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['z'] === null) { + $invalidProperties[] = "'z' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets f + * + * @return int + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The ask price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return \OpenAPI\Client\Model\StocksV2NBBOAllOfX + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param \OpenAPI\Client\Model\StocksV2NBBOAllOfX $x x + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return int[] + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param int[] $i The indicators. For more information, see our glossary of [Conditions and Indicators](https://polygon.io/glossary/us/stocks/conditions-indicators). + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The bid price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return \OpenAPI\Client\Model\StocksV2NBBOAllOfX + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param \OpenAPI\Client\Model\StocksV2NBBOAllOfX $x x + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets z + * + * @return int + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2NBBOAllOfX.php b/lib/Model/StocksV2NBBOAllOfX.php new file mode 100644 index 0000000..66a0c2c --- /dev/null +++ b/lib/Model/StocksV2NBBOAllOfX.php @@ -0,0 +1,381 @@ + + */ +class StocksV2NBBOAllOfX implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2NBBO_allOf_x'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2NBBOs.php b/lib/Model/StocksV2NBBOs.php new file mode 100644 index 0000000..4944b65 --- /dev/null +++ b/lib/Model/StocksV2NBBOs.php @@ -0,0 +1,409 @@ + + */ +class StocksV2NBBOs implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2NBBOs'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2Trade.php b/lib/Model/StocksV2Trade.php new file mode 100644 index 0000000..a7c3e73 --- /dev/null +++ b/lib/Model/StocksV2Trade.php @@ -0,0 +1,856 @@ + + */ +class StocksV2Trade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2Trade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'f' => 'int', + 'q' => 'int', + 't' => 'int', + 'y' => 'int', + 'c' => 'int[]', + 'e' => 'int', + 'i' => 'string', + 'p' => 'float', + 'r' => 'int', + 's' => 'float', + 'x' => 'int', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'f' => null, + 'q' => 'int64', + 't' => null, + 'y' => null, + 'c' => null, + 'e' => null, + 'i' => null, + 'p' => 'double', + 'r' => null, + 's' => 'double', + 'x' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'f' => false, + 'q' => false, + 't' => false, + 'y' => false, + 'c' => false, + 'e' => false, + 'i' => false, + 'p' => false, + 'r' => false, + 's' => false, + 'x' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'f' => 'f', + 'q' => 'q', + 't' => 't', + 'y' => 'y', + 'c' => 'c', + 'e' => 'e', + 'i' => 'i', + 'p' => 'p', + 'r' => 'r', + 's' => 's', + 'x' => 'x', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'f' => 'setF', + 'q' => 'setQ', + 't' => 'setT', + 'y' => 'setY', + 'c' => 'setC', + 'e' => 'setE', + 'i' => 'setI', + 'p' => 'setP', + 'r' => 'setR', + 's' => 'setS', + 'x' => 'setX', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'f' => 'getF', + 'q' => 'getQ', + 't' => 'getT', + 'y' => 'getY', + 'c' => 'getC', + 'e' => 'getE', + 'i' => 'getI', + 'p' => 'getP', + 'r' => 'getR', + 's' => 'getS', + 'x' => 'getX', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('e', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('r', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['f'] === null) { + $invalidProperties[] = "'f' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['e'] === null) { + $invalidProperties[] = "'e' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['r'] === null) { + $invalidProperties[] = "'r' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['z'] === null) { + $invalidProperties[] = "'z' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets f + * + * @return int + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets e + * + * @return int + */ + public function getE() + { + return $this->container['e']; + } + + /** + * Sets e + * + * @param int $e The trade correction indicator. + * + * @return self + */ + public function setE($e) + { + if (is_null($e)) { + throw new \InvalidArgumentException('non-nullable e cannot be null'); + } + $this->container['e'] = $e; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets r + * + * @return int + */ + public function getR() + { + return $this->container['r']; + } + + /** + * Sets r + * + * @param int $r The ID for the Trade Reporting Facility where the trade took place. + * + * @return self + */ + public function setR($r) + { + if (is_null($r)) { + throw new \InvalidArgumentException('non-nullable r cannot be null'); + } + $this->container['r'] = $r; + + return $this; + } + + /** + * Gets s + * + * @return float + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float $s The size of a trade (also known as volume). + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets z + * + * @return int + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/StocksV2Trades.php b/lib/Model/StocksV2Trades.php new file mode 100644 index 0000000..1ee1399 --- /dev/null +++ b/lib/Model/StocksV2Trades.php @@ -0,0 +1,409 @@ + + */ +class StocksV2Trades implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StocksV2Trades'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TickerBase.php b/lib/Model/TickerBase.php new file mode 100644 index 0000000..70b3bcb --- /dev/null +++ b/lib/Model/TickerBase.php @@ -0,0 +1,412 @@ + + */ +class TickerBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TickerBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + 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 ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TickerResults.php b/lib/Model/TickerResults.php new file mode 100644 index 0000000..63f3148 --- /dev/null +++ b/lib/Model/TickerResults.php @@ -0,0 +1,409 @@ + + */ +class TickerResults implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TickerResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 results + * + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TradeDetailsMapItem.php b/lib/Model/TradeDetailsMapItem.php new file mode 100644 index 0000000..0978999 --- /dev/null +++ b/lib/Model/TradeDetailsMapItem.php @@ -0,0 +1,443 @@ + + */ +class TradeDetailsMapItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TradeDetailsMapItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the trade detail item + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Actual type of the trade detail item + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Trades200Response.php b/lib/Model/Trades200Response.php new file mode 100644 index 0000000..be93792 --- /dev/null +++ b/lib/Model/Trades200Response.php @@ -0,0 +1,480 @@ + + */ +class Trades200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Trades_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\Trades200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\Trades200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\Trades200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/Trades200ResponseResultsInner.php b/lib/Model/Trades200ResponseResultsInner.php new file mode 100644 index 0000000..a42d7c0 --- /dev/null +++ b/lib/Model/Trades200ResponseResultsInner.php @@ -0,0 +1,804 @@ + + */ +class Trades200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Trades_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'correction' => 'int', + 'exchange' => 'int', + 'id' => 'string', + 'participant_timestamp' => 'int', + 'price' => 'float', + 'sequence_number' => 'int', + 'sip_timestamp' => 'int', + 'size' => 'float', + 'tape' => 'int', + 'trf_id' => 'int', + 'trf_timestamp' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'correction' => null, + 'exchange' => null, + 'id' => null, + 'participant_timestamp' => 'int64', + 'price' => 'double', + 'sequence_number' => 'int64', + 'sip_timestamp' => 'int64', + 'size' => 'double', + 'tape' => 'int32', + 'trf_id' => null, + 'trf_timestamp' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'correction' => false, + 'exchange' => false, + 'id' => false, + 'participant_timestamp' => false, + 'price' => false, + 'sequence_number' => false, + 'sip_timestamp' => false, + 'size' => false, + 'tape' => false, + 'trf_id' => false, + 'trf_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'correction' => 'correction', + 'exchange' => 'exchange', + 'id' => 'id', + 'participant_timestamp' => 'participant_timestamp', + 'price' => 'price', + 'sequence_number' => 'sequence_number', + 'sip_timestamp' => 'sip_timestamp', + 'size' => 'size', + 'tape' => 'tape', + 'trf_id' => 'trf_id', + 'trf_timestamp' => 'trf_timestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'correction' => 'setCorrection', + 'exchange' => 'setExchange', + 'id' => 'setId', + 'participant_timestamp' => 'setParticipantTimestamp', + 'price' => 'setPrice', + 'sequence_number' => 'setSequenceNumber', + 'sip_timestamp' => 'setSipTimestamp', + 'size' => 'setSize', + 'tape' => 'setTape', + 'trf_id' => 'setTrfId', + 'trf_timestamp' => 'setTrfTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'correction' => 'getCorrection', + 'exchange' => 'getExchange', + 'id' => 'getId', + 'participant_timestamp' => 'getParticipantTimestamp', + 'price' => 'getPrice', + 'sequence_number' => 'getSequenceNumber', + 'sip_timestamp' => 'getSipTimestamp', + 'size' => 'getSize', + 'tape' => 'getTape', + 'trf_id' => 'getTrfId', + 'trf_timestamp' => 'getTrfTimestamp' + ]; + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('correction', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('tape', $data ?? [], null); + $this->setIfExists('trf_id', $data ?? [], null); + $this->setIfExists('trf_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['participant_timestamp'] === null) { + $invalidProperties[] = "'participant_timestamp' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['sequence_number'] === null) { + $invalidProperties[] = "'sequence_number' can't be null"; + } + if ($this->container['sip_timestamp'] === null) { + $invalidProperties[] = "'sip_timestamp' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets correction + * + * @return int|null + */ + public function getCorrection() + { + return $this->container['correction']; + } + + /** + * Sets correction + * + * @param int|null $correction The trade correction indicator. + * + * @return self + */ + public function setCorrection($correction) + { + if (is_null($correction)) { + throw new \InvalidArgumentException('non-nullable correction cannot be null'); + } + $this->container['correction'] = $correction; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int $participant_timestamp The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets sequence_number + * + * @return int + */ + public function getSequenceNumber() + { + return $this->container['sequence_number']; + } + + /** + * Sets sequence_number + * + * @param int $sequence_number The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day. + * + * @return self + */ + public function setSequenceNumber($sequence_number) + { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } + $this->container['sequence_number'] = $sequence_number; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets tape + * + * @return int|null + */ + public function getTape() + { + return $this->container['tape']; + } + + /** + * Sets tape + * + * @param int|null $tape There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setTape($tape) + { + if (is_null($tape)) { + throw new \InvalidArgumentException('non-nullable tape cannot be null'); + } + $this->container['tape'] = $tape; + + return $this; + } + + /** + * Gets trf_id + * + * @return int|null + */ + public function getTrfId() + { + return $this->container['trf_id']; + } + + /** + * Sets trf_id + * + * @param int|null $trf_id The ID for the Trade Reporting Facility where the trade took place. + * + * @return self + */ + public function setTrfId($trf_id) + { + if (is_null($trf_id)) { + throw new \InvalidArgumentException('non-nullable trf_id cannot be null'); + } + $this->container['trf_id'] = $trf_id; + + return $this; + } + + /** + * Gets trf_timestamp + * + * @return int|null + */ + public function getTrfTimestamp() + { + return $this->container['trf_timestamp']; + } + + /** + * Sets trf_timestamp + * + * @param int|null $trf_timestamp The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this trade. + * + * @return self + */ + public function setTrfTimestamp($trf_timestamp) + { + if (is_null($trf_timestamp)) { + throw new \InvalidArgumentException('non-nullable trf_timestamp cannot be null'); + } + $this->container['trf_timestamp'] = $trf_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TradesCrypto200Response.php b/lib/Model/TradesCrypto200Response.php new file mode 100644 index 0000000..1266a90 --- /dev/null +++ b/lib/Model/TradesCrypto200Response.php @@ -0,0 +1,480 @@ + + */ +class TradesCrypto200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TradesCrypto_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\TradesCrypto200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\TradesCrypto200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\TradesCrypto200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TradesCrypto200ResponseResultsInner.php b/lib/Model/TradesCrypto200ResponseResultsInner.php new file mode 100644 index 0000000..0fbe32b --- /dev/null +++ b/lib/Model/TradesCrypto200ResponseResultsInner.php @@ -0,0 +1,591 @@ + + */ +class TradesCrypto200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TradesCrypto_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'exchange' => 'int', + 'id' => 'string', + 'participant_timestamp' => 'int', + 'price' => 'float', + 'size' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'exchange' => null, + 'id' => null, + 'participant_timestamp' => 'int64', + 'price' => 'double', + 'size' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'exchange' => false, + 'id' => false, + 'participant_timestamp' => false, + 'price' => false, + 'size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'exchange' => 'exchange', + 'id' => 'id', + 'participant_timestamp' => 'participant_timestamp', + 'price' => 'price', + 'size' => 'size' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'exchange' => 'setExchange', + 'id' => 'setId', + 'participant_timestamp' => 'setParticipantTimestamp', + 'price' => 'setPrice', + 'size' => 'setSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'exchange' => 'getExchange', + 'id' => 'getId', + 'participant_timestamp' => 'getParticipantTimestamp', + 'price' => 'getPrice', + 'size' => 'getSize' + ]; + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The Trade ID which uniquely identifies a trade on the exchange that the trade happened on. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int|null + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int|null $participant_timestamp The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade in the base currency of the crypto pair. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TradesOptions200Response.php b/lib/Model/TradesOptions200Response.php new file mode 100644 index 0000000..82ca448 --- /dev/null +++ b/lib/Model/TradesOptions200Response.php @@ -0,0 +1,480 @@ + + */ +class TradesOptions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TradesOptions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_url' => 'string', + 'results' => '\OpenAPI\Client\Model\TradesOptions200ResponseResultsInner[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_url' => null, + 'results' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'next_url' => false, + 'results' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_url' => 'next_url', + 'results' => 'results', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_url' => 'setNextUrl', + 'results' => 'setResults', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_url' => 'getNextUrl', + 'results' => 'getResults', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('next_url', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\TradesOptions200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\TradesOptions200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/TradesOptions200ResponseResultsInner.php b/lib/Model/TradesOptions200ResponseResultsInner.php new file mode 100644 index 0000000..d33d078 --- /dev/null +++ b/lib/Model/TradesOptions200ResponseResultsInner.php @@ -0,0 +1,625 @@ + + */ +class TradesOptions200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TradesOptions_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => 'int[]', + 'correction' => 'int', + 'exchange' => 'int', + 'participant_timestamp' => 'int', + 'price' => 'float', + 'sip_timestamp' => 'int', + 'size' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => 'int32', + 'correction' => null, + 'exchange' => null, + 'participant_timestamp' => 'int64', + 'price' => 'double', + 'sip_timestamp' => 'int64', + 'size' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conditions' => false, + 'correction' => false, + 'exchange' => false, + 'participant_timestamp' => false, + 'price' => false, + 'sip_timestamp' => false, + 'size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'correction' => 'correction', + 'exchange' => 'exchange', + 'participant_timestamp' => 'participant_timestamp', + 'price' => 'price', + 'sip_timestamp' => 'sip_timestamp', + 'size' => 'size' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'correction' => 'setCorrection', + 'exchange' => 'setExchange', + 'participant_timestamp' => 'setParticipantTimestamp', + 'price' => 'setPrice', + 'sip_timestamp' => 'setSipTimestamp', + 'size' => 'setSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'correction' => 'getCorrection', + 'exchange' => 'getExchange', + 'participant_timestamp' => 'getParticipantTimestamp', + 'price' => 'getPrice', + 'sip_timestamp' => 'getSipTimestamp', + 'size' => 'getSize' + ]; + + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('correction', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('participant_timestamp', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('sip_timestamp', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['exchange'] === null) { + $invalidProperties[] = "'exchange' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['sip_timestamp'] === null) { + $invalidProperties[] = "'sip_timestamp' can't be null"; + } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + 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 conditions + * + * @return int[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param int[]|null $conditions A list of condition codes. + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + throw new \InvalidArgumentException('non-nullable conditions cannot be null'); + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets correction + * + * @return int|null + */ + public function getCorrection() + { + return $this->container['correction']; + } + + /** + * Sets correction + * + * @param int|null $correction The trade correction indicator. + * + * @return self + */ + public function setCorrection($correction) + { + if (is_null($correction)) { + throw new \InvalidArgumentException('non-nullable correction cannot be null'); + } + $this->container['correction'] = $correction; + + return $this; + } + + /** + * Gets exchange + * + * @return int + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param int $exchange The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setExchange($exchange) + { + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets participant_timestamp + * + * @return int|null + */ + public function getParticipantTimestamp() + { + return $this->container['participant_timestamp']; + } + + /** + * Sets participant_timestamp + * + * @param int|null $participant_timestamp The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually generated at the exchange. + * + * @return self + */ + public function setParticipantTimestamp($participant_timestamp) + { + if (is_null($participant_timestamp)) { + throw new \InvalidArgumentException('non-nullable participant_timestamp cannot be null'); + } + $this->container['participant_timestamp'] = $participant_timestamp; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets sip_timestamp + * + * @return int + */ + public function getSipTimestamp() + { + return $this->container['sip_timestamp']; + } + + /** + * Sets sip_timestamp + * + * @param int $sip_timestamp The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it. + * + * @return self + */ + public function setSipTimestamp($sip_timestamp) + { + if (is_null($sip_timestamp)) { + throw new \InvalidArgumentException('non-nullable sip_timestamp cannot be null'); + } + $this->container['sip_timestamp'] = $sip_timestamp; + + return $this; + } + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size The size of a trade (also known as volume). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1HistoricCryptoFromToDateGet200Response.php b/lib/Model/V1HistoricCryptoFromToDateGet200Response.php new file mode 100644 index 0000000..998abad --- /dev/null +++ b/lib/Model/V1HistoricCryptoFromToDateGet200Response.php @@ -0,0 +1,560 @@ + + */ +class V1HistoricCryptoFromToDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_historic_crypto__from___to___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\DateTime', + 'map' => 'object', + 'ms_latency' => 'int', + 'symbol' => 'string', + 'ticks' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => 'date', + 'map' => null, + 'ms_latency' => null, + 'symbol' => null, + 'ticks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'map' => false, + 'ms_latency' => false, + 'symbol' => false, + 'ticks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'map' => 'map', + 'ms_latency' => 'msLatency', + 'symbol' => 'symbol', + 'ticks' => 'ticks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'map' => 'setMap', + 'ms_latency' => 'setMsLatency', + 'symbol' => 'setSymbol', + 'ticks' => 'setTicks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'map' => 'getMap', + 'ms_latency' => 'getMsLatency', + 'symbol' => 'getSymbol', + 'ticks' => 'getTicks' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('map', $data ?? [], null); + $this->setIfExists('ms_latency', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('ticks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['map'] === null) { + $invalidProperties[] = "'map' can't be null"; + } + if ($this->container['ms_latency'] === null) { + $invalidProperties[] = "'ms_latency' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + if ($this->container['ticks'] === null) { + $invalidProperties[] = "'ticks' can't be null"; + } + 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 day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date that was evaluated from the request. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets map + * + * @return object + */ + public function getMap() + { + return $this->container['map']; + } + + /** + * Sets map + * + * @param object $map A map for shortened result keys. + * + * @return self + */ + public function setMap($map) + { + if (is_null($map)) { + throw new \InvalidArgumentException('non-nullable map cannot be null'); + } + $this->container['map'] = $map; + + return $this; + } + + /** + * Gets ms_latency + * + * @return int + */ + public function getMsLatency() + { + return $this->container['ms_latency']; + } + + /** + * Sets ms_latency + * + * @param int $ms_latency The milliseconds of latency for the query results. + * + * @return self + */ + public function setMsLatency($ms_latency) + { + if (is_null($ms_latency)) { + throw new \InvalidArgumentException('non-nullable ms_latency cannot be null'); + } + $this->container['ms_latency'] = $ms_latency; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets ticks + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getTicks() + { + return $this->container['ticks']; + } + + /** + * Sets ticks + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $ticks ticks + * + * @return self + */ + public function setTicks($ticks) + { + if (is_null($ticks)) { + throw new \InvalidArgumentException('non-nullable ticks cannot be null'); + } + $this->container['ticks'] = $ticks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.php b/lib/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.php new file mode 100644 index 0000000..55a3a72 --- /dev/null +++ b/lib/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner.php @@ -0,0 +1,597 @@ + + */ +class V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_historic_crypto__from___to___date__get_200_response_allOf_ticks_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'int[]', + 'i' => 'string', + 'p' => 'float', + 's' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => 'double', + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return float + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float $s The size of a trade (also known as volume). + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange that this crypto trade happened on. See Exchanges for a mapping of exchanges to IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1HistoricForexFromToDateGet200Response.php b/lib/Model/V1HistoricForexFromToDateGet200Response.php new file mode 100644 index 0000000..7cca2c4 --- /dev/null +++ b/lib/Model/V1HistoricForexFromToDateGet200Response.php @@ -0,0 +1,597 @@ + + */ +class V1HistoricForexFromToDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_historic_forex__from___to___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'day' => '\DateTime', + 'map' => 'object', + 'ms_latency' => 'int', + 'pair' => 'string', + 'ticks' => '\OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'day' => 'date', + 'map' => null, + 'ms_latency' => null, + 'pair' => null, + 'ticks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'day' => false, + 'map' => false, + 'ms_latency' => false, + 'pair' => false, + 'ticks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'day' => 'day', + 'map' => 'map', + 'ms_latency' => 'msLatency', + 'pair' => 'pair', + 'ticks' => 'ticks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'day' => 'setDay', + 'map' => 'setMap', + 'ms_latency' => 'setMsLatency', + 'pair' => 'setPair', + 'ticks' => 'setTicks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'day' => 'getDay', + 'map' => 'getMap', + 'ms_latency' => 'getMsLatency', + 'pair' => 'getPair', + 'ticks' => 'getTicks' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('map', $data ?? [], null); + $this->setIfExists('ms_latency', $data ?? [], null); + $this->setIfExists('pair', $data ?? [], null); + $this->setIfExists('ticks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['map'] === null) { + $invalidProperties[] = "'map' can't be null"; + } + if ($this->container['ms_latency'] === null) { + $invalidProperties[] = "'ms_latency' can't be null"; + } + if ($this->container['pair'] === null) { + $invalidProperties[] = "'pair' can't be null"; + } + if ($this->container['ticks'] === null) { + $invalidProperties[] = "'ticks' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date that was evaluated from the request. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets map + * + * @return object + */ + public function getMap() + { + return $this->container['map']; + } + + /** + * Sets map + * + * @param object $map A map for shortened result keys. + * + * @return self + */ + public function setMap($map) + { + if (is_null($map)) { + throw new \InvalidArgumentException('non-nullable map cannot be null'); + } + $this->container['map'] = $map; + + return $this; + } + + /** + * Gets ms_latency + * + * @return int + */ + public function getMsLatency() + { + return $this->container['ms_latency']; + } + + /** + * Sets ms_latency + * + * @param int $ms_latency The milliseconds of latency for the query results. + * + * @return self + */ + public function setMsLatency($ms_latency) + { + if (is_null($ms_latency)) { + throw new \InvalidArgumentException('non-nullable ms_latency cannot be null'); + } + $this->container['ms_latency'] = $ms_latency; + + return $this; + } + + /** + * Gets pair + * + * @return string + */ + public function getPair() + { + return $this->container['pair']; + } + + /** + * Sets pair + * + * @param string $pair The currency pair that was evaluated from the request. + * + * @return self + */ + public function setPair($pair) + { + if (is_null($pair)) { + throw new \InvalidArgumentException('non-nullable pair cannot be null'); + } + $this->container['pair'] = $pair; + + return $this; + } + + /** + * Gets ticks + * + * @return \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getTicks() + { + return $this->container['ticks']; + } + + /** + * Sets ticks + * + * @param \OpenAPI\Client\Model\V1HistoricForexFromToDateGet200ResponseAllOfTicksInner[] $ticks ticks + * + * @return self + */ + public function setTicks($ticks) + { + if (is_null($ticks)) { + throw new \InvalidArgumentException('non-nullable ticks cannot be null'); + } + $this->container['ticks'] = $ticks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.php b/lib/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.php new file mode 100644 index 0000000..9ef363f --- /dev/null +++ b/lib/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInner.php @@ -0,0 +1,523 @@ + + */ +class V1HistoricForexFromToDateGet200ResponseAllOfTicksInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_historic_forex__from___to___date__get_200_response_allOf_ticks_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'a' => 'float', + 'b' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'a' => 'double', + 'b' => 'double', + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'a' => false, + 'b' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'a' => 'a', + 'b' => 'b', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'a' => 'setA', + 'b' => 'setB', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'a' => 'getA', + 'b' => 'getB', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('a', $data ?? [], null); + $this->setIfExists('b', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['a'] === null) { + $invalidProperties[] = "'a' can't be null"; + } + if ($this->container['b'] === null) { + $invalidProperties[] = "'b' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 a + * + * @return float + */ + public function getA() + { + return $this->container['a']; + } + + /** + * Sets a + * + * @param float $a The ask price. + * + * @return self + */ + public function setA($a) + { + if (is_null($a)) { + throw new \InvalidArgumentException('non-nullable a cannot be null'); + } + $this->container['a'] = $a; + + return $this; + } + + /** + * Gets b + * + * @return float + */ + public function getB() + { + return $this->container['b']; + } + + /** + * Sets b + * + * @param float $b The bid price. + * + * @return self + */ + public function setB($b) + { + if (is_null($b)) { + throw new \InvalidArgumentException('non-nullable b cannot be null'); + } + $this->container['b'] = $b; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1LastBase.php b/lib/Model/V1LastBase.php new file mode 100644 index 0000000..f286d2d --- /dev/null +++ b/lib/Model/V1LastBase.php @@ -0,0 +1,486 @@ + + */ +class V1LastBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V1LastBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'status' => 'string', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'status' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'status' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'status' => 'status', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'status' => 'setStatus', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'status' => 'getStatus', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1OpenCloseCryptoFromToDateGet200Response.php b/lib/Model/V1OpenCloseCryptoFromToDateGet200Response.php new file mode 100644 index 0000000..74e7fc2 --- /dev/null +++ b/lib/Model/V1OpenCloseCryptoFromToDateGet200Response.php @@ -0,0 +1,634 @@ + + */ +class V1OpenCloseCryptoFromToDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_open_close_crypto__from___to___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'close' => 'float', + 'closing_trades' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]', + 'day' => '\DateTime', + 'is_utc' => 'bool', + 'open' => 'float', + 'open_trades' => '\OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[]', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'close' => 'double', + 'closing_trades' => null, + 'day' => 'date', + 'is_utc' => null, + 'open' => 'double', + 'open_trades' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'close' => false, + 'closing_trades' => false, + 'day' => false, + 'is_utc' => false, + 'open' => false, + 'open_trades' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'close' => 'close', + 'closing_trades' => 'closingTrades', + 'day' => 'day', + 'is_utc' => 'isUTC', + 'open' => 'open', + 'open_trades' => 'openTrades', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'close' => 'setClose', + 'closing_trades' => 'setClosingTrades', + 'day' => 'setDay', + 'is_utc' => 'setIsUtc', + 'open' => 'setOpen', + 'open_trades' => 'setOpenTrades', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'close' => 'getClose', + 'closing_trades' => 'getClosingTrades', + 'day' => 'getDay', + 'is_utc' => 'getIsUtc', + 'open' => 'getOpen', + 'open_trades' => 'getOpenTrades', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('closing_trades', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('is_utc', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('open_trades', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['closing_trades'] === null) { + $invalidProperties[] = "'closing_trades' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['is_utc'] === null) { + $invalidProperties[] = "'is_utc' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['open_trades'] === null) { + $invalidProperties[] = "'open_trades' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close price for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets closing_trades + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getClosingTrades() + { + return $this->container['closing_trades']; + } + + /** + * Sets closing_trades + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $closing_trades closing_trades + * + * @return self + */ + public function setClosingTrades($closing_trades) + { + if (is_null($closing_trades)) { + throw new \InvalidArgumentException('non-nullable closing_trades cannot be null'); + } + $this->container['closing_trades'] = $closing_trades; + + return $this; + } + + /** + * Gets day + * + * @return \DateTime + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \DateTime $day The date requested. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets is_utc + * + * @return bool + */ + public function getIsUtc() + { + return $this->container['is_utc']; + } + + /** + * Sets is_utc + * + * @param bool $is_utc Whether or not the timestamps are in UTC timezone. + * + * @return self + */ + public function setIsUtc($is_utc) + { + if (is_null($is_utc)) { + throw new \InvalidArgumentException('non-nullable is_utc cannot be null'); + } + $this->container['is_utc'] = $is_utc; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets open_trades + * + * @return \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] + */ + public function getOpenTrades() + { + return $this->container['open_trades']; + } + + /** + * Sets open_trades + * + * @param \OpenAPI\Client\Model\V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInner[] $open_trades open_trades + * + * @return self + */ + public function setOpenTrades($open_trades) + { + if (is_null($open_trades)) { + throw new \InvalidArgumentException('non-nullable open_trades cannot be null'); + } + $this->container['open_trades'] = $open_trades; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The symbol pair that was evaluated from the request. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1OpenCloseIndicesTickerDateGet200Response.php b/lib/Model/V1OpenCloseIndicesTickerDateGet200Response.php new file mode 100644 index 0000000..cf055c4 --- /dev/null +++ b/lib/Model/V1OpenCloseIndicesTickerDateGet200Response.php @@ -0,0 +1,702 @@ + + */ +class V1OpenCloseIndicesTickerDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_open_close__indicesTicker___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after_hours' => 'float', + 'close' => 'float', + 'from' => '\DateTime', + 'high' => 'float', + 'low' => 'float', + 'open' => 'float', + 'pre_market' => 'int', + 'status' => 'string', + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => 'double', + 'close' => 'double', + 'from' => 'date', + 'high' => 'double', + 'low' => 'double', + 'open' => 'double', + 'pre_market' => null, + 'status' => null, + 'symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'close' => false, + 'from' => false, + 'high' => false, + 'low' => false, + 'open' => false, + 'pre_market' => false, + 'status' => false, + 'symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'close' => 'close', + 'from' => 'from', + 'high' => 'high', + 'low' => 'low', + 'open' => 'open', + 'pre_market' => 'preMarket', + 'status' => 'status', + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'close' => 'setClose', + 'from' => 'setFrom', + 'high' => 'setHigh', + 'low' => 'setLow', + 'open' => 'setOpen', + 'pre_market' => 'setPreMarket', + 'status' => 'setStatus', + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'close' => 'getClose', + 'from' => 'getFrom', + 'high' => 'getHigh', + 'low' => 'getLow', + 'open' => 'getOpen', + 'pre_market' => 'getPreMarket', + 'status' => 'getStatus', + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('pre_market', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + 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 after_hours + * + * @return float|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param float|null $after_hours The close value of the ticker symbol in after hours trading. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close value for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime $from The requested date. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest value for the symbol in the given time period. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest value for the symbol in the given time period. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open value for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets pre_market + * + * @return int|null + */ + public function getPreMarket() + { + return $this->container['pre_market']; + } + + /** + * Sets pre_market + * + * @param int|null $pre_market The open value of the ticker symbol in pre-market trading. + * + * @return self + */ + public function setPreMarket($pre_market) + { + if (is_null($pre_market)) { + throw new \InvalidArgumentException('non-nullable pre_market cannot be null'); + } + $this->container['pre_market'] = $pre_market; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V1OpenCloseOptionsTickerDateGet200Response.php b/lib/Model/V1OpenCloseOptionsTickerDateGet200Response.php new file mode 100644 index 0000000..922bbc4 --- /dev/null +++ b/lib/Model/V1OpenCloseOptionsTickerDateGet200Response.php @@ -0,0 +1,773 @@ + + */ +class V1OpenCloseOptionsTickerDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v1_open_close__optionsTicker___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after_hours' => 'float', + 'close' => 'float', + 'from' => '\DateTime', + 'high' => 'float', + 'low' => 'float', + 'open' => 'float', + 'otc' => 'bool', + 'pre_market' => 'int', + 'status' => 'string', + 'symbol' => 'string', + 'volume' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after_hours' => 'double', + 'close' => 'double', + 'from' => 'date', + 'high' => 'double', + 'low' => 'double', + 'open' => 'double', + 'otc' => null, + 'pre_market' => null, + 'status' => null, + 'symbol' => null, + 'volume' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after_hours' => false, + 'close' => false, + 'from' => false, + 'high' => false, + 'low' => false, + 'open' => false, + 'otc' => false, + 'pre_market' => false, + 'status' => false, + 'symbol' => false, + 'volume' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'after_hours' => 'afterHours', + 'close' => 'close', + 'from' => 'from', + 'high' => 'high', + 'low' => 'low', + 'open' => 'open', + 'otc' => 'otc', + 'pre_market' => 'preMarket', + 'status' => 'status', + 'symbol' => 'symbol', + 'volume' => 'volume' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after_hours' => 'setAfterHours', + 'close' => 'setClose', + 'from' => 'setFrom', + 'high' => 'setHigh', + 'low' => 'setLow', + 'open' => 'setOpen', + 'otc' => 'setOtc', + 'pre_market' => 'setPreMarket', + 'status' => 'setStatus', + 'symbol' => 'setSymbol', + 'volume' => 'setVolume' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after_hours' => 'getAfterHours', + 'close' => 'getClose', + 'from' => 'getFrom', + 'high' => 'getHigh', + 'low' => 'getLow', + 'open' => 'getOpen', + 'otc' => 'getOtc', + 'pre_market' => 'getPreMarket', + 'status' => 'getStatus', + 'symbol' => 'getSymbol', + 'volume' => 'getVolume' + ]; + + /** + * 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->setIfExists('after_hours', $data ?? [], null); + $this->setIfExists('close', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('high', $data ?? [], null); + $this->setIfExists('low', $data ?? [], null); + $this->setIfExists('open', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('pre_market', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['close'] === null) { + $invalidProperties[] = "'close' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['high'] === null) { + $invalidProperties[] = "'high' can't be null"; + } + if ($this->container['low'] === null) { + $invalidProperties[] = "'low' can't be null"; + } + if ($this->container['open'] === null) { + $invalidProperties[] = "'open' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['symbol'] === null) { + $invalidProperties[] = "'symbol' can't be null"; + } + if ($this->container['volume'] === null) { + $invalidProperties[] = "'volume' can't be null"; + } + 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 after_hours + * + * @return float|null + */ + public function getAfterHours() + { + return $this->container['after_hours']; + } + + /** + * Sets after_hours + * + * @param float|null $after_hours The close price of the ticker symbol in after hours trading. + * + * @return self + */ + public function setAfterHours($after_hours) + { + if (is_null($after_hours)) { + throw new \InvalidArgumentException('non-nullable after_hours cannot be null'); + } + $this->container['after_hours'] = $after_hours; + + return $this; + } + + /** + * Gets close + * + * @return float + */ + public function getClose() + { + return $this->container['close']; + } + + /** + * Sets close + * + * @param float $close The close price for the symbol in the given time period. + * + * @return self + */ + public function setClose($close) + { + if (is_null($close)) { + throw new \InvalidArgumentException('non-nullable close cannot be null'); + } + $this->container['close'] = $close; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime $from The requested date. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets high + * + * @return float + */ + public function getHigh() + { + return $this->container['high']; + } + + /** + * Sets high + * + * @param float $high The highest price for the symbol in the given time period. + * + * @return self + */ + public function setHigh($high) + { + if (is_null($high)) { + throw new \InvalidArgumentException('non-nullable high cannot be null'); + } + $this->container['high'] = $high; + + return $this; + } + + /** + * Gets low + * + * @return float + */ + public function getLow() + { + return $this->container['low']; + } + + /** + * Sets low + * + * @param float $low The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setLow($low) + { + if (is_null($low)) { + throw new \InvalidArgumentException('non-nullable low cannot be null'); + } + $this->container['low'] = $low; + + return $this; + } + + /** + * Gets open + * + * @return float + */ + public function getOpen() + { + return $this->container['open']; + } + + /** + * Sets open + * + * @param float $open The open price for the symbol in the given time period. + * + * @return self + */ + public function setOpen($open) + { + if (is_null($open)) { + throw new \InvalidArgumentException('non-nullable open cannot be null'); + } + $this->container['open'] = $open; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets pre_market + * + * @return int|null + */ + public function getPreMarket() + { + return $this->container['pre_market']; + } + + /** + * Sets pre_market + * + * @param int|null $pre_market The open price of the ticker symbol in pre-market trading. + * + * @return self + */ + public function setPreMarket($pre_market) + { + if (is_null($pre_market)) { + throw new \InvalidArgumentException('non-nullable pre_market cannot be null'); + } + $this->container['pre_market'] = $pre_market; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets symbol + * + * @return string + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string $symbol The exchange symbol that this item is traded under. + * + * @return self + */ + public function setSymbol($symbol) + { + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets volume + * + * @return float + */ + public function getVolume() + { + return $this->container['volume']; + } + + /** + * Sets volume + * + * @param float $volume The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setVolume($volume) + { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } + $this->container['volume'] = $volume; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsBase.php b/lib/Model/V2AggsBase.php new file mode 100644 index 0000000..2ef09db --- /dev/null +++ b/lib/Model/V2AggsBase.php @@ -0,0 +1,560 @@ + + */ +class V2AggsBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2AggsBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.php b/lib/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.php new file mode 100644 index 0000000..d803889 --- /dev/null +++ b/lib/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response.php @@ -0,0 +1,594 @@ + + */ +class V2AggsGroupedLocaleGlobalMarketCryptoDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_grouped_locale_global_market_crypto__date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.php b/lib/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..6457264 --- /dev/null +++ b/lib/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner.php @@ -0,0 +1,702 @@ + + */ +class V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_grouped_locale_global_market_crypto__date__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float|null + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float|null $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.php b/lib/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.php new file mode 100644 index 0000000..b857147 --- /dev/null +++ b/lib/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200Response.php @@ -0,0 +1,594 @@ + + */ +class V2AggsGroupedLocaleUsMarketStocksDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_grouped_locale_us_market_stocks__date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.php b/lib/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..a5b3e68 --- /dev/null +++ b/lib/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner.php @@ -0,0 +1,736 @@ + + */ +class V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_grouped_locale_us_market_stocks__date__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 'otc' => 'bool', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 'otc' => null, + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 'otc' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 'otc' => 'otc', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 'otc' => 'setOtc', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 'otc' => 'getOtc', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the end of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float|null + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float|null $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerCryptoTickerPrevGet200Response.php b/lib/Model/V2AggsTickerCryptoTickerPrevGet200Response.php new file mode 100644 index 0000000..e04fe1b --- /dev/null +++ b/lib/Model/V2AggsTickerCryptoTickerPrevGet200Response.php @@ -0,0 +1,631 @@ + + */ +class V2AggsTickerCryptoTickerPrevGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__cryptoTicker__prev_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string', + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null, + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false, + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker', + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker', + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker', + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.php b/lib/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.php new file mode 100644 index 0000000..f82a1f2 --- /dev/null +++ b/lib/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response.php @@ -0,0 +1,631 @@ + + */ +class V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__cryptoTicker__range__multiplier___timespan___from___to__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string', + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null, + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false, + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker', + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker', + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker', + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php b/lib/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..c7a2d2f --- /dev/null +++ b/lib/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php @@ -0,0 +1,665 @@ + + */ +class V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__cryptoTicker__range__multiplier___timespan___from___to__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float|null + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float|null $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerIndicesTickerPrevGet200Response.php b/lib/Model/V2AggsTickerIndicesTickerPrevGet200Response.php new file mode 100644 index 0000000..5be4dd1 --- /dev/null +++ b/lib/Model/V2AggsTickerIndicesTickerPrevGet200Response.php @@ -0,0 +1,594 @@ + + */ +class V2AggsTickerIndicesTickerPrevGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__indicesTicker__prev_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.php b/lib/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..a3fa3a8 --- /dev/null +++ b/lib/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner.php @@ -0,0 +1,560 @@ + + */ +class V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__indicesTicker__prev_get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 't' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 't' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 't' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 't' => 't' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 't' => 'setT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + '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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close value for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest value for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest value for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open value for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.php b/lib/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.php new file mode 100644 index 0000000..2eada8b --- /dev/null +++ b/lib/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response.php @@ -0,0 +1,665 @@ + + */ +class V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__stocksTicker__range__multiplier___timespan___from___to__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ticker' => 'string', + 'adjusted' => 'bool', + 'query_count' => 'int', + 'request_id' => 'string', + 'results_count' => 'int', + 'status' => 'string', + 'results' => '\OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]', + 'next_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ticker' => null, + 'adjusted' => null, + 'query_count' => null, + 'request_id' => null, + 'results_count' => null, + 'status' => null, + 'results' => null, + 'next_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ticker' => false, + 'adjusted' => false, + 'query_count' => false, + 'request_id' => false, + 'results_count' => false, + 'status' => false, + 'results' => false, + 'next_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ticker' => 'ticker', + 'adjusted' => 'adjusted', + 'query_count' => 'queryCount', + 'request_id' => 'request_id', + 'results_count' => 'resultsCount', + 'status' => 'status', + 'results' => 'results', + 'next_url' => 'next_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ticker' => 'setTicker', + 'adjusted' => 'setAdjusted', + 'query_count' => 'setQueryCount', + 'request_id' => 'setRequestId', + 'results_count' => 'setResultsCount', + 'status' => 'setStatus', + 'results' => 'setResults', + 'next_url' => 'setNextUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ticker' => 'getTicker', + 'adjusted' => 'getAdjusted', + 'query_count' => 'getQueryCount', + 'request_id' => 'getRequestId', + 'results_count' => 'getResultsCount', + 'status' => 'getStatus', + 'results' => 'getResults', + 'next_url' => 'getNextUrl' + ]; + + /** + * 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->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('adjusted', $data ?? [], null); + $this->setIfExists('query_count', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('next_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['adjusted'] === null) { + $invalidProperties[] = "'adjusted' can't be null"; + } + if ($this->container['query_count'] === null) { + $invalidProperties[] = "'query_count' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['results_count'] === null) { + $invalidProperties[] = "'results_count' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets adjusted + * + * @return bool + */ + public function getAdjusted() + { + return $this->container['adjusted']; + } + + /** + * Sets adjusted + * + * @param bool $adjusted Whether or not this response was adjusted for splits. + * + * @return self + */ + public function setAdjusted($adjusted) + { + if (is_null($adjusted)) { + throw new \InvalidArgumentException('non-nullable adjusted cannot be null'); + } + $this->container['adjusted'] = $adjusted; + + return $this; + } + + /** + * Gets query_count + * + * @return int + */ + public function getQueryCount() + { + return $this->container['query_count']; + } + + /** + * Sets query_count + * + * @param int $query_count The number of aggregates (minute or day) used to generate the response. + * + * @return self + */ + public function setQueryCount($query_count) + { + if (is_null($query_count)) { + throw new \InvalidArgumentException('non-nullable query_count cannot be null'); + } + $this->container['query_count'] = $query_count; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets results_count + * + * @return int + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets next_url + * + * @return string|null + */ + public function getNextUrl() + { + return $this->container['next_url']; + } + + /** + * Sets next_url + * + * @param string|null $next_url If present, this value can be used to fetch the next page of data. + * + * @return self + */ + public function setNextUrl($next_url) + { + if (is_null($next_url)) { + throw new \InvalidArgumentException('non-nullable next_url cannot be null'); + } + $this->container['next_url'] = $next_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php b/lib/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..90a2a3a --- /dev/null +++ b/lib/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner.php @@ -0,0 +1,699 @@ + + */ +class V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_aggs_ticker__stocksTicker__range__multiplier___timespan___from___to__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 'otc' => 'bool', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 'otc' => null, + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 'otc' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 'otc' => 'otc', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 'otc' => 'setOtc', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 'otc' => 'getOtc', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float|null + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float|null $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2LastBase.php b/lib/Model/V2LastBase.php new file mode 100644 index 0000000..0994b75 --- /dev/null +++ b/lib/Model/V2LastBase.php @@ -0,0 +1,449 @@ + + */ +class V2LastBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2LastBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'request_id', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.php new file mode 100644 index 0000000..7745f00 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response.php @@ -0,0 +1,409 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto__direction__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.php new file mode 100644 index 0000000..2af0647 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response.php @@ -0,0 +1,446 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.php new file mode 100644 index 0000000..4868729 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner.php @@ -0,0 +1,705 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response_allOf_tickers_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay', + 'fmv' => 'float', + 'last_trade' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade', + 'min' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin', + 'prev_day' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay', + 'ticker' => 'string', + 'todays_change' => 'float', + 'todays_change_perc' => 'float', + 'updated' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => null, + 'fmv' => 'double', + 'last_trade' => null, + 'min' => null, + 'prev_day' => null, + 'ticker' => null, + 'todays_change' => 'double', + 'todays_change_perc' => 'double', + 'updated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'fmv' => false, + 'last_trade' => false, + 'min' => false, + 'prev_day' => false, + 'ticker' => false, + 'todays_change' => false, + 'todays_change_perc' => false, + 'updated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'fmv' => 'fmv', + 'last_trade' => 'lastTrade', + 'min' => 'min', + 'prev_day' => 'prevDay', + 'ticker' => 'ticker', + 'todays_change' => 'todaysChange', + 'todays_change_perc' => 'todaysChangePerc', + 'updated' => 'updated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'fmv' => 'setFmv', + 'last_trade' => 'setLastTrade', + 'min' => 'setMin', + 'prev_day' => 'setPrevDay', + 'ticker' => 'setTicker', + 'todays_change' => 'setTodaysChange', + 'todays_change_perc' => 'setTodaysChangePerc', + 'updated' => 'setUpdated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'fmv' => 'getFmv', + 'last_trade' => 'getLastTrade', + 'min' => 'getMin', + 'prev_day' => 'getPrevDay', + 'ticker' => 'getTicker', + 'todays_change' => 'getTodaysChange', + 'todays_change_perc' => 'getTodaysChangePerc', + 'updated' => 'getUpdated' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('fmv', $data ?? [], null); + $this->setIfExists('last_trade', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('prev_day', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('todays_change', $data ?? [], null); + $this->setIfExists('todays_change_perc', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['last_trade'] === null) { + $invalidProperties[] = "'last_trade' can't be null"; + } + if ($this->container['min'] === null) { + $invalidProperties[] = "'min' can't be null"; + } + if ($this->container['prev_day'] === null) { + $invalidProperties[] = "'prev_day' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['todays_change'] === null) { + $invalidProperties[] = "'todays_change' can't be null"; + } + if ($this->container['todays_change_perc'] === null) { + $invalidProperties[] = "'todays_change_perc' can't be null"; + } + if ($this->container['updated'] === null) { + $invalidProperties[] = "'updated' can't be null"; + } + 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 day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay $day day + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets fmv + * + * @return float|null + */ + public function getFmv() + { + return $this->container['fmv']; + } + + /** + * Sets fmv + * + * @param float|null $fmv Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us. + * + * @return self + */ + public function setFmv($fmv) + { + if (is_null($fmv)) { + throw new \InvalidArgumentException('non-nullable fmv cannot be null'); + } + $this->container['fmv'] = $fmv; + + return $this; + } + + /** + * Gets last_trade + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade + */ + public function getLastTrade() + { + return $this->container['last_trade']; + } + + /** + * Sets last_trade + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade $last_trade last_trade + * + * @return self + */ + public function setLastTrade($last_trade) + { + if (is_null($last_trade)) { + throw new \InvalidArgumentException('non-nullable last_trade cannot be null'); + } + $this->container['last_trade'] = $last_trade; + + return $this; + } + + /** + * Gets min + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin $min min + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets prev_day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay + */ + public function getPrevDay() + { + return $this->container['prev_day']; + } + + /** + * Sets prev_day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay $prev_day prev_day + * + * @return self + */ + public function setPrevDay($prev_day) + { + if (is_null($prev_day)) { + throw new \InvalidArgumentException('non-nullable prev_day cannot be null'); + } + $this->container['prev_day'] = $prev_day; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets todays_change + * + * @return float + */ + public function getTodaysChange() + { + return $this->container['todays_change']; + } + + /** + * Sets todays_change + * + * @param float $todays_change The value of the change from the previous day. + * + * @return self + */ + public function setTodaysChange($todays_change) + { + if (is_null($todays_change)) { + throw new \InvalidArgumentException('non-nullable todays_change cannot be null'); + } + $this->container['todays_change'] = $todays_change; + + return $this; + } + + /** + * Gets todays_change_perc + * + * @return float + */ + public function getTodaysChangePerc() + { + return $this->container['todays_change_perc']; + } + + /** + * Sets todays_change_perc + * + * @param float $todays_change_perc The percentage change since the previous day. + * + * @return self + */ + public function setTodaysChangePerc($todays_change_perc) + { + if (is_null($todays_change_perc)) { + throw new \InvalidArgumentException('non-nullable todays_change_perc cannot be null'); + } + $this->container['todays_change_perc'] = $todays_change_perc; + + return $this; + } + + /** + * Gets updated + * + * @return int + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param int $updated The last updated timestamp. + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.php new file mode 100644 index 0000000..0ee9c8d --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay.php @@ -0,0 +1,598 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response_allOf_tickers_inner_day'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.php new file mode 100644 index 0000000..76b07aa --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade.php @@ -0,0 +1,597 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTrade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response_allOf_tickers_inner_lastTrade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'int[]', + 'i' => 'string', + 'p' => 'float', + 's' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => null, + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c The trade conditions. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return float + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float $s The size (volume) of the trade. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange that this crypto trade happened on. See Exchanges for a mapping of exchanges to IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.php new file mode 100644 index 0000000..d95cf35 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin.php @@ -0,0 +1,672 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response_allOf_tickers_inner_min'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.php new file mode 100644 index 0000000..4219773 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay.php @@ -0,0 +1,598 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers_get_200_response_allOf_tickers_inner_prevDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.php new file mode 100644 index 0000000..a732227 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response.php @@ -0,0 +1,409 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers__ticker__book_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 data + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.php new file mode 100644 index 0000000..a305ee8 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData.php @@ -0,0 +1,634 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers__ticker__book_get_200_response_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_count' => 'float', + 'asks' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[]', + 'bid_count' => 'float', + 'bids' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[]', + 'spread' => 'float', + 'ticker' => 'string', + 'updated' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_count' => 'double', + 'asks' => null, + 'bid_count' => 'double', + 'bids' => null, + 'spread' => 'double', + 'ticker' => null, + 'updated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ask_count' => false, + 'asks' => false, + 'bid_count' => false, + 'bids' => false, + 'spread' => false, + 'ticker' => false, + 'updated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_count' => 'askCount', + 'asks' => 'asks', + 'bid_count' => 'bidCount', + 'bids' => 'bids', + 'spread' => 'spread', + 'ticker' => 'ticker', + 'updated' => 'updated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_count' => 'setAskCount', + 'asks' => 'setAsks', + 'bid_count' => 'setBidCount', + 'bids' => 'setBids', + 'spread' => 'setSpread', + 'ticker' => 'setTicker', + 'updated' => 'setUpdated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_count' => 'getAskCount', + 'asks' => 'getAsks', + 'bid_count' => 'getBidCount', + 'bids' => 'getBids', + 'spread' => 'getSpread', + 'ticker' => 'getTicker', + 'updated' => 'getUpdated' + ]; + + /** + * 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->setIfExists('ask_count', $data ?? [], null); + $this->setIfExists('asks', $data ?? [], null); + $this->setIfExists('bid_count', $data ?? [], null); + $this->setIfExists('bids', $data ?? [], null); + $this->setIfExists('spread', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ask_count'] === null) { + $invalidProperties[] = "'ask_count' can't be null"; + } + if ($this->container['asks'] === null) { + $invalidProperties[] = "'asks' can't be null"; + } + if ($this->container['bid_count'] === null) { + $invalidProperties[] = "'bid_count' can't be null"; + } + if ($this->container['bids'] === null) { + $invalidProperties[] = "'bids' can't be null"; + } + if ($this->container['spread'] === null) { + $invalidProperties[] = "'spread' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['updated'] === null) { + $invalidProperties[] = "'updated' can't be null"; + } + 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 ask_count + * + * @return float + */ + public function getAskCount() + { + return $this->container['ask_count']; + } + + /** + * Sets ask_count + * + * @param float $ask_count The combined total number of asks in the book. + * + * @return self + */ + public function setAskCount($ask_count) + { + if (is_null($ask_count)) { + throw new \InvalidArgumentException('non-nullable ask_count cannot be null'); + } + $this->container['ask_count'] = $ask_count; + + return $this; + } + + /** + * Gets asks + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[] + */ + public function getAsks() + { + return $this->container['asks']; + } + + /** + * Sets asks + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[] $asks asks + * + * @return self + */ + public function setAsks($asks) + { + if (is_null($asks)) { + throw new \InvalidArgumentException('non-nullable asks cannot be null'); + } + $this->container['asks'] = $asks; + + return $this; + } + + /** + * Gets bid_count + * + * @return float + */ + public function getBidCount() + { + return $this->container['bid_count']; + } + + /** + * Sets bid_count + * + * @param float $bid_count The combined total number of bids in the book. + * + * @return self + */ + public function setBidCount($bid_count) + { + if (is_null($bid_count)) { + throw new \InvalidArgumentException('non-nullable bid_count cannot be null'); + } + $this->container['bid_count'] = $bid_count; + + return $this; + } + + /** + * Gets bids + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[] + */ + public function getBids() + { + return $this->container['bids']; + } + + /** + * Sets bids + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner[] $bids bids + * + * @return self + */ + public function setBids($bids) + { + if (is_null($bids)) { + throw new \InvalidArgumentException('non-nullable bids cannot be null'); + } + $this->container['bids'] = $bids; + + return $this; + } + + /** + * Gets spread + * + * @return float + */ + public function getSpread() + { + return $this->container['spread']; + } + + /** + * Sets spread + * + * @param float $spread The difference between the best bid and the best ask price across exchanges. + * + * @return self + */ + public function setSpread($spread) + { + if (is_null($spread)) { + throw new \InvalidArgumentException('non-nullable spread cannot be null'); + } + $this->container['spread'] = $spread; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets updated + * + * @return int + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param int $updated The last updated timestamp. + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.php new file mode 100644 index 0000000..595abff --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner.php @@ -0,0 +1,449 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers__ticker__book_get_200_response_allOf_data_asks_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'p' => 'float', + 'x' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'p' => 'double', + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'p' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'p' => 'p', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'p' => 'setP', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'p' => 'getP', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('p', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of this book level. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets x + * + * @return object + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param object $x A map of the exchange ID to number of shares at this price level.

**Example:**
`{ \"p\": 16302.94, \"x\": { \"1\": 0.02859424, \"6\": 0.023455 } }`

In this example, exchange ID 1 has 0.02859424 shares available at $16,302.94, and exchange ID 6 has 0.023455 shares at the same price level. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.php new file mode 100644 index 0000000..48c400c --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response.php @@ -0,0 +1,483 @@ + + */ +class V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_crypto_tickers__ticker__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'request_id' => 'string', + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'request_id' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'request_id' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'request_id' => 'request_id', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'request_id' => 'setRequestId', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'request_id' => 'getRequestId', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.php new file mode 100644 index 0000000..d2c4f9f --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200Response.php @@ -0,0 +1,446 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.php new file mode 100644 index 0000000..28f95a1 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner.php @@ -0,0 +1,705 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers_get_200_response_allOf_tickers_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay', + 'fmv' => 'float', + 'last_quote' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote', + 'min' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin', + 'prev_day' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay', + 'ticker' => 'string', + 'todays_change' => 'float', + 'todays_change_perc' => 'float', + 'updated' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => null, + 'fmv' => 'double', + 'last_quote' => null, + 'min' => null, + 'prev_day' => null, + 'ticker' => null, + 'todays_change' => 'double', + 'todays_change_perc' => 'double', + 'updated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'fmv' => false, + 'last_quote' => false, + 'min' => false, + 'prev_day' => false, + 'ticker' => false, + 'todays_change' => false, + 'todays_change_perc' => false, + 'updated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'fmv' => 'fmv', + 'last_quote' => 'lastQuote', + 'min' => 'min', + 'prev_day' => 'prevDay', + 'ticker' => 'ticker', + 'todays_change' => 'todaysChange', + 'todays_change_perc' => 'todaysChangePerc', + 'updated' => 'updated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'fmv' => 'setFmv', + 'last_quote' => 'setLastQuote', + 'min' => 'setMin', + 'prev_day' => 'setPrevDay', + 'ticker' => 'setTicker', + 'todays_change' => 'setTodaysChange', + 'todays_change_perc' => 'setTodaysChangePerc', + 'updated' => 'setUpdated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'fmv' => 'getFmv', + 'last_quote' => 'getLastQuote', + 'min' => 'getMin', + 'prev_day' => 'getPrevDay', + 'ticker' => 'getTicker', + 'todays_change' => 'getTodaysChange', + 'todays_change_perc' => 'getTodaysChangePerc', + 'updated' => 'getUpdated' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('fmv', $data ?? [], null); + $this->setIfExists('last_quote', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('prev_day', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('todays_change', $data ?? [], null); + $this->setIfExists('todays_change_perc', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['last_quote'] === null) { + $invalidProperties[] = "'last_quote' can't be null"; + } + if ($this->container['min'] === null) { + $invalidProperties[] = "'min' can't be null"; + } + if ($this->container['prev_day'] === null) { + $invalidProperties[] = "'prev_day' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['todays_change'] === null) { + $invalidProperties[] = "'todays_change' can't be null"; + } + if ($this->container['todays_change_perc'] === null) { + $invalidProperties[] = "'todays_change_perc' can't be null"; + } + if ($this->container['updated'] === null) { + $invalidProperties[] = "'updated' can't be null"; + } + 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 day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay $day day + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets fmv + * + * @return float|null + */ + public function getFmv() + { + return $this->container['fmv']; + } + + /** + * Sets fmv + * + * @param float|null $fmv Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us. + * + * @return self + */ + public function setFmv($fmv) + { + if (is_null($fmv)) { + throw new \InvalidArgumentException('non-nullable fmv cannot be null'); + } + $this->container['fmv'] = $fmv; + + return $this; + } + + /** + * Gets last_quote + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote + */ + public function getLastQuote() + { + return $this->container['last_quote']; + } + + /** + * Sets last_quote + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote $last_quote last_quote + * + * @return self + */ + public function setLastQuote($last_quote) + { + if (is_null($last_quote)) { + throw new \InvalidArgumentException('non-nullable last_quote cannot be null'); + } + $this->container['last_quote'] = $last_quote; + + return $this; + } + + /** + * Gets min + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin $min min + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets prev_day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay + */ + public function getPrevDay() + { + return $this->container['prev_day']; + } + + /** + * Sets prev_day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDay $prev_day prev_day + * + * @return self + */ + public function setPrevDay($prev_day) + { + if (is_null($prev_day)) { + throw new \InvalidArgumentException('non-nullable prev_day cannot be null'); + } + $this->container['prev_day'] = $prev_day; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets todays_change + * + * @return float + */ + public function getTodaysChange() + { + return $this->container['todays_change']; + } + + /** + * Sets todays_change + * + * @param float $todays_change The value of the change from the previous day. + * + * @return self + */ + public function setTodaysChange($todays_change) + { + if (is_null($todays_change)) { + throw new \InvalidArgumentException('non-nullable todays_change cannot be null'); + } + $this->container['todays_change'] = $todays_change; + + return $this; + } + + /** + * Gets todays_change_perc + * + * @return float + */ + public function getTodaysChangePerc() + { + return $this->container['todays_change_perc']; + } + + /** + * Sets todays_change_perc + * + * @param float $todays_change_perc The percentage change since the previous day. + * + * @return self + */ + public function setTodaysChangePerc($todays_change_perc) + { + if (is_null($todays_change_perc)) { + throw new \InvalidArgumentException('non-nullable todays_change_perc cannot be null'); + } + $this->container['todays_change_perc'] = $todays_change_perc; + + return $this; + } + + /** + * Gets updated + * + * @return int + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param int $updated The last updated timestamp. + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.php new file mode 100644 index 0000000..4e17910 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay.php @@ -0,0 +1,561 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers_get_200_response_allOf_tickers_inner_day'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'v' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'v' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'v' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'v' => 'v' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'v' => 'setV' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'v' => 'getV' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.php new file mode 100644 index 0000000..935c316 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote.php @@ -0,0 +1,524 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers_get_200_response_allOf_tickers_inner_lastQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'a' => 'float', + 'b' => 'float', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'a' => 'double', + 'b' => 'double', + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'a' => false, + 'b' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'a' => 'a', + 'b' => 'b', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'a' => 'setA', + 'b' => 'setB', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'a' => 'getA', + 'b' => 'getB', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('a', $data ?? [], null); + $this->setIfExists('b', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['a'] === null) { + $invalidProperties[] = "'a' can't be null"; + } + if ($this->container['b'] === null) { + $invalidProperties[] = "'b' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 a + * + * @return float + */ + public function getA() + { + return $this->container['a']; + } + + /** + * Sets a + * + * @param float $a The ask price. + * + * @return self + */ + public function setA($a) + { + if (is_null($a)) { + throw new \InvalidArgumentException('non-nullable a cannot be null'); + } + $this->container['a'] = $a; + + return $this; + } + + /** + * Gets b + * + * @return float + */ + public function getB() + { + return $this->container['b']; + } + + /** + * Sets b + * + * @param float $b The bid price. + * + * @return self + */ + public function setB($b) + { + if (is_null($b)) { + throw new \InvalidArgumentException('non-nullable b cannot be null'); + } + $this->container['b'] = $b; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The millisecond accuracy timestamp of the quote. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID on which this quote happened. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.php new file mode 100644 index 0000000..6dd72fc --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin.php @@ -0,0 +1,614 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers_get_200_response_allOf_tickers_inner_min'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 't' => 'int', + 'v' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 't' => null, + 'v' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 't' => false, + 'v' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 't' => 't', + 'v' => 'v' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 't' => 'setT', + 'v' => 'setV' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 't' => 'getT', + 'v' => 'getV' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 c + * + * @return float|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float|null $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float|null $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float|null + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float|null $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int|null $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float|null + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float|null $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets t + * + * @return int|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int|null $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float|null + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float|null $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.php b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.php new file mode 100644 index 0000000..abea86a --- /dev/null +++ b/lib/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response.php @@ -0,0 +1,483 @@ + + */ +class V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_global_markets_forex_tickers__ticker__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'request_id' => 'string', + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'request_id' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'request_id' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'request_id' => 'request_id', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'request_id' => 'setRequestId', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'request_id' => 'getRequestId', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.php new file mode 100644 index 0000000..790bb4a --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200Response.php @@ -0,0 +1,446 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksDirectionGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks__direction__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.php new file mode 100644 index 0000000..9fefd42 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200Response.php @@ -0,0 +1,480 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'status' => 'string', + 'tickers' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'status' => null, + 'tickers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'status' => false, + 'tickers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'status' => 'status', + 'tickers' => 'tickers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'status' => 'setStatus', + 'tickers' => 'setTickers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'status' => 'getStatus', + 'tickers' => 'getTickers' + ]; + + /** + * 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->setIfExists('count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tickers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + 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 count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The total number of results for this request. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tickers + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null + */ + public function getTickers() + { + return $this->container['tickers']; + } + + /** + * Sets tickers + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner[]|null $tickers tickers + * + * @return self + */ + public function setTickers($tickers) + { + if (is_null($tickers)) { + throw new \InvalidArgumentException('non-nullable tickers cannot be null'); + } + $this->container['tickers'] = $tickers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.php new file mode 100644 index 0000000..f03ea77 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner.php @@ -0,0 +1,715 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay', + 'fmv' => 'float', + 'last_quote' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote', + 'last_trade' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade', + 'min' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin', + 'prev_day' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay', + 'ticker' => 'string', + 'todays_change' => 'float', + 'todays_change_perc' => 'float', + 'updated' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => null, + 'fmv' => 'double', + 'last_quote' => null, + 'last_trade' => null, + 'min' => null, + 'prev_day' => null, + 'ticker' => null, + 'todays_change' => 'double', + 'todays_change_perc' => 'double', + 'updated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'fmv' => false, + 'last_quote' => false, + 'last_trade' => false, + 'min' => false, + 'prev_day' => false, + 'ticker' => false, + 'todays_change' => false, + 'todays_change_perc' => false, + 'updated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day' => 'day', + 'fmv' => 'fmv', + 'last_quote' => 'lastQuote', + 'last_trade' => 'lastTrade', + 'min' => 'min', + 'prev_day' => 'prevDay', + 'ticker' => 'ticker', + 'todays_change' => 'todaysChange', + 'todays_change_perc' => 'todaysChangePerc', + 'updated' => 'updated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'fmv' => 'setFmv', + 'last_quote' => 'setLastQuote', + 'last_trade' => 'setLastTrade', + 'min' => 'setMin', + 'prev_day' => 'setPrevDay', + 'ticker' => 'setTicker', + 'todays_change' => 'setTodaysChange', + 'todays_change_perc' => 'setTodaysChangePerc', + 'updated' => 'setUpdated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'fmv' => 'getFmv', + 'last_quote' => 'getLastQuote', + 'last_trade' => 'getLastTrade', + 'min' => 'getMin', + 'prev_day' => 'getPrevDay', + 'ticker' => 'getTicker', + 'todays_change' => 'getTodaysChange', + 'todays_change_perc' => 'getTodaysChangePerc', + 'updated' => 'getUpdated' + ]; + + /** + * 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->setIfExists('day', $data ?? [], null); + $this->setIfExists('fmv', $data ?? [], null); + $this->setIfExists('last_quote', $data ?? [], null); + $this->setIfExists('last_trade', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('prev_day', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('todays_change', $data ?? [], null); + $this->setIfExists('todays_change_perc', $data ?? [], null); + $this->setIfExists('updated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay|null + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay|null $day day + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets fmv + * + * @return float|null + */ + public function getFmv() + { + return $this->container['fmv']; + } + + /** + * Sets fmv + * + * @param float|null $fmv Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us. + * + * @return self + */ + public function setFmv($fmv) + { + if (is_null($fmv)) { + throw new \InvalidArgumentException('non-nullable fmv cannot be null'); + } + $this->container['fmv'] = $fmv; + + return $this; + } + + /** + * Gets last_quote + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote|null + */ + public function getLastQuote() + { + return $this->container['last_quote']; + } + + /** + * Sets last_quote + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote|null $last_quote last_quote + * + * @return self + */ + public function setLastQuote($last_quote) + { + if (is_null($last_quote)) { + throw new \InvalidArgumentException('non-nullable last_quote cannot be null'); + } + $this->container['last_quote'] = $last_quote; + + return $this; + } + + /** + * Gets last_trade + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade|null + */ + public function getLastTrade() + { + return $this->container['last_trade']; + } + + /** + * Sets last_trade + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade|null $last_trade last_trade + * + * @return self + */ + public function setLastTrade($last_trade) + { + if (is_null($last_trade)) { + throw new \InvalidArgumentException('non-nullable last_trade cannot be null'); + } + $this->container['last_trade'] = $last_trade; + + return $this; + } + + /** + * Gets min + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin|null $min min + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets prev_day + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay|null + */ + public function getPrevDay() + { + return $this->container['prev_day']; + } + + /** + * Sets prev_day + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay|null $prev_day prev_day + * + * @return self + */ + public function setPrevDay($prev_day) + { + if (is_null($prev_day)) { + throw new \InvalidArgumentException('non-nullable prev_day cannot be null'); + } + $this->container['prev_day'] = $prev_day; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets todays_change + * + * @return float|null + */ + public function getTodaysChange() + { + return $this->container['todays_change']; + } + + /** + * Sets todays_change + * + * @param float|null $todays_change The value of the change from the previous day. + * + * @return self + */ + public function setTodaysChange($todays_change) + { + if (is_null($todays_change)) { + throw new \InvalidArgumentException('non-nullable todays_change cannot be null'); + } + $this->container['todays_change'] = $todays_change; + + return $this; + } + + /** + * Gets todays_change_perc + * + * @return float|null + */ + public function getTodaysChangePerc() + { + return $this->container['todays_change_perc']; + } + + /** + * Sets todays_change_perc + * + * @param float|null $todays_change_perc The percentage change since the previous day. + * + * @return self + */ + public function setTodaysChangePerc($todays_change_perc) + { + if (is_null($todays_change_perc)) { + throw new \InvalidArgumentException('non-nullable todays_change_perc cannot be null'); + } + $this->container['todays_change_perc'] = $todays_change_perc; + + return $this; + } + + /** + * Gets updated + * + * @return int|null + */ + public function getUpdated() + { + return $this->container['updated']; + } + + /** + * Sets updated + * + * @param int|null $updated The last updated timestamp. + * + * @return self + */ + public function setUpdated($updated) + { + if (is_null($updated)) { + throw new \InvalidArgumentException('non-nullable updated cannot be null'); + } + $this->container['updated'] = $updated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.php new file mode 100644 index 0000000..c045be4 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay.php @@ -0,0 +1,632 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner_day'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'otc' => 'bool', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'otc' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'otc' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'otc' => 'otc', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'otc' => 'setOtc', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'otc' => 'getOtc', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.php new file mode 100644 index 0000000..fb25bb1 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote.php @@ -0,0 +1,561 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner_lastQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'p' => 'float', + 's' => 'int', + 'p' => 'float', + 's' => 'int', + 't' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'p' => 'double', + 's' => null, + 'p' => 'double', + 's' => null, + 't' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'p' => false, + 's' => false, + 'p' => false, + 's' => false, + 't' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'p' => 'P', + 's' => 'S', + 'p' => 'p', + 's' => 's', + 't' => 't' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'p' => 'setP', + 's' => 'setS', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'p' => 'getP', + 's' => 'getS', + 'p' => 'getP', + 's' => 'getS', + '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->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + 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 p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The ask price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The ask size in lots. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The bid price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The bid size in lots. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.php new file mode 100644 index 0000000..7db919d --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade.php @@ -0,0 +1,598 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTrade implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner_lastTrade'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'int[]', + 'i' => 'string', + 'p' => 'float', + 's' => 'int', + 't' => 'int', + 'x' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => null, + 't' => null, + 'x' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 't' => false, + 'x' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 't' => 't', + 'x' => 'x' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 't' => 'setT', + 'x' => 'setX' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 't' => 'getT', + 'x' => 'getX' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + 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 c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c The trade conditions. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The size (volume) of the trade. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.php new file mode 100644 index 0000000..4420a7d --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin.php @@ -0,0 +1,743 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner_min'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'av' => 'int', + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'n' => 'int', + 'o' => 'float', + 'otc' => 'bool', + 't' => 'int', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'av' => null, + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'n' => null, + 'o' => 'double', + 'otc' => null, + 't' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'av' => false, + 'c' => false, + 'h' => false, + 'l' => false, + 'n' => false, + 'o' => false, + 'otc' => false, + 't' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'av' => 'av', + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'n' => 'n', + 'o' => 'o', + 'otc' => 'otc', + 't' => 't', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'av' => 'setAv', + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'n' => 'setN', + 'o' => 'setO', + 'otc' => 'setOtc', + 't' => 'setT', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'av' => 'getAv', + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'n' => 'getN', + 'o' => 'getO', + 'otc' => 'getOtc', + 't' => 'getT', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('av', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['av'] === null) { + $invalidProperties[] = "'av' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['n'] === null) { + $invalidProperties[] = "'n' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 av + * + * @return int + */ + public function getAv() + { + return $this->container['av']; + } + + /** + * Sets av + * + * @param int $av The accumulated volume. + * + * @return self + */ + public function setAv($av) + { + if (is_null($av)) { + throw new \InvalidArgumentException('non-nullable av cannot be null'); + } + $this->container['av'] = $av; + + return $this; + } + + /** + * Gets c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets n + * + * @return int + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param int $n The number of transactions in the aggregate window. + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The Unix Msec timestamp for the start of the aggregate window. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.php new file mode 100644 index 0000000..a432623 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay.php @@ -0,0 +1,632 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers_get_200_response_allOf_tickers_inner_prevDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'c' => 'float', + 'h' => 'float', + 'l' => 'float', + 'o' => 'float', + 'otc' => 'bool', + 'v' => 'float', + 'vw' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'c' => 'double', + 'h' => 'double', + 'l' => 'double', + 'o' => 'double', + 'otc' => null, + 'v' => 'double', + 'vw' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'c' => false, + 'h' => false, + 'l' => false, + 'o' => false, + 'otc' => false, + 'v' => false, + 'vw' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'c' => 'c', + 'h' => 'h', + 'l' => 'l', + 'o' => 'o', + 'otc' => 'otc', + 'v' => 'v', + 'vw' => 'vw' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'c' => 'setC', + 'h' => 'setH', + 'l' => 'setL', + 'o' => 'setO', + 'otc' => 'setOtc', + 'v' => 'setV', + 'vw' => 'setVw' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'c' => 'getC', + 'h' => 'getH', + 'l' => 'getL', + 'o' => 'getO', + 'otc' => 'getOtc', + 'v' => 'getV', + 'vw' => 'getVw' + ]; + + /** + * 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->setIfExists('c', $data ?? [], null); + $this->setIfExists('h', $data ?? [], null); + $this->setIfExists('l', $data ?? [], null); + $this->setIfExists('o', $data ?? [], null); + $this->setIfExists('otc', $data ?? [], null); + $this->setIfExists('v', $data ?? [], null); + $this->setIfExists('vw', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['h'] === null) { + $invalidProperties[] = "'h' can't be null"; + } + if ($this->container['l'] === null) { + $invalidProperties[] = "'l' can't be null"; + } + if ($this->container['o'] === null) { + $invalidProperties[] = "'o' can't be null"; + } + if ($this->container['v'] === null) { + $invalidProperties[] = "'v' can't be null"; + } + if ($this->container['vw'] === null) { + $invalidProperties[] = "'vw' can't be null"; + } + 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 c + * + * @return float + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param float $c The close price for the symbol in the given time period. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets h + * + * @return float + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param float $h The highest price for the symbol in the given time period. + * + * @return self + */ + public function setH($h) + { + if (is_null($h)) { + throw new \InvalidArgumentException('non-nullable h cannot be null'); + } + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets l + * + * @return float + */ + public function getL() + { + return $this->container['l']; + } + + /** + * Sets l + * + * @param float $l The lowest price for the symbol in the given time period. + * + * @return self + */ + public function setL($l) + { + if (is_null($l)) { + throw new \InvalidArgumentException('non-nullable l cannot be null'); + } + $this->container['l'] = $l; + + return $this; + } + + /** + * Gets o + * + * @return float + */ + public function getO() + { + return $this->container['o']; + } + + /** + * Sets o + * + * @param float $o The open price for the symbol in the given time period. + * + * @return self + */ + public function setO($o) + { + if (is_null($o)) { + throw new \InvalidArgumentException('non-nullable o cannot be null'); + } + $this->container['o'] = $o; + + return $this; + } + + /** + * Gets otc + * + * @return bool|null + */ + public function getOtc() + { + return $this->container['otc']; + } + + /** + * Sets otc + * + * @param bool|null $otc Whether or not this aggregate is for an OTC ticker. This field will be left off if false. + * + * @return self + */ + public function setOtc($otc) + { + if (is_null($otc)) { + throw new \InvalidArgumentException('non-nullable otc cannot be null'); + } + $this->container['otc'] = $otc; + + return $this; + } + + /** + * Gets v + * + * @return float + */ + public function getV() + { + return $this->container['v']; + } + + /** + * Sets v + * + * @param float $v The trading volume of the symbol in the given time period. + * + * @return self + */ + public function setV($v) + { + if (is_null($v)) { + throw new \InvalidArgumentException('non-nullable v cannot be null'); + } + $this->container['v'] = $v; + + return $this; + } + + /** + * Gets vw + * + * @return float + */ + public function getVw() + { + return $this->container['vw']; + } + + /** + * Sets vw + * + * @param float $vw The volume weighted average price. + * + * @return self + */ + public function setVw($vw) + { + if (is_null($vw)) { + throw new \InvalidArgumentException('non-nullable vw cannot be null'); + } + $this->container['vw'] = $vw; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.php b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.php new file mode 100644 index 0000000..8161b46 --- /dev/null +++ b/lib/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response.php @@ -0,0 +1,483 @@ + + */ +class V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_snapshot_locale_us_markets_stocks_tickers__stocksTicker__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'request_id' => 'string', + 'ticker' => '\OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'request_id' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'request_id' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'request_id' => 'request_id', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'request_id' => 'setRequestId', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'request_id' => 'getRequestId', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of this request's response. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id A request id assigned by the server. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets ticker + * + * @return \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param \OpenAPI\Client\Model\V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInner|null $ticker ticker + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksBase.php b/lib/Model/V2TicksBase.php new file mode 100644 index 0000000..869af98 --- /dev/null +++ b/lib/Model/V2TicksBase.php @@ -0,0 +1,511 @@ + + */ +class V2TicksBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2TicksBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'db_latency' => 'int', + 'results_count' => 'int', + 'success' => 'bool', + 'ticker' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'db_latency' => null, + 'results_count' => null, + 'success' => null, + 'ticker' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'db_latency' => false, + 'results_count' => false, + 'success' => false, + 'ticker' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'db_latency' => 'db_latency', + 'results_count' => 'results_count', + 'success' => 'success', + 'ticker' => 'ticker' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'db_latency' => 'setDbLatency', + 'results_count' => 'setResultsCount', + 'success' => 'setSuccess', + 'ticker' => 'setTicker' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'db_latency' => 'getDbLatency', + 'results_count' => 'getResultsCount', + 'success' => 'getSuccess', + 'ticker' => 'getTicker' + ]; + + /** + * 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->setIfExists('db_latency', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 db_latency + * + * @return int|null + */ + public function getDbLatency() + { + return $this->container['db_latency']; + } + + /** + * Sets db_latency + * + * @param int|null $db_latency Latency in milliseconds for the query results from the database. + * + * @return self + */ + public function setDbLatency($db_latency) + { + if (is_null($db_latency)) { + throw new \InvalidArgumentException('non-nullable db_latency cannot be null'); + } + $this->container['db_latency'] = $db_latency; + + return $this; + } + + /** + * Gets results_count + * + * @return int|null + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int|null $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success Whether or not this query was executed successfully. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksStocksNbboTickerDateGet200Response.php b/lib/Model/V2TicksStocksNbboTickerDateGet200Response.php new file mode 100644 index 0000000..daf5f04 --- /dev/null +++ b/lib/Model/V2TicksStocksNbboTickerDateGet200Response.php @@ -0,0 +1,545 @@ + + */ +class V2TicksStocksNbboTickerDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_ticks_stocks_nbbo__ticker___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'db_latency' => 'int', + 'results_count' => 'int', + 'success' => 'bool', + 'ticker' => 'string', + 'results' => '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'db_latency' => null, + 'results_count' => null, + 'success' => null, + 'ticker' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'db_latency' => false, + 'results_count' => false, + 'success' => false, + 'ticker' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'db_latency' => 'db_latency', + 'results_count' => 'results_count', + 'success' => 'success', + 'ticker' => 'ticker', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'db_latency' => 'setDbLatency', + 'results_count' => 'setResultsCount', + 'success' => 'setSuccess', + 'ticker' => 'setTicker', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'db_latency' => 'getDbLatency', + 'results_count' => 'getResultsCount', + 'success' => 'getSuccess', + 'ticker' => 'getTicker', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('db_latency', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 db_latency + * + * @return int|null + */ + public function getDbLatency() + { + return $this->container['db_latency']; + } + + /** + * Sets db_latency + * + * @param int|null $db_latency Latency in milliseconds for the query results from the database. + * + * @return self + */ + public function setDbLatency($db_latency) + { + if (is_null($db_latency)) { + throw new \InvalidArgumentException('non-nullable db_latency cannot be null'); + } + $this->container['db_latency'] = $db_latency; + + return $this; + } + + /** + * Gets results_count + * + * @return int|null + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int|null $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success Whether or not this query was executed successfully. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.php b/lib/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..20de612 --- /dev/null +++ b/lib/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner.php @@ -0,0 +1,893 @@ + + */ +class V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_ticks_stocks_nbbo__ticker___date__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'f' => 'int', + 'q' => 'int', + 't' => 'int', + 'y' => 'int', + 'p' => 'float', + 's' => 'int', + 'x' => '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX', + 'c' => 'int[]', + 'i' => 'int[]', + 'p' => 'float', + 's' => 'int', + 'x' => '\OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'f' => null, + 'q' => 'int64', + 't' => null, + 'y' => null, + 'p' => 'double', + 's' => null, + 'x' => null, + 'c' => null, + 'i' => null, + 'p' => 'double', + 's' => null, + 'x' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'f' => false, + 'q' => false, + 't' => false, + 'y' => false, + 'p' => false, + 's' => false, + 'x' => false, + 'c' => false, + 'i' => false, + 'p' => false, + 's' => false, + 'x' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'f' => 'f', + 'q' => 'q', + 't' => 't', + 'y' => 'y', + 'p' => 'P', + 's' => 'S', + 'x' => 'X', + 'c' => 'c', + 'i' => 'i', + 'p' => 'p', + 's' => 's', + 'x' => 'x', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'f' => 'setF', + 'q' => 'setQ', + 't' => 'setT', + 'y' => 'setY', + 'p' => 'setP', + 's' => 'setS', + 'x' => 'setX', + 'c' => 'setC', + 'i' => 'setI', + 'p' => 'setP', + 's' => 'setS', + 'x' => 'setX', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'f' => 'getF', + 'q' => 'getQ', + 't' => 'getT', + 'y' => 'getY', + 'p' => 'getP', + 's' => 'getS', + 'x' => 'getX', + 'c' => 'getC', + 'i' => 'getI', + 'p' => 'getP', + 's' => 'getS', + 'x' => 'getX', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['f'] === null) { + $invalidProperties[] = "'f' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['z'] === null) { + $invalidProperties[] = "'z' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets f + * + * @return int + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The ask price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX $x x + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets i + * + * @return int[] + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param int[] $i The indicators. For more information, see our glossary of [Conditions and Indicators](https://polygon.io/glossary/us/stocks/conditions-indicators). + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The bid price. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets s + * + * @return int + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int $s The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price. + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param \OpenAPI\Client\Model\V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX $x x + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets z + * + * @return int + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.php b/lib/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.php new file mode 100644 index 0000000..ef34f53 --- /dev/null +++ b/lib/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX.php @@ -0,0 +1,381 @@ + + */ +class V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfX implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_ticks_stocks_nbbo__ticker___date__get_200_response_allOf_results_inner_allOf_x'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksStocksTradesTickerDateGet200Response.php b/lib/Model/V2TicksStocksTradesTickerDateGet200Response.php new file mode 100644 index 0000000..0981374 --- /dev/null +++ b/lib/Model/V2TicksStocksTradesTickerDateGet200Response.php @@ -0,0 +1,545 @@ + + */ +class V2TicksStocksTradesTickerDateGet200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_ticks_stocks_trades__ticker___date__get_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'db_latency' => 'int', + 'results_count' => 'int', + 'success' => 'bool', + 'ticker' => 'string', + 'results' => '\OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'db_latency' => null, + 'results_count' => null, + 'success' => null, + 'ticker' => null, + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'db_latency' => false, + 'results_count' => false, + 'success' => false, + 'ticker' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'db_latency' => 'db_latency', + 'results_count' => 'results_count', + 'success' => 'success', + 'ticker' => 'ticker', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'db_latency' => 'setDbLatency', + 'results_count' => 'setResultsCount', + 'success' => 'setSuccess', + 'ticker' => 'setTicker', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'db_latency' => 'getDbLatency', + 'results_count' => 'getResultsCount', + 'success' => 'getSuccess', + 'ticker' => 'getTicker', + 'results' => 'getResults' + ]; + + /** + * 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->setIfExists('db_latency', $data ?? [], null); + $this->setIfExists('results_count', $data ?? [], null); + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * 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 db_latency + * + * @return int|null + */ + public function getDbLatency() + { + return $this->container['db_latency']; + } + + /** + * Sets db_latency + * + * @param int|null $db_latency Latency in milliseconds for the query results from the database. + * + * @return self + */ + public function setDbLatency($db_latency) + { + if (is_null($db_latency)) { + throw new \InvalidArgumentException('non-nullable db_latency cannot be null'); + } + $this->container['db_latency'] = $db_latency; + + return $this; + } + + /** + * Gets results_count + * + * @return int|null + */ + public function getResultsCount() + { + return $this->container['results_count']; + } + + /** + * Sets results_count + * + * @param int|null $results_count The total number of results for this request. + * + * @return self + */ + public function setResultsCount($results_count) + { + if (is_null($results_count)) { + throw new \InvalidArgumentException('non-nullable results_count cannot be null'); + } + $this->container['results_count'] = $results_count; + + return $this; + } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success Whether or not this query was executed successfully. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets ticker + * + * @return string|null + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string|null $ticker The exchange symbol that this item is traded under. + * + * @return self + */ + public function setTicker($ticker) + { + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.php b/lib/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.php new file mode 100644 index 0000000..93340d0 --- /dev/null +++ b/lib/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner.php @@ -0,0 +1,856 @@ + + */ +class V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '_v2_ticks_stocks_trades__ticker___date__get_200_response_allOf_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 't' => 'string', + 'f' => 'int', + 'q' => 'int', + 't' => 'int', + 'y' => 'int', + 'c' => 'int[]', + 'e' => 'int', + 'i' => 'string', + 'p' => 'float', + 'r' => 'int', + 's' => 'float', + 'x' => 'int', + 'z' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 't' => null, + 'f' => null, + 'q' => 'int64', + 't' => null, + 'y' => null, + 'c' => null, + 'e' => null, + 'i' => null, + 'p' => 'double', + 'r' => null, + 's' => 'double', + 'x' => null, + 'z' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 't' => false, + 'f' => false, + 'q' => false, + 't' => false, + 'y' => false, + 'c' => false, + 'e' => false, + 'i' => false, + 'p' => false, + 'r' => false, + 's' => false, + 'x' => false, + 'z' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * 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 nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 't' => 'T', + 'f' => 'f', + 'q' => 'q', + 't' => 't', + 'y' => 'y', + 'c' => 'c', + 'e' => 'e', + 'i' => 'i', + 'p' => 'p', + 'r' => 'r', + 's' => 's', + 'x' => 'x', + 'z' => 'z' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 't' => 'setT', + 'f' => 'setF', + 'q' => 'setQ', + 't' => 'setT', + 'y' => 'setY', + 'c' => 'setC', + 'e' => 'setE', + 'i' => 'setI', + 'p' => 'setP', + 'r' => 'setR', + 's' => 'setS', + 'x' => 'setX', + 'z' => 'setZ' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 't' => 'getT', + 'f' => 'getF', + 'q' => 'getQ', + 't' => 'getT', + 'y' => 'getY', + 'c' => 'getC', + 'e' => 'getE', + 'i' => 'getI', + 'p' => 'getP', + 'r' => 'getR', + 's' => 'getS', + 'x' => 'getX', + 'z' => 'getZ' + ]; + + /** + * 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->setIfExists('t', $data ?? [], null); + $this->setIfExists('f', $data ?? [], null); + $this->setIfExists('q', $data ?? [], null); + $this->setIfExists('t', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('c', $data ?? [], null); + $this->setIfExists('e', $data ?? [], null); + $this->setIfExists('i', $data ?? [], null); + $this->setIfExists('p', $data ?? [], null); + $this->setIfExists('r', $data ?? [], null); + $this->setIfExists('s', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('z', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['f'] === null) { + $invalidProperties[] = "'f' can't be null"; + } + if ($this->container['q'] === null) { + $invalidProperties[] = "'q' can't be null"; + } + if ($this->container['t'] === null) { + $invalidProperties[] = "'t' can't be null"; + } + if ($this->container['y'] === null) { + $invalidProperties[] = "'y' can't be null"; + } + if ($this->container['c'] === null) { + $invalidProperties[] = "'c' can't be null"; + } + if ($this->container['e'] === null) { + $invalidProperties[] = "'e' can't be null"; + } + if ($this->container['i'] === null) { + $invalidProperties[] = "'i' can't be null"; + } + if ($this->container['p'] === null) { + $invalidProperties[] = "'p' can't be null"; + } + if ($this->container['r'] === null) { + $invalidProperties[] = "'r' can't be null"; + } + if ($this->container['s'] === null) { + $invalidProperties[] = "'s' can't be null"; + } + if ($this->container['x'] === null) { + $invalidProperties[] = "'x' can't be null"; + } + if ($this->container['z'] === null) { + $invalidProperties[] = "'z' can't be null"; + } + 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 t + * + * @return string + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param string $t The exchange symbol that this item is traded under. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets f + * + * @return int + */ + public function getF() + { + return $this->container['f']; + } + + /** + * Sets f + * + * @param int $f The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message. + * + * @return self + */ + public function setF($f) + { + if (is_null($f)) { + throw new \InvalidArgumentException('non-nullable f cannot be null'); + } + $this->container['f'] = $f; + + return $this; + } + + /** + * Gets q + * + * @return int + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * + * @param int $q The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). + * + * @return self + */ + public function setQ($q) + { + if (is_null($q)) { + throw new \InvalidArgumentException('non-nullable q cannot be null'); + } + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets t + * + * @return int + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int $t The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it. + * + * @return self + */ + public function setT($t) + { + if (is_null($t)) { + throw new \InvalidArgumentException('non-nullable t cannot be null'); + } + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets y + * + * @return int + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int $y The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets c + * + * @return int[] + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param int[] $c A list of condition codes. + * + * @return self + */ + public function setC($c) + { + if (is_null($c)) { + throw new \InvalidArgumentException('non-nullable c cannot be null'); + } + $this->container['c'] = $c; + + return $this; + } + + /** + * Gets e + * + * @return int + */ + public function getE() + { + return $this->container['e']; + } + + /** + * Sets e + * + * @param int $e The trade correction indicator. + * + * @return self + */ + public function setE($e) + { + if (is_null($e)) { + throw new \InvalidArgumentException('non-nullable e cannot be null'); + } + $this->container['e'] = $e; + + return $this; + } + + /** + * Gets i + * + * @return string + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param string $i The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID. + * + * @return self + */ + public function setI($i) + { + if (is_null($i)) { + throw new \InvalidArgumentException('non-nullable i cannot be null'); + } + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets p + * + * @return float + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * + * @param float $p The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00. + * + * @return self + */ + public function setP($p) + { + if (is_null($p)) { + throw new \InvalidArgumentException('non-nullable p cannot be null'); + } + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets r + * + * @return int + */ + public function getR() + { + return $this->container['r']; + } + + /** + * Sets r + * + * @param int $r The ID for the Trade Reporting Facility where the trade took place. + * + * @return self + */ + public function setR($r) + { + if (is_null($r)) { + throw new \InvalidArgumentException('non-nullable r cannot be null'); + } + $this->container['r'] = $r; + + return $this; + } + + /** + * Gets s + * + * @return float + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param float $s The size of a trade (also known as volume). + * + * @return self + */ + public function setS($s) + { + if (is_null($s)) { + throw new \InvalidArgumentException('non-nullable s cannot be null'); + } + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets x + * + * @return int + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param int $x The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets z + * + * @return int + */ + public function getZ() + { + return $this->container['z']; + } + + /** + * Sets z + * + * @param int $z There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C. * Tape A is NYSE listed securities * Tape B is NYSE ARCA / NYSE American * Tape C is NASDAQ + * + * @return self + */ + public function setZ($z) + { + if (is_null($z)) { + throw new \InvalidArgumentException('non-nullable z cannot be null'); + } + $this->container['z'] = $z; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + 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): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + 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. + */ + #[\ReturnTypeWillChange] + 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/ObjectSerializer.php b/lib/ObjectSerializer.php new file mode 100644 index 0000000..3afa350 --- /dev/null +++ b/lib/ObjectSerializer.php @@ -0,0 +1,567 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\OpenAPI\Client\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } +} diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index 50f56dc..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - ./tests - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..485899a --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/src/PolygonIO.php b/src/PolygonIO.php deleted file mode 100644 index aabdea0..0000000 --- a/src/PolygonIO.php +++ /dev/null @@ -1,60 +0,0 @@ -apiKey = $apiKey; - - $this->rest = new Rest($apiKey); - $this->websockets = new Websockets($apiKey); - } - - /** - * @return Rest - */ - public function rest(): Rest - { - return new Rest($this->apiKey); - } - - /** - * @return Websockets - */ - public function websockets(): Websockets - { - return new Websockets($this->apiKey); - } -} diff --git a/src/Rest/Common/Mappers.php b/src/Rest/Common/Mappers.php deleted file mode 100644 index e6bb6d4..0000000 --- a/src/Rest/Common/Mappers.php +++ /dev/null @@ -1,191 +0,0 @@ - 'c', - 'bidExchange' => 'bE', - 'askExchange' => 'aE', - 'askPrice' => 'aP', - 'buyPrice' => 'bP', - 'bidSize' => 'bS', - 'askSize' => 'aS', - 'timestamp' => 't', - ], $tick); - } - - /** - * @param $mapFields - * @param $snap - * - * @return mixed - */ - public static function map(array $mapFields, array $snap): array - { - foreach ($mapFields as $field => $responseField) { - $snap[$field] = isset($snap[$responseField]) ? $snap[$responseField] : null; - } - - return $snap; - } - - /** - * @param array $snap - * - * @return array|mixed - */ - public static function snapshotAggV2(array $snap): array - { - return self::map([ - 'tickerSymbol' => 'T', - 'volume' => 'v', - 'open' => 'o', - 'close' => 'c', - 'high' => 'h', - 'low' => 'l', - 'timestamp' => 't', - 'numberOfItems' => 'n', - ], $snap); - } - - /** - * @param array $item - * - * @return array - */ - public static function cryptoSnapshotBookItem(array $item): array - { - $mapperFields = [ - 'price' => 'p', - ]; - - return self::map($mapperFields, $item); - } - - /** - * @param array $snap - * - * @return array - */ - public static function snapshotTicker(array $snap): array - { - $snap['day'] = Mappers::snapshotAgg($snap['day']); - $snap['lastTrade'] = Mappers::tradeV1($snap['lastTrade']); - $snap['lastQuote'] = Mappers::snapshotQuote($snap['lastQuote']); - $snap['min'] = Mappers::snapshotAgg($snap['min']); - $snap['prevDay'] = Mappers::snapshotAgg($snap['prevDay']); - - return $snap; - } - - /** - * @param array $snap - * - * @return array - */ - public static function snapshotTickerV2(array $snap): array - { - $snap['day'] = Mappers::snapshotAgg($snap['day']); - $snap['lastQuote'] = Mappers::snapshotQuote($snap['lastQuote']); - $snap['min'] = Mappers::snapshotAgg($snap['min']); - $snap['prevDay'] = Mappers::snapshotAgg($snap['prevDay']); - - return $snap; - } - - /** - * @param array $snap - * - * @return array - */ - public static function snapshotAgg(array $snap): array - { - return self::map([ - 'close' => 'c', - 'high' => 'h', - 'low' => 'l', - 'open' => 'o', - 'volume' => 'v', - ], $snap); - } - - /** - * @param array $tick - * - * @return array - */ - public static function tradeV1(array $tick): array - { - return self::map([ - 'condition1' => 'c1', - 'condition2' => 'c2', - 'condition3' => 'c3', - 'condition4' => 'c4', - 'exchange' => 'e', - 'price' => 'p', - 'size' => 's', - 'timestamp' => 't', - ], $tick); - } - - /** - * @param array $q - * - * @return array - */ - public static function snapshotQuote(array $q): array - { - return self::map([ - 'bidPrice' => 'p', - 'bidSize' => 's', - 'askPrice' => 'P', - 'askSize' => 'S', - 'lastUpdateTimestamp' => 't', - ], $q); - } - - /** - * @param array $snap - * - * @return array - */ - public static function snapshotCryptoTicker(array $snap): array - { - $snap['day'] = Mappers::snapshotAgg($snap['day']); - $snap['lastTrade'] = Mappers::cryptoTick($snap['lastTrade']); - $snap['min'] = Mappers::snapshotAgg($snap['min']); - $snap['prevDay'] = Mappers::snapshotAgg($snap['prevDay']); - - return $snap; - } - - /** - * @param array $tick - * - * @return array - */ - public static function cryptoTick(array $tick): array - { - return self::map([ - 'price' => 'p', - 'size' => 's', - 'exchange' => 'x', - 'conditions' => 'c', - 'timestamp' => 't', - ], $tick); - } -} diff --git a/src/Rest/Crypto/Aggregates.php b/src/Rest/Crypto/Aggregates.php deleted file mode 100644 index 88420d2..0000000 --- a/src/Rest/Crypto/Aggregates.php +++ /dev/null @@ -1,48 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/range/' . $multiplier . '/' . $timespan . '/' . $from . '/' . $to, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Crypto/Crypto.php b/src/Rest/Crypto/Crypto.php deleted file mode 100644 index 9137c91..0000000 --- a/src/Rest/Crypto/Crypto.php +++ /dev/null @@ -1,189 +0,0 @@ -apiKey = $apiKey; - - $this->previousClose = new PreviousClose($apiKey); - $this->groupedDaily = new GroupedDaily($apiKey); - $this->aggregates = new Aggregates($apiKey); - $this->cryptoExchanges = new CryptoExchanges($apiKey); - $this->lastTradeForCryptoPair = new LastTradeForCryptoPair($apiKey); - $this->dailyOpenClose = new DailyOpenClose($apiKey); - $this->historicCryptoTrade = new HistoricCryptoTrade($apiKey); - $this->snapshotAllTickers = new SnapshotAllTickers($apiKey); - $this->snapshotGainersLosers = new SnapshotGainersLosers($apiKey); - $this->snapshotSingleTicker = new SnapshotSingleTicker($apiKey); - $this->snapshotSingleTickerFullBook = new SnapshotSingleTickerFullBook($apiKey); - } - - /** - * @return PreviousClose - */ - public function previousClose(): PreviousClose - { - return new PreviousClose($this->apiKey); - } - - /** - * @return GroupedDaily - */ - public function groupedDaily(): GroupedDaily - { - return new GroupedDaily($this->apiKey); - } - - /** - * @return Aggregates - */ - public function aggregates(): Aggregates - { - return new Aggregates($this->apiKey); - } - - /** - * @return CryptoExchanges - */ - public function cryptoExchanges(): CryptoExchanges - { - return new CryptoExchanges($this->apiKey); - } - - /** - * @return LastTradeForCryptoPair - */ - public function lastTradeForCryptoPair(): LastTradeForCryptoPair - { - return new LastTradeForCryptoPair($this->apiKey); - } - - /** - * @return DailyOpenClose - */ - public function dailyOpenClose(): DailyOpenClose - { - return new DailyOpenClose($this->apiKey); - } - - /** - * @return HistoricCryptoTrade - */ - public function historicCryptoTrade(): HistoricCryptoTrade - { - return new HistoricCryptoTrade($this->apiKey); - } - - /** - * @return SnapshotAllTickers - */ - public function snapshotAllTickers(): SnapshotAllTickers - { - return new SnapshotAllTickers($this->apiKey); - } - - /** - * @return SnapshotGainersLosers - */ - public function snapshotGainersLosers(): SnapshotGainersLosers - { - return new SnapshotGainersLosers($this->apiKey); - } - - /** - * @return SnapshotSingleTicker - */ - public function snapshotSingleTicker(): SnapshotSingleTicker - { - return new SnapshotSingleTicker($this->apiKey); - } - - /** - * @return SnapshotSingleTickerFullBook - */ - public function snapshotSingleTickerFullBook(): SnapshotSingleTickerFullBook - { - return new SnapshotSingleTickerFullBook($this->apiKey); - } -} diff --git a/src/Rest/Crypto/CryptoExchanges.php b/src/Rest/Crypto/CryptoExchanges.php deleted file mode 100644 index 04a236f..0000000 --- a/src/Rest/Crypto/CryptoExchanges.php +++ /dev/null @@ -1,24 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Crypto/DailyOpenClose.php b/src/Rest/Crypto/DailyOpenClose.php deleted file mode 100644 index 1f040a7..0000000 --- a/src/Rest/Crypto/DailyOpenClose.php +++ /dev/null @@ -1,51 +0,0 @@ -_get('/v1/open-close/crypto/' . $from . '/' . $to . '/' . $date); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - if (array_key_exists('openTrades', $response)) { - $response['openTrades'] = array_map(function($ticker) { - return Mappers::cryptoTick($ticker); - }, $response['openTrades']); - } - - if (array_key_exists('closingTrades', $response)) { - $response['closingTrades'] = array_map(function ($ticker) { - return Mappers::cryptoTick($ticker); - }, $response['closingTrades']); - } - - return $response; - } -} diff --git a/src/Rest/Crypto/GroupedDaily.php b/src/Rest/Crypto/GroupedDaily.php deleted file mode 100644 index fbac929..0000000 --- a/src/Rest/Crypto/GroupedDaily.php +++ /dev/null @@ -1,45 +0,0 @@ -_get('/v2/aggs/grouped/locale/global/market/crypto/' . $date, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Crypto/HistoricCryptoTrade.php b/src/Rest/Crypto/HistoricCryptoTrade.php deleted file mode 100644 index 65db575..0000000 --- a/src/Rest/Crypto/HistoricCryptoTrade.php +++ /dev/null @@ -1,50 +0,0 @@ - 100, - ]; - - /** - * @param $from - * @param $to - * @param $date - * @param array $params - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($from, $to, $date, $params = []): array - { - return $this->_get('/v1/historic/crypto/' . $from . '/' . $to . '/' . $date, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['ticks'] = array_map( - function ($tick) { - return Mappers::cryptoTick($tick); - }, - $response['ticks'] - ); - return $response; - } -} diff --git a/src/Rest/Crypto/LastTradeForCryptoPair.php b/src/Rest/Crypto/LastTradeForCryptoPair.php deleted file mode 100644 index fdee48b..0000000 --- a/src/Rest/Crypto/LastTradeForCryptoPair.php +++ /dev/null @@ -1,21 +0,0 @@ -_get('/v1/last/crypto/' . $from . '/' . $to); - } -} diff --git a/src/Rest/Crypto/PreviousClose.php b/src/Rest/Crypto/PreviousClose.php deleted file mode 100644 index cc6defb..0000000 --- a/src/Rest/Crypto/PreviousClose.php +++ /dev/null @@ -1,45 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/prev', $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Crypto/SnapshotAllTickers.php b/src/Rest/Crypto/SnapshotAllTickers.php deleted file mode 100644 index e1c84e9..0000000 --- a/src/Rest/Crypto/SnapshotAllTickers.php +++ /dev/null @@ -1,42 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/crypto/tickers'); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotCryptoTicker($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Crypto/SnapshotGainersLosers.php b/src/Rest/Crypto/SnapshotGainersLosers.php deleted file mode 100644 index c3d4726..0000000 --- a/src/Rest/Crypto/SnapshotGainersLosers.php +++ /dev/null @@ -1,44 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/crypto/' . $direction); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotCryptoTicker($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Crypto/SnapshotSingleTicker.php b/src/Rest/Crypto/SnapshotSingleTicker.php deleted file mode 100644 index b12be33..0000000 --- a/src/Rest/Crypto/SnapshotSingleTicker.php +++ /dev/null @@ -1,39 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/crypto/tickers/' . $tickerSymbol); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['ticker'] = Mappers::snapshotCryptoTicker($response['ticker']); - - return $response; - } -} diff --git a/src/Rest/Crypto/SnapshotSingleTickerFullBook.php b/src/Rest/Crypto/SnapshotSingleTickerFullBook.php deleted file mode 100644 index df40652..0000000 --- a/src/Rest/Crypto/SnapshotSingleTickerFullBook.php +++ /dev/null @@ -1,49 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/crypto/tickers/' . $tickerSymbol . '/book'); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - if (array_key_exists('asks', $response['data'])) { - $response['data']['asks'] = array_map( - function ($ask) { - return Mappers::cryptoSnapshotBookItem($ask); - }, - $response['data']['asks'] - ); - } - - if (array_key_exists('bids', $response['data'])) { - $response['data']['bids'] = array_map( - function ($bid) { - return Mappers::cryptoSnapshotBookItem($bid); - }, - $response['data']['bids'] - ); - } - - return $response; - } -} diff --git a/src/Rest/Forex/Aggregates.php b/src/Rest/Forex/Aggregates.php deleted file mode 100644 index c574f13..0000000 --- a/src/Rest/Forex/Aggregates.php +++ /dev/null @@ -1,48 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/range/' . $multiplier . '/' . $timespan . '/' . $from . '/' . $to, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Forex/Forex.php b/src/Rest/Forex/Forex.php deleted file mode 100644 index 5415182..0000000 --- a/src/Rest/Forex/Forex.php +++ /dev/null @@ -1,139 +0,0 @@ -apiKey = $apiKey; - - $this->groupedDaily = new GroupedDaily($apiKey); - $this->aggregates = new Aggregates($apiKey); - $this->previousClose = new PreviousClose($apiKey); - $this->historicForexTick = new HistoricForexTick($apiKey); - $this->realTimeCurrencyConversion = new RealTimeCurrencyConversion($apiKey); - $this->lastQuoteForCurrencyPair = new LastQuoteForCurrencyPair($apiKey); - $this->snapshotAllTickers = new SnapshotAllTickers($apiKey); - $this->snapshotGainersLosers = new SnapshotGainersLosers($apiKey); - } - - /** - * @return GroupedDaily - */ - public function groupedDaily(): GroupedDaily - { - return new GroupedDaily($this->apiKey); - } - - /** - * @return Aggregates - */ - public function aggregates(): Aggregates - { - return new Aggregates($this->apiKey); - } - - /** - * @return PreviousClose - */ - public function previousClose(): PreviousClose - { - return new PreviousClose($this->apiKey); - } - - /** - * @return HistoricForexTick - */ - public function historicForexTick(): HistoricForexTick - { - return new HistoricForexTick($this->apiKey); - } - - /** - * @return RealTimeCurrencyConversion - */ - public function realTimeCurrencyConversion(): RealTimeCurrencyConversion - { - return new RealTimeCurrencyConversion($this->apiKey); - } - - /** - * @return LastQuoteForCurrencyPair - */ - public function lastQuoteForCurrencyPair(): LastQuoteForCurrencyPair - { - return new LastQuoteForCurrencyPair($this->apiKey); - } - - /** - * @return SnapshotAllTickers - */ - public function snapshotAllTickers(): SnapshotAllTickers - { - return new SnapshotAllTickers($this->apiKey); - } - - /** - * @return SnapshotGainersLosers - */ - public function snapshotGainersLosers(): SnapshotGainersLosers - { - return new SnapshotGainersLosers($this->apiKey); - } -} diff --git a/src/Rest/Forex/GroupedDaily.php b/src/Rest/Forex/GroupedDaily.php deleted file mode 100644 index f6918ce..0000000 --- a/src/Rest/Forex/GroupedDaily.php +++ /dev/null @@ -1,47 +0,0 @@ -_get('/v2/aggs/grouped/locale/' . $locale . '/market/' . $market . '/' . $date, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Forex/HistoricForexTick.php b/src/Rest/Forex/HistoricForexTick.php deleted file mode 100644 index 894d472..0000000 --- a/src/Rest/Forex/HistoricForexTick.php +++ /dev/null @@ -1,32 +0,0 @@ - 100, - ]; - - /** - * @param $from - * @param $to - * @param $date - * @param array $params - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($from, $to, $date, $params = []): array - { - return $this->_get('/v1/historic/forex/' . $from . '/' . $to . '/' . $date, $params); - } -} diff --git a/src/Rest/Forex/LastQuoteForCurrencyPair.php b/src/Rest/Forex/LastQuoteForCurrencyPair.php deleted file mode 100644 index edb7391..0000000 --- a/src/Rest/Forex/LastQuoteForCurrencyPair.php +++ /dev/null @@ -1,26 +0,0 @@ -_get('/v1/last_quote/currencies/' . $from . '/' . $to); - } -} diff --git a/src/Rest/Forex/PreviousClose.php b/src/Rest/Forex/PreviousClose.php deleted file mode 100644 index 4dd2dfa..0000000 --- a/src/Rest/Forex/PreviousClose.php +++ /dev/null @@ -1,45 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/prev', $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Forex/RealTimeCurrencyConversion.php b/src/Rest/Forex/RealTimeCurrencyConversion.php deleted file mode 100644 index 8a31eb5..0000000 --- a/src/Rest/Forex/RealTimeCurrencyConversion.php +++ /dev/null @@ -1,32 +0,0 @@ - 100, - 'precision' => 2, - ]; - - /** - * @param $from - * @param $to - * @param array $params - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($from, $to, $params = []): array - { - return $this->_get('/v1/conversion/' . $from . '/' . $to, $params); - } -} diff --git a/src/Rest/Forex/SnapshotAllTickers.php b/src/Rest/Forex/SnapshotAllTickers.php deleted file mode 100644 index 434be79..0000000 --- a/src/Rest/Forex/SnapshotAllTickers.php +++ /dev/null @@ -1,41 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/forex/tickers'); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotTickerV2($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Forex/SnapshotGainersLosers.php b/src/Rest/Forex/SnapshotGainersLosers.php deleted file mode 100644 index 8eca3e9..0000000 --- a/src/Rest/Forex/SnapshotGainersLosers.php +++ /dev/null @@ -1,43 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/forex/' . $direction); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotTickerV2($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Forex/SnapshotTickerV2.php b/src/Rest/Forex/SnapshotTickerV2.php deleted file mode 100644 index ff2c585..0000000 --- a/src/Rest/Forex/SnapshotTickerV2.php +++ /dev/null @@ -1,25 +0,0 @@ -_get('/v2/snapshot/locale/global/markets/forex/tickers/' . $tickerSymbol); - } -} diff --git a/src/Rest/Options/Contract.php b/src/Rest/Options/Contract.php deleted file mode 100644 index 8478f79..0000000 --- a/src/Rest/Options/Contract.php +++ /dev/null @@ -1,13 +0,0 @@ -_get('/v3/reference/options/contracts/' . $optionsTicker, $params); - } -} diff --git a/src/Rest/Options/Contracts.php b/src/Rest/Options/Contracts.php deleted file mode 100644 index 72828e0..0000000 --- a/src/Rest/Options/Contracts.php +++ /dev/null @@ -1,13 +0,0 @@ -_get('/v3/reference/options/contracts', $params); - } -} diff --git a/src/Rest/Reference/Locales.php b/src/Rest/Reference/Locales.php deleted file mode 100644 index e325545..0000000 --- a/src/Rest/Reference/Locales.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Reference/MarketHolidays.php b/src/Rest/Reference/MarketHolidays.php deleted file mode 100644 index 71e3abe..0000000 --- a/src/Rest/Reference/MarketHolidays.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Reference/MarketStatus.php b/src/Rest/Reference/MarketStatus.php deleted file mode 100644 index 4ea1861..0000000 --- a/src/Rest/Reference/MarketStatus.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Reference/Markets.php b/src/Rest/Reference/Markets.php deleted file mode 100644 index 75e9a4a..0000000 --- a/src/Rest/Reference/Markets.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Reference/Reference.php b/src/Rest/Reference/Reference.php deleted file mode 100644 index 70dba61..0000000 --- a/src/Rest/Reference/Reference.php +++ /dev/null @@ -1,192 +0,0 @@ -apiKey = $apiKey; - - $this->tickers = new Tickers($apiKey); - $this->tickerTypes = new TickerTypes($apiKey); - $this->tickerDetails = new TickerDetails($apiKey); - $this->tickerNews = new TickerNews($apiKey); - $this->markets = new Markets($apiKey); - $this->locales = new Locales($apiKey); - $this->stockSplits = new StockSplits($apiKey); - $this->stockDividends = new StockDividends($apiKey); - $this->stockFinancials = new StockFinancials($apiKey); - $this->marketStatus = new MarketStatus($apiKey); - $this->marketHolidays = new MarketHolidays($apiKey); - } - - /** - * @return Tickers - */ - public function tickers(): Tickers - { - return new Tickers($this->apiKey); - } - - /** - * @return TickerTypes - */ - public function tickerTypes(): TickerTypes - { - return new TickerTypes($this->apiKey); - } - - /** - * @return TickerDetails - */ - public function tickerDetails(): TickerDetails - { - return new TickerDetails($this->apiKey); - } - - /** - * @return TickerNews - */ - public function tickerNews(): TickerNews - { - return new TickerNews($this->apiKey); - } - - /** - * @return Markets - */ - public function markets(): Markets - { - return new Markets($this->apiKey); - } - - /** - * @return Locales - */ - public function locales(): Locales - { - return new Locales($this->apiKey); - } - - /** - * @return StockSplits - */ - public function stockSplits(): StockSplits - { - return new StockSplits($this->apiKey); - } - - /** - * @return StockDividends - */ - public function stockDividends(): StockDividends - { - return new StockDividends($this->apiKey); - } - - /** - * @return StockFinancials - */ - public function stockFinancials(): StockFinancials - { - return new StockFinancials($this->apiKey); - } - - /** - * @return MarketStatus - */ - public function marketStatus(): MarketStatus - { - return new MarketStatus($this->apiKey); - } - - /** - * @return MarketHolidays - */ - public function marketHolidays(): MarketHolidays - { - return new MarketHolidays($this->apiKey); - } -} diff --git a/src/Rest/Reference/StockDividends.php b/src/Rest/Reference/StockDividends.php deleted file mode 100644 index 60c7b71..0000000 --- a/src/Rest/Reference/StockDividends.php +++ /dev/null @@ -1,25 +0,0 @@ -_get('/v2/reference/dividends/' . $tickerSymbol); - } -} diff --git a/src/Rest/Reference/StockFinancials.php b/src/Rest/Reference/StockFinancials.php deleted file mode 100644 index 7c16c20..0000000 --- a/src/Rest/Reference/StockFinancials.php +++ /dev/null @@ -1,30 +0,0 @@ - 5, - ]; - - /** - * @param $tickerSymbol - * @param $params - * - * @return mixed - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get(string $tickerSymbol, array $params = []) - { - return $this->_get('/v2/reference/financials/' . $tickerSymbol, $params); - } -} diff --git a/src/Rest/Reference/StockSplits.php b/src/Rest/Reference/StockSplits.php deleted file mode 100644 index bcb260b..0000000 --- a/src/Rest/Reference/StockSplits.php +++ /dev/null @@ -1,25 +0,0 @@ -_get('/v2/reference/splits/' . $tickerSymbol); - } -} diff --git a/src/Rest/Reference/TickerDetails.php b/src/Rest/Reference/TickerDetails.php deleted file mode 100644 index a05acc3..0000000 --- a/src/Rest/Reference/TickerDetails.php +++ /dev/null @@ -1,42 +0,0 @@ -_get('/v1/meta/symbols/' . $tickerSymbol . '/company'); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $mapperFields = [ - 'legalEntityIdentifier' => 'lei', - 'standardIndustryClassification' => 'sic', - ]; - - return Mappers::map($mapperFields, $response); - } -} diff --git a/src/Rest/Reference/TickerNews.php b/src/Rest/Reference/TickerNews.php deleted file mode 100644 index 218bab6..0000000 --- a/src/Rest/Reference/TickerNews.php +++ /dev/null @@ -1,32 +0,0 @@ - 50, - 'page' => 1, - ]; - - /** - * @param $tickerSymbol - * @param array $params - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get(string $tickerSymbol, array $params = []): array - { - return $this->_get('/v1/meta/symbols/' . $tickerSymbol . '/news', $params); - } -} diff --git a/src/Rest/Reference/TickerTypes.php b/src/Rest/Reference/TickerTypes.php deleted file mode 100644 index 3421e9d..0000000 --- a/src/Rest/Reference/TickerTypes.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Reference/Tickers.php b/src/Rest/Reference/Tickers.php deleted file mode 100644 index 80dcb7a..0000000 --- a/src/Rest/Reference/Tickers.php +++ /dev/null @@ -1,33 +0,0 @@ - 'ticker', - 'perPage' => 50, - 'page' => 1, - ]; - - /** - * @param $params - * - * @return mixed - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get(array $params = []) - { - return $this->_get($this->route, $params); - } -} diff --git a/src/Rest/Rest.php b/src/Rest/Rest.php deleted file mode 100644 index 0d875b4..0000000 --- a/src/Rest/Rest.php +++ /dev/null @@ -1,89 +0,0 @@ -apiKey = $apiKey; - - $this->reference = new Reference($apiKey); - $this->stocks = new Stocks($apiKey); - $this->forex = new Forex($apiKey); - $this->crypto = new Crypto($apiKey); - } - - /** - * @return Reference - */ - public function reference(): Reference - { - return new Reference($this->apiKey); - } - - /** - * @return Stocks - */ - public function stocks(): Stocks - { - return new Stocks($this->apiKey); - } - - /** - * @return Forex - */ - public function forex(): Forex - { - return new Forex($this->apiKey); - } - - /** - * @return Crypto - */ - public function crypto(): Crypto - { - return new Crypto($this->apiKey); - } -} diff --git a/src/Rest/RestResource.php b/src/Rest/RestResource.php deleted file mode 100644 index 8cfc2eb..0000000 --- a/src/Rest/RestResource.php +++ /dev/null @@ -1,91 +0,0 @@ -apiKey = $apiKey; - $this->httpClient = $httpClient ? $httpClient : new \GuzzleHttp\Client(); - } - - /** - * @return ClientInterface - */ - public function getHttpClient(): ClientInterface - { - return $this->httpClient; - } - - /** - * @param ClientInterface $httpClient - */ - public function setHttpClient(ClientInterface $httpClient): void - { - $this->httpClient = $httpClient; - } - - /** - * @param string $route - * @param array $params - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - protected function _get(string $route, $params = []): array - { - $enhancedParams = array_merge( - [ - 'apiKey' => $this->apiKey, - ], - array_merge( - $this->defaultParams, - $params - ) - ); - - $route = $this->API_URL . $route; - $response = $this->httpClient->get( - $route, - [ - 'query' => $enhancedParams - ] - ); - - $bodyString = $response->getBody()->getContents(); - $json = json_decode($bodyString, true); - - return $this->mapper($json); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - return $response; - } -} diff --git a/src/Rest/Stocks/Aggregates.php b/src/Rest/Stocks/Aggregates.php deleted file mode 100644 index 2d4866c..0000000 --- a/src/Rest/Stocks/Aggregates.php +++ /dev/null @@ -1,49 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/range/' . $multiplier . '/' . $timespan . '/' . $from . '/' . $to, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/ConditionMappings.php b/src/Rest/Stocks/ConditionMappings.php deleted file mode 100644 index 34fb612..0000000 --- a/src/Rest/Stocks/ConditionMappings.php +++ /dev/null @@ -1,24 +0,0 @@ -_get('/v1/meta/conditions/' . $tickTypes); - } -} diff --git a/src/Rest/Stocks/DailyOpenClose.php b/src/Rest/Stocks/DailyOpenClose.php deleted file mode 100644 index 0478868..0000000 --- a/src/Rest/Stocks/DailyOpenClose.php +++ /dev/null @@ -1,26 +0,0 @@ -_get('/v1/open-close/' . $tickerSymbol . '/' . $date); - } -} diff --git a/src/Rest/Stocks/Exchanges.php b/src/Rest/Stocks/Exchanges.php deleted file mode 100644 index 9705449..0000000 --- a/src/Rest/Stocks/Exchanges.php +++ /dev/null @@ -1,25 +0,0 @@ -_get($this->route); - } -} diff --git a/src/Rest/Stocks/GroupedDaily.php b/src/Rest/Stocks/GroupedDaily.php deleted file mode 100644 index 0633228..0000000 --- a/src/Rest/Stocks/GroupedDaily.php +++ /dev/null @@ -1,47 +0,0 @@ -_get('/v2/aggs/grouped/locale/' . $locale . '/market/' . $market . '/' . $date, $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/HistoricQuotes.php b/src/Rest/Stocks/HistoricQuotes.php deleted file mode 100644 index ab456de..0000000 --- a/src/Rest/Stocks/HistoricQuotes.php +++ /dev/null @@ -1,49 +0,0 @@ - 100 - ]; - - /** - * @param $tickerSymbol - * @param $date - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($tickerSymbol, $date): array - { - return $this->_get('/v1/historic/quotes/' . $tickerSymbol . '/' . $date); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['ticks'] = array_map( - function ($tick) { - return Mappers::quoteV1($tick); - }, - $response['ticks'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/HistoricQuotesV2.php b/src/Rest/Stocks/HistoricQuotesV2.php deleted file mode 100644 index 880be3a..0000000 --- a/src/Rest/Stocks/HistoricQuotesV2.php +++ /dev/null @@ -1,69 +0,0 @@ - 100 - ]; - - /** - * @param $tickerSymbol - * @param $date - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($tickerSymbol, $date): array - { - return $this->_get('/v2/ticks/stocks/nbbo/' . $tickerSymbol . '/' . $date); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $mapperFields = [ - 'ticker' => 'T', - 'SIPTimestamp' => 't', - 'participantExchangeTimestamp' => 'y', - 'tradeReportingFacilityTimestamp' => 'f', - 'sequenceNumber' => 'q', - 'conditions' => 'c', - 'indicators' => 'i', - 'bidPrice' => 'p', - 'bidExchangeId' => 'x', - 'bidSize' => 's', - 'askPrice' => 'p', - 'askExchangeId' => 'X', - 'askSize' => 'S', - 'tapeWhereTradeOccured' => 'z', - ]; - - if ($response['results']) { - $response['results'] = array_map( - function ($result) use ( - $mapperFields - ) { - return Mappers::map($mapperFields, $result); - }, - $response['results'] - ); - } - - return $response; - } -} diff --git a/src/Rest/Stocks/HistoricTrades.php b/src/Rest/Stocks/HistoricTrades.php deleted file mode 100644 index 650893b..0000000 --- a/src/Rest/Stocks/HistoricTrades.php +++ /dev/null @@ -1,50 +0,0 @@ - 100 - ]; - - /** - * @param $tickerSymbol - * @param $date - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($tickerSymbol, $date): array - { - return $this->_get('/v1/historic/trades/' . $tickerSymbol . '/' . $date); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['ticks'] = array_map( - function ($tick) { - return Mappers::tradeV1($tick); - }, - $response['ticks'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/HistoricTradesV2.php b/src/Rest/Stocks/HistoricTradesV2.php deleted file mode 100644 index 1e893e7..0000000 --- a/src/Rest/Stocks/HistoricTradesV2.php +++ /dev/null @@ -1,63 +0,0 @@ - 100 - ]; - - /** - * @param $tickerSymbol - * @param $date - * - * @return array - * - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function get($tickerSymbol, $date): array - { - return $this->_get('/v2/ticks/stocks/trades/' . $tickerSymbol . '/' . $date); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $mapperFields = [ - 'ticker' => 'T', - 'SIPTimestamp' => 't', - 'participantExchangeTimestamp' => 'y', - 'tradeReportingFacilityTimestamp' => 'y', - 'sequenceNumber' => 'q', - 'tradeId' => 'i', - 'exchange' => 'x', - 'size' => 's', - 'conditions' => 'c', - 'price' => 'p', - 'tapeWhereTheTradeOccured' => 'z', - ]; - - $response['results'] = array_map( - function ($result) { - - return $result; - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/LastQuoteForSymbol.php b/src/Rest/Stocks/LastQuoteForSymbol.php deleted file mode 100644 index 1edef98..0000000 --- a/src/Rest/Stocks/LastQuoteForSymbol.php +++ /dev/null @@ -1,25 +0,0 @@ -_get('/v1/last_quote/stocks/' . $tickerSymbol); - } -} diff --git a/src/Rest/Stocks/LastQuoteForSymbolV2.php b/src/Rest/Stocks/LastQuoteForSymbolV2.php deleted file mode 100644 index d6ac719..0000000 --- a/src/Rest/Stocks/LastQuoteForSymbolV2.php +++ /dev/null @@ -1,26 +0,0 @@ -_get('/v2/last/nbbo/' . $tickerSymbol); - } -} diff --git a/src/Rest/Stocks/LastTradeForSymbol.php b/src/Rest/Stocks/LastTradeForSymbol.php deleted file mode 100644 index 68d3d11..0000000 --- a/src/Rest/Stocks/LastTradeForSymbol.php +++ /dev/null @@ -1,25 +0,0 @@ -_get('/v1/last/stocks/' . $tickerSymbol); - } -} diff --git a/src/Rest/Stocks/LastTradeForSymbolV2.php b/src/Rest/Stocks/LastTradeForSymbolV2.php deleted file mode 100644 index dff064c..0000000 --- a/src/Rest/Stocks/LastTradeForSymbolV2.php +++ /dev/null @@ -1,26 +0,0 @@ -_get('/v2/last/trade/' . $tickerSymbol); - } -} diff --git a/src/Rest/Stocks/PreviousClose.php b/src/Rest/Stocks/PreviousClose.php deleted file mode 100644 index ad6e9f8..0000000 --- a/src/Rest/Stocks/PreviousClose.php +++ /dev/null @@ -1,45 +0,0 @@ -_get('/v2/aggs/ticker/' . $tickerSymbol . '/prev', $params); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['results'] = array_map( - function ($result) { - return Mappers::snapshotAggV2($result); - }, - $response['results'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/SnapshotAllTickers.php b/src/Rest/Stocks/SnapshotAllTickers.php deleted file mode 100644 index f6ddb8c..0000000 --- a/src/Rest/Stocks/SnapshotAllTickers.php +++ /dev/null @@ -1,41 +0,0 @@ -_get('/v2/snapshot/locale/us/markets/stocks/tickers'); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotTicker($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/SnapshotGainersLosers.php b/src/Rest/Stocks/SnapshotGainersLosers.php deleted file mode 100644 index 969badd..0000000 --- a/src/Rest/Stocks/SnapshotGainersLosers.php +++ /dev/null @@ -1,44 +0,0 @@ -_get('/v2/snapshot/locale/us/markets/stocks/' . $direction); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['tickers'] = array_map( - function ($ticker) { - return Mappers::snapshotTicker($ticker); - }, - $response['tickers'] - ); - - return $response; - } -} diff --git a/src/Rest/Stocks/SnapshotSingleTicker.php b/src/Rest/Stocks/SnapshotSingleTicker.php deleted file mode 100644 index f978eb4..0000000 --- a/src/Rest/Stocks/SnapshotSingleTicker.php +++ /dev/null @@ -1,38 +0,0 @@ -_get('/v2/snapshot/locale/us/markets/stocks/tickers/' . $tickerSymbol); - } - - /** - * @param array $response - * - * @return array - */ - protected function mapper(array $response): array - { - $response['ticker'] = Mappers::snapshotTicker($response['ticker']); - - return $response; - } -} diff --git a/src/Rest/Stocks/Stocks.php b/src/Rest/Stocks/Stocks.php deleted file mode 100644 index 35b9e2f..0000000 --- a/src/Rest/Stocks/Stocks.php +++ /dev/null @@ -1,247 +0,0 @@ -apiKey = $apiKey; - - $this->exchanges = new Exchanges($apiKey); - $this->historicTrades = new HistoricTrades($apiKey); - $this->historicTradesV2 = new HistoricTradesV2($apiKey); - $this->historicQuotes = new HistoricQuotes($apiKey); - $this->historicQuotesV2 = new HistoricQuotesV2($apiKey); - $this->lastTradeForSymbol = new LastTradeForSymbol($apiKey); - $this->lastQuoteForSymbol = new LastQuoteForSymbol($apiKey); - $this->dailyOpenClose = new DailyOpenClose($apiKey); - $this->conditionMappings = new ConditionMappings($apiKey); - $this->snapshotAllTickers = new SnapshotAllTickers($apiKey); - $this->snapshotSingleTicker = new SnapshotSingleTicker($apiKey); - $this->snapshotGainersLosers = new SnapshotGainersLosers($apiKey); - $this->previousClose = new PreviousClose($apiKey); - $this->aggregates = new Aggregates($apiKey); - $this->groupedDaily = new GroupedDaily($apiKey); - } - - /** - * @return Exchanges - */ - public function exchanges(): Exchanges - { - return new Exchanges($this->apiKey); - } - - /** - * @return HistoricTrades - */ - public function historicTrades(): HistoricTrades - { - return new HistoricTrades($this->apiKey); - } - - /** - * @return HistoricTradesV2 - */ - public function historicTradesV2(): HistoricTradesV2 - { - return new HistoricTradesV2($this->apiKey); - } - - /** - * @return HistoricQuotes - */ - public function historicQuotes(): HistoricQuotes - { - return new HistoricQuotes($this->apiKey); - } - - /** - * @return HistoricQuotesV2 - */ - public function historicQuotesV2(): HistoricQuotesV2 - { - return new HistoricQuotesV2($this->apiKey); - } - - /** - * @return LastTradeForSymbol - */ - public function lastTradeForSymbol(): LastTradeForSymbol - { - return new LastTradeForSymbol($this->apiKey); - } - - /** - * @return LastQuoteForSymbol - */ - public function lastQuoteForSymbol(): LastQuoteForSymbol - { - return new LastQuoteForSymbol($this->apiKey); - } - - /** - * @return DailyOpenClose - */ - public function dailyOpenClose(): DailyOpenClose - { - return new DailyOpenClose($this->apiKey); - } - - /** - * @return ConditionMappings - */ - public function conditionMappings(): ConditionMappings - { - return new ConditionMappings($this->apiKey); - } - - /** - * @return SnapshotAllTickers - */ - public function snapshotAllTickers(): SnapshotAllTickers - { - return new SnapshotAllTickers($this->apiKey); - } - - /** - * @return SnapshotSingleTicker - */ - public function snapshotSingleTicker(): SnapshotSingleTicker - { - return new SnapshotSingleTicker($this->apiKey); - } - - /** - * @return SnapshotGainersLosers - */ - public function snapshotGainersLosers(): SnapshotGainersLosers - { - return new SnapshotGainersLosers($this->apiKey); - } - - /** - * @return PreviousClose - */ - public function previousClose(): PreviousClose - { - return new PreviousClose($this->apiKey); - } - - /** - * @return Aggregates - */ - public function aggregates(): Aggregates - { - return new Aggregates($this->apiKey); - } - - /** - * @return GroupedDaily - */ - public function groupedDaily(): GroupedDaily - { - return new GroupedDaily($this->apiKey); - } -} diff --git a/src/Websockets/WebsocketResource.php b/src/Websockets/WebsocketResource.php deleted file mode 100644 index 2ae59d6..0000000 --- a/src/Websockets/WebsocketResource.php +++ /dev/null @@ -1,79 +0,0 @@ -apiKey = $apiKey; - $this->topic = $topic; - $this->socketUrl = $socketUrl; - } - - /** - * @param string $socketUrl - */ - public function setSocketUrl(string $socketUrl) - { - $this->socketUrl = $socketUrl; - } - - /** - * @param $subscriptions - * @param $onMessageCallback - */ - public function connect($subscriptions, $onMessageCallback) - { - \Amp\Loop::run( - function () use ($onMessageCallback, $subscriptions) { - /** - * @var Websocket\Connection $connection - */ - $connection = yield Websocket\connect($this->socketUrl . '/' . $this->topic); - yield $connection->send('{"action":"auth", "params":"' . $this->apiKey . '"}'); - yield $connection->send( - json_encode( - [ - "action" => "subscribe", - "params" => $subscriptions, - ] - ) - ); - - /** - * @var Websocket\Message $message - */ - while ($message = yield $connection->receive()) { - $payload = yield $message->buffer(); - $onMessageCallback(json_decode($payload)); - } - } - ); - } -} diff --git a/src/Websockets/Websockets.php b/src/Websockets/Websockets.php deleted file mode 100644 index 6f96155..0000000 --- a/src/Websockets/Websockets.php +++ /dev/null @@ -1,67 +0,0 @@ -apiKey = $apiKey; - - $this->crypto = new WebsocketResource('crypto', $apiKey); - $this->forex = new WebsocketResource('forex', $apiKey); - $this->stocks = new WebsocketResource('stocks', $apiKey); - } - - /** - * @return WebsocketResource - */ - public function crypto(): WebsocketResource - { - return new WebsocketResource('crypto', $this->apiKey); - } - - /** - * @return WebsocketResource - */ - public function forex(): WebsocketResource - { - return new WebsocketResource('forex', $this->apiKey); - } - - /** - * @return WebsocketResource - */ - public function stocks(): WebsocketResource - { - return new WebsocketResource('stocks', $this->apiKey); - } -} diff --git a/test/Api/CrpytoaggregatesApiTest.php b/test/Api/CrpytoaggregatesApiTest.php new file mode 100644 index 0000000..851cada --- /dev/null +++ b/test/Api/CrpytoaggregatesApiTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for cryptoRSI + * + * Relative Strength Index (RSI). + * + */ + public function testCryptoRSI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for cryptoSMA + * + * Simple Moving Average (SMA). + * + */ + public function testCryptoSMA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CryptoaggregatesApiTest.php b/test/Api/CryptoaggregatesApiTest.php new file mode 100644 index 0000000..a690325 --- /dev/null +++ b/test/Api/CryptoaggregatesApiTest.php @@ -0,0 +1,121 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsGroupedLocaleGlobalMarketCryptoDateGet + * + * Grouped Daily (Bars). + * + */ + public function testV2AggsGroupedLocaleGlobalMarketCryptoDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerCryptoTickerPrevGet + * + * Previous Close. + * + */ + public function testV2AggsTickerCryptoTickerPrevGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars). + * + */ + public function testV2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CryptolasttradeApiTest.php b/test/Api/CryptolasttradeApiTest.php new file mode 100644 index 0000000..1d46f7d --- /dev/null +++ b/test/Api/CryptolasttradeApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CryptoopenCloseApiTest.php b/test/Api/CryptoopenCloseApiTest.php new file mode 100644 index 0000000..1055993 --- /dev/null +++ b/test/Api/CryptoopenCloseApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CryptosnapshotApiTest.php b/test/Api/CryptosnapshotApiTest.php new file mode 100644 index 0000000..45e7802 --- /dev/null +++ b/test/Api/CryptosnapshotApiTest.php @@ -0,0 +1,121 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleGlobalMarketsCryptoTickersGet + * + * All Tickers. + * + */ + public function testV2SnapshotLocaleGlobalMarketsCryptoTickersGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet + * + * Ticker Full Book (L2). + * + */ + public function testV2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet + * + * Ticker. + * + */ + public function testV2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CryptotradesApiTest.php b/test/Api/CryptotradesApiTest.php new file mode 100644 index 0000000..64d7b4f --- /dev/null +++ b/test/Api/CryptotradesApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1HistoricCryptoFromToDateGet + * + * Historic Crypto Trades. + * + */ + public function testV1HistoricCryptoFromToDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DefaultApiTest.php b/test/Api/DefaultApiTest.php new file mode 100644 index 0000000..e1b0fe7 --- /dev/null +++ b/test/Api/DefaultApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for snapshots + * + * Universal Snapshot. + * + */ + public function testSnapshots() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxaggregatesApiTest.php b/test/Api/FxaggregatesApiTest.php new file mode 100644 index 0000000..f100ec2 --- /dev/null +++ b/test/Api/FxaggregatesApiTest.php @@ -0,0 +1,157 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for forexMACD + * + * Moving Average Convergence/Divergence (MACD). + * + */ + public function testForexMACD() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for forexRSI + * + * Relative Strength Index (RSI). + * + */ + public function testForexRSI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for forexSMA + * + * Simple Moving Average (SMA). + * + */ + public function testForexSMA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsGroupedLocaleGlobalMarketFxDateGet + * + * Grouped Daily (Bars). + * + */ + public function testV2AggsGroupedLocaleGlobalMarketFxDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerForexTickerPrevGet + * + * Previous Close. + * + */ + public function testV2AggsTickerForexTickerPrevGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerForexTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars). + * + */ + public function testV2AggsTickerForexTickerRangeMultiplierTimespanFromToGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxconversionApiTest.php b/test/Api/FxconversionApiTest.php new file mode 100644 index 0000000..10f70c9 --- /dev/null +++ b/test/Api/FxconversionApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxlastquoteApiTest.php b/test/Api/FxlastquoteApiTest.php new file mode 100644 index 0000000..79c10cb --- /dev/null +++ b/test/Api/FxlastquoteApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxquotesApiTest.php b/test/Api/FxquotesApiTest.php new file mode 100644 index 0000000..3f9beda --- /dev/null +++ b/test/Api/FxquotesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxsnapshotApiTest.php b/test/Api/FxsnapshotApiTest.php new file mode 100644 index 0000000..5dca0f8 --- /dev/null +++ b/test/Api/FxsnapshotApiTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleGlobalMarketsForexTickersGet + * + * All Tickers. + * + */ + public function testV2SnapshotLocaleGlobalMarketsForexTickersGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleGlobalMarketsForexTickersTickerGet + * + * Ticker. + * + */ + public function testV2SnapshotLocaleGlobalMarketsForexTickersTickerGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FxtradesApiTest.php b/test/Api/FxtradesApiTest.php new file mode 100644 index 0000000..c1b0b65 --- /dev/null +++ b/test/Api/FxtradesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/IndicesaggregatesApiTest.php b/test/Api/IndicesaggregatesApiTest.php new file mode 100644 index 0000000..a6e3da0 --- /dev/null +++ b/test/Api/IndicesaggregatesApiTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for indicesMACD + * + * Moving Average Convergence/Divergence (MACD). + * + */ + public function testIndicesMACD() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for indicesRSI + * + * Relative Strength Index (RSI). + * + */ + public function testIndicesRSI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for indicesSMA + * + * Simple Moving Average (SMA). + * + */ + public function testIndicesSMA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerIndicesTickerPrevGet + * + * Previous Close. + * + */ + public function testV2AggsTickerIndicesTickerPrevGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars). + * + */ + public function testV2AggsTickerIndicesTickerRangeMultiplierTimespanFromToGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/IndicessnapshotApiTest.php b/test/Api/IndicessnapshotApiTest.php new file mode 100644 index 0000000..92c32fc --- /dev/null +++ b/test/Api/IndicessnapshotApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/InternalApiTest.php b/test/Api/InternalApiTest.php new file mode 100644 index 0000000..c9d1021 --- /dev/null +++ b/test/Api/InternalApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionsaggregatesApiTest.php b/test/Api/OptionsaggregatesApiTest.php new file mode 100644 index 0000000..6e99621 --- /dev/null +++ b/test/Api/OptionsaggregatesApiTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for optionsMACD + * + * Moving Average Convergence/Divergence (MACD). + * + */ + public function testOptionsMACD() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for optionsRSI + * + * Relative Strength Index (RSI). + * + */ + public function testOptionsRSI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for optionsSMA + * + * Simple Moving Average (SMA). + * + */ + public function testOptionsSMA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerOptionsTickerPrevGet + * + * Previous Close. + * + */ + public function testV2AggsTickerOptionsTickerPrevGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars). + * + */ + public function testV2AggsTickerOptionsTickerRangeMultiplierTimespanFromToGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionslasttradeApiTest.php b/test/Api/OptionslasttradeApiTest.php new file mode 100644 index 0000000..6282053 --- /dev/null +++ b/test/Api/OptionslasttradeApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionsopenCloseApiTest.php b/test/Api/OptionsopenCloseApiTest.php new file mode 100644 index 0000000..517ace1 --- /dev/null +++ b/test/Api/OptionsopenCloseApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionsquotesApiTest.php b/test/Api/OptionsquotesApiTest.php new file mode 100644 index 0000000..e36936a --- /dev/null +++ b/test/Api/OptionsquotesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionssnapshotApiTest.php b/test/Api/OptionssnapshotApiTest.php new file mode 100644 index 0000000..c51f980 --- /dev/null +++ b/test/Api/OptionssnapshotApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for optionsChain + * + * Options Chain. + * + */ + public function testOptionsChain() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OptionstradesApiTest.php b/test/Api/OptionstradesApiTest.php new file mode 100644 index 0000000..66afe94 --- /dev/null +++ b/test/Api/OptionstradesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/PublicApiTest.php b/test/Api/PublicApiTest.php new file mode 100644 index 0000000..b548f77 --- /dev/null +++ b/test/Api/PublicApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferenceconditionsApiTest.php b/test/Api/ReferenceconditionsApiTest.php new file mode 100644 index 0000000..6af1210 --- /dev/null +++ b/test/Api/ReferenceconditionsApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencedividendsApiTest.php b/test/Api/ReferencedividendsApiTest.php new file mode 100644 index 0000000..3ec5c18 --- /dev/null +++ b/test/Api/ReferencedividendsApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferenceexchangesApiTest.php b/test/Api/ReferenceexchangesApiTest.php new file mode 100644 index 0000000..2189b7c --- /dev/null +++ b/test/Api/ReferenceexchangesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencenewsApiTest.php b/test/Api/ReferencenewsApiTest.php new file mode 100644 index 0000000..74b244c --- /dev/null +++ b/test/Api/ReferencenewsApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferenceoptionscontractApiTest.php b/test/Api/ReferenceoptionscontractApiTest.php new file mode 100644 index 0000000..dfb09e8 --- /dev/null +++ b/test/Api/ReferenceoptionscontractApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferenceoptionscontractslistApiTest.php b/test/Api/ReferenceoptionscontractslistApiTest.php new file mode 100644 index 0000000..7d96197 --- /dev/null +++ b/test/Api/ReferenceoptionscontractslistApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencesecfilingApiTest.php b/test/Api/ReferencesecfilingApiTest.php new file mode 100644 index 0000000..dfd39ae --- /dev/null +++ b/test/Api/ReferencesecfilingApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencesecfilingfileApiTest.php b/test/Api/ReferencesecfilingfileApiTest.php new file mode 100644 index 0000000..532bac8 --- /dev/null +++ b/test/Api/ReferencesecfilingfileApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencesecfilingfilesApiTest.php b/test/Api/ReferencesecfilingfilesApiTest.php new file mode 100644 index 0000000..f1b8a3f --- /dev/null +++ b/test/Api/ReferencesecfilingfilesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencesecfilingsApiTest.php b/test/Api/ReferencesecfilingsApiTest.php new file mode 100644 index 0000000..6f8df6d --- /dev/null +++ b/test/Api/ReferencesecfilingsApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencestocksApiTest.php b/test/Api/ReferencestocksApiTest.php new file mode 100644 index 0000000..e3a4f1c --- /dev/null +++ b/test/Api/ReferencestocksApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listStockSplits + * + * Stock Splits v3. + * + */ + public function testListStockSplits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencestocksmarketApiTest.php b/test/Api/ReferencestocksmarketApiTest.php new file mode 100644 index 0000000..9ef7b8e --- /dev/null +++ b/test/Api/ReferencestocksmarketApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for getMarketStatus + * + * Market Status. + * + */ + public function testGetMarketStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencetickersgetApiTest.php b/test/Api/ReferencetickersgetApiTest.php new file mode 100644 index 0000000..d476ed7 --- /dev/null +++ b/test/Api/ReferencetickersgetApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for getTicker + * + * Ticker Details v3. + * + */ + public function testGetTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencetickerslistApiTest.php b/test/Api/ReferencetickerslistApiTest.php new file mode 100644 index 0000000..31bb38b --- /dev/null +++ b/test/Api/ReferencetickerslistApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ReferencetickerstypesApiTest.php b/test/Api/ReferencetickerstypesApiTest.php new file mode 100644 index 0000000..91f3ceb --- /dev/null +++ b/test/Api/ReferencetickerstypesApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StocksaggregatesApiTest.php b/test/Api/StocksaggregatesApiTest.php new file mode 100644 index 0000000..6e72352 --- /dev/null +++ b/test/Api/StocksaggregatesApiTest.php @@ -0,0 +1,157 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for mACD + * + * Moving Average Convergence/Divergence (MACD). + * + */ + public function testMACD() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for rSI + * + * Relative Strength Index (RSI). + * + */ + public function testRSI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for sMA + * + * Simple Moving Average (SMA). + * + */ + public function testSMA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsGroupedLocaleUsMarketStocksDateGet + * + * Grouped Daily (Bars). + * + */ + public function testV2AggsGroupedLocaleUsMarketStocksDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerStocksTickerPrevGet + * + * Previous Close. + * + */ + public function testV2AggsTickerStocksTickerPrevGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet + * + * Aggregates (Bars). + * + */ + public function testV2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StockslastquoteApiTest.php b/test/Api/StockslastquoteApiTest.php new file mode 100644 index 0000000..5479d73 --- /dev/null +++ b/test/Api/StockslastquoteApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StockslasttradeApiTest.php b/test/Api/StockslasttradeApiTest.php new file mode 100644 index 0000000..96033dc --- /dev/null +++ b/test/Api/StockslasttradeApiTest.php @@ -0,0 +1,85 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StocksopenCloseApiTest.php b/test/Api/StocksopenCloseApiTest.php new file mode 100644 index 0000000..dba0767 --- /dev/null +++ b/test/Api/StocksopenCloseApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1OpenCloseStocksTickerDateGet + * + * Daily Open/Close. + * + */ + public function testV1OpenCloseStocksTickerDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StocksquotesApiTest.php b/test/Api/StocksquotesApiTest.php new file mode 100644 index 0000000..952274f --- /dev/null +++ b/test/Api/StocksquotesApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2TicksStocksNbboTickerDateGet + * + * Quotes (NBBO). + * + */ + public function testV2TicksStocksNbboTickerDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StockssnapshotApiTest.php b/test/Api/StockssnapshotApiTest.php new file mode 100644 index 0000000..81dcaa2 --- /dev/null +++ b/test/Api/StockssnapshotApiTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleUsMarketsStocksTickersGet + * + * All Tickers. + * + */ + public function testV2SnapshotLocaleUsMarketsStocksTickersGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet + * + * Ticker. + * + */ + public function testV2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StockstradesApiTest.php b/test/Api/StockstradesApiTest.php new file mode 100644 index 0000000..3d7b8da --- /dev/null +++ b/test/Api/StockstradesApiTest.php @@ -0,0 +1,97 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for v2TicksStocksTradesTickerDateGet + * + * Trades. + * + */ + public function testV2TicksStocksTradesTickerDateGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AskExchangeIdTest.php b/test/Model/AskExchangeIdTest.php new file mode 100644 index 0000000..6113d09 --- /dev/null +++ b/test/Model/AskExchangeIdTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BidExchangeIdTest.php b/test/Model/BidExchangeIdTest.php new file mode 100644 index 0000000..a975d69 --- /dev/null +++ b/test/Model/BidExchangeIdTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CompanyTest.php b/test/Model/CompanyTest.php new file mode 100644 index 0000000..4fb2e45 --- /dev/null +++ b/test/Model/CompanyTest.php @@ -0,0 +1,333 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "active" + */ + public function testPropertyActive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bloomberg" + */ + public function testPropertyBloomberg() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ceo" + */ + public function testPropertyCeo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "employees" + */ + public function testPropertyEmployees() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange_symbol" + */ + public function testPropertyExchangeSymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "figi" + */ + public function testPropertyFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hq_address" + */ + public function testPropertyHqAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hq_country" + */ + public function testPropertyHqCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hq_state" + */ + public function testPropertyHqState() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "industry" + */ + public function testPropertyIndustry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lei" + */ + public function testPropertyLei() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "listdate" + */ + public function testPropertyListdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo" + */ + public function testPropertyLogo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "marketcap" + */ + public function testPropertyMarketcap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone" + */ + public function testPropertyPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sector" + */ + public function testPropertySector() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sic" + */ + public function testPropertySic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "similar" + */ + public function testPropertySimilar() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tags" + */ + public function testPropertyTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ConditionTypeMapTest.php b/test/Model/ConditionTypeMapTest.php new file mode 100644 index 0000000..7c7a64a --- /dev/null +++ b/test/Model/ConditionTypeMapTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "condition" + */ + public function testPropertyCondition() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoEMA200ResponseResultsTest.php b/test/Model/CryptoEMA200ResponseResultsTest.php new file mode 100644 index 0000000..fb16d31 --- /dev/null +++ b/test/Model/CryptoEMA200ResponseResultsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying" + */ + public function testPropertyUnderlying() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "values" + */ + public function testPropertyValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInnerTest.php b/test/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInnerTest.php new file mode 100644 index 0000000..2feb9fe --- /dev/null +++ b/test/Model/CryptoEMA200ResponseResultsUnderlyingAggregatesInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoEMA200ResponseResultsUnderlyingTest.php b/test/Model/CryptoEMA200ResponseResultsUnderlyingTest.php new file mode 100644 index 0000000..abe3090 --- /dev/null +++ b/test/Model/CryptoEMA200ResponseResultsUnderlyingTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aggregates" + */ + public function testPropertyAggregates() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoEMA200ResponseResultsValuesInnerTest.php b/test/Model/CryptoEMA200ResponseResultsValuesInnerTest.php new file mode 100644 index 0000000..bce64da --- /dev/null +++ b/test/Model/CryptoEMA200ResponseResultsValuesInnerTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoEMA200ResponseTest.php b/test/Model/CryptoEMA200ResponseTest.php new file mode 100644 index 0000000..4fa3270 --- /dev/null +++ b/test/Model/CryptoEMA200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoExchangeInnerTest.php b/test/Model/CryptoExchangeInnerTest.php new file mode 100644 index 0000000..2b04da6 --- /dev/null +++ b/test/Model/CryptoExchangeInnerTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoGroupedResultsTest.php b/test/Model/CryptoGroupedResultsTest.php new file mode 100644 index 0000000..a9e6216 --- /dev/null +++ b/test/Model/CryptoGroupedResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoHistoricTradesTest.php b/test/Model/CryptoHistoricTradesTest.php new file mode 100644 index 0000000..38e5912 --- /dev/null +++ b/test/Model/CryptoHistoricTradesTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "map" + */ + public function testPropertyMap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ms_latency" + */ + public function testPropertyMsLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticks" + */ + public function testPropertyTicks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoLastTradeLastTest.php b/test/Model/CryptoLastTradeLastTest.php new file mode 100644 index 0000000..a360b2a --- /dev/null +++ b/test/Model/CryptoLastTradeLastTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoLastTradeTest.php b/test/Model/CryptoLastTradeTest.php new file mode 100644 index 0000000..b8f07a8 --- /dev/null +++ b/test/Model/CryptoLastTradeTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoMACD200ResponseResultsTest.php b/test/Model/CryptoMACD200ResponseResultsTest.php new file mode 100644 index 0000000..8a2e4f8 --- /dev/null +++ b/test/Model/CryptoMACD200ResponseResultsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying" + */ + public function testPropertyUnderlying() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "values" + */ + public function testPropertyValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoMACD200ResponseResultsValuesInnerTest.php b/test/Model/CryptoMACD200ResponseResultsValuesInnerTest.php new file mode 100644 index 0000000..173a221 --- /dev/null +++ b/test/Model/CryptoMACD200ResponseResultsValuesInnerTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "histogram" + */ + public function testPropertyHistogram() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "signal" + */ + public function testPropertySignal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoMACD200ResponseTest.php b/test/Model/CryptoMACD200ResponseTest.php new file mode 100644 index 0000000..58eec39 --- /dev/null +++ b/test/Model/CryptoMACD200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoOpenCloseTest.php b/test/Model/CryptoOpenCloseTest.php new file mode 100644 index 0000000..f321123 --- /dev/null +++ b/test/Model/CryptoOpenCloseTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "closing_trades" + */ + public function testPropertyClosingTrades() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_utc" + */ + public function testPropertyIsUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open_trades" + */ + public function testPropertyOpenTrades() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoRSI200ResponseResultsTest.php b/test/Model/CryptoRSI200ResponseResultsTest.php new file mode 100644 index 0000000..e404db4 --- /dev/null +++ b/test/Model/CryptoRSI200ResponseResultsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying" + */ + public function testPropertyUnderlying() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "values" + */ + public function testPropertyValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoRSI200ResponseTest.php b/test/Model/CryptoRSI200ResponseTest.php new file mode 100644 index 0000000..3d7ba1c --- /dev/null +++ b/test/Model/CryptoRSI200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSMA200ResponseResultsTest.php b/test/Model/CryptoSMA200ResponseResultsTest.php new file mode 100644 index 0000000..a21bf28 --- /dev/null +++ b/test/Model/CryptoSMA200ResponseResultsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying" + */ + public function testPropertyUnderlying() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "values" + */ + public function testPropertyValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSMA200ResponseTest.php b/test/Model/CryptoSMA200ResponseTest.php new file mode 100644 index 0000000..e09c2a4 --- /dev/null +++ b/test/Model/CryptoSMA200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSnapshotMinuteTest.php b/test/Model/CryptoSnapshotMinuteTest.php new file mode 100644 index 0000000..37ff1f9 --- /dev/null +++ b/test/Model/CryptoSnapshotMinuteTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSnapshotTickerFullBookTest.php b/test/Model/CryptoSnapshotTickerFullBookTest.php new file mode 100644 index 0000000..3bf223e --- /dev/null +++ b/test/Model/CryptoSnapshotTickerFullBookTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSnapshotTickerTest.php b/test/Model/CryptoSnapshotTickerTest.php new file mode 100644 index 0000000..c329c47 --- /dev/null +++ b/test/Model/CryptoSnapshotTickerTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoSnapshotTickersTest.php b/test/Model/CryptoSnapshotTickersTest.php new file mode 100644 index 0000000..e3eeee1 --- /dev/null +++ b/test/Model/CryptoSnapshotTickersTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CryptoTickTest.php b/test/Model/CryptoTickTest.php new file mode 100644 index 0000000..50bb9bb --- /dev/null +++ b/test/Model/CryptoTickTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DateTest.php b/test/Model/DateTest.php new file mode 100644 index 0000000..3de2835 --- /dev/null +++ b/test/Model/DateTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ExchangeInnerTest.php b/test/Model/ExchangeInnerTest.php new file mode 100644 index 0000000..b60fa75 --- /dev/null +++ b/test/Model/ExchangeInnerTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mic" + */ + public function testPropertyMic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tape" + */ + public function testPropertyTape() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FinancialTest.php b/test/Model/FinancialTest.php new file mode 100644 index 0000000..22b20a2 --- /dev/null +++ b/test/Model/FinancialTest.php @@ -0,0 +1,279 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_change" + */ + public function testPropertyCashChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_flow" + */ + public function testPropertyCashFlow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cost_of_revenue" + */ + public function testPropertyCostOfRevenue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_assets" + */ + public function testPropertyCurrentAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_cash" + */ + public function testPropertyCurrentCash() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_debt" + */ + public function testPropertyCurrentDebt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_profit" + */ + public function testPropertyGrossProfit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_income" + */ + public function testPropertyNetIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_expense" + */ + public function testPropertyOperatingExpense() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_gains_losses" + */ + public function testPropertyOperatingGainsLosses() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_income" + */ + public function testPropertyOperatingIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_revenue" + */ + public function testPropertyOperatingRevenue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "report_date" + */ + public function testPropertyReportDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "report_date_str" + */ + public function testPropertyReportDateStr() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "research_and_development" + */ + public function testPropertyResearchAndDevelopment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shareholder_equity" + */ + public function testPropertyShareholderEquity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_assets" + */ + public function testPropertyTotalAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_cash" + */ + public function testPropertyTotalCash() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_debt" + */ + public function testPropertyTotalDebt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_liabilities" + */ + public function testPropertyTotalLiabilities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_revenue" + */ + public function testPropertyTotalRevenue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FinancialsTest.php b/test/Model/FinancialsTest.php new file mode 100644 index 0000000..d9b07f5 --- /dev/null +++ b/test/Model/FinancialsTest.php @@ -0,0 +1,1071 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ebitda_margin" + */ + public function testPropertyEbitdaMargin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "accumulated_other_comprehensive_income" + */ + public function testPropertyAccumulatedOtherComprehensiveIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "accumulated_retained_earnings_deficit" + */ + public function testPropertyAccumulatedRetainedEarningsDeficit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_turnover" + */ + public function testPropertyAssetTurnover() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "assets" + */ + public function testPropertyAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "assets_average" + */ + public function testPropertyAssetsAverage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "assets_current" + */ + public function testPropertyAssetsCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "assets_non_current" + */ + public function testPropertyAssetsNonCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "average_equity" + */ + public function testPropertyAverageEquity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "book_value_per_share" + */ + public function testPropertyBookValuePerShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "calendar_date" + */ + public function testPropertyCalendarDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "capital_expenditure" + */ + public function testPropertyCapitalExpenditure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_and_equivalents" + */ + public function testPropertyCashAndEquivalents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_and_equivalents_usd" + */ + public function testPropertyCashAndEquivalentsUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "consolidated_income" + */ + public function testPropertyConsolidatedIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cost_of_revenue" + */ + public function testPropertyCostOfRevenue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_liabilities" + */ + public function testPropertyCurrentLiabilities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_ratio" + */ + public function testPropertyCurrentRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debt" + */ + public function testPropertyDebt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debt_current" + */ + public function testPropertyDebtCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debt_non_current" + */ + public function testPropertyDebtNonCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debt_to_equity_ratio" + */ + public function testPropertyDebtToEquityRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debt_usd" + */ + public function testPropertyDebtUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deferred_revenue" + */ + public function testPropertyDeferredRevenue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deposits" + */ + public function testPropertyDeposits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "depreciation_amortization_and_accretion" + */ + public function testPropertyDepreciationAmortizationAndAccretion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dividend_yield" + */ + public function testPropertyDividendYield() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dividends_per_basic_common_share" + */ + public function testPropertyDividendsPerBasicCommonShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earning_before_interest_taxes" + */ + public function testPropertyEarningBeforeInterestTaxes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earning_before_interest_taxes_usd" + */ + public function testPropertyEarningBeforeInterestTaxesUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_before_interest_taxes_depreciation_amortization" + */ + public function testPropertyEarningsBeforeInterestTaxesDepreciationAmortization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_before_interest_taxes_depreciation_amortization_usd" + */ + public function testPropertyEarningsBeforeInterestTaxesDepreciationAmortizationUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_before_tax" + */ + public function testPropertyEarningsBeforeTax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_per_basic_share" + */ + public function testPropertyEarningsPerBasicShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_per_basic_share_usd" + */ + public function testPropertyEarningsPerBasicShareUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "earnings_per_diluted_share" + */ + public function testPropertyEarningsPerDilutedShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "effect_of_exchange_rate_changes_on_cash" + */ + public function testPropertyEffectOfExchangeRateChangesOnCash() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enterprise_value" + */ + public function testPropertyEnterpriseValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enterprise_value_over_ebit" + */ + public function testPropertyEnterpriseValueOverEbit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enterprise_value_over_ebitda" + */ + public function testPropertyEnterpriseValueOverEbitda() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "foreign_currency_usd_exchange_rate" + */ + public function testPropertyForeignCurrencyUsdExchangeRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "free_cash_flow" + */ + public function testPropertyFreeCashFlow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "free_cash_flow_per_share" + */ + public function testPropertyFreeCashFlowPerShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "goodwill_and_intangible_assets" + */ + public function testPropertyGoodwillAndIntangibleAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_margin" + */ + public function testPropertyGrossMargin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_profit" + */ + public function testPropertyGrossProfit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "income_tax_expense" + */ + public function testPropertyIncomeTaxExpense() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "interest_expense" + */ + public function testPropertyInterestExpense() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "inventory" + */ + public function testPropertyInventory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invested_capital" + */ + public function testPropertyInvestedCapital() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invested_capital_average" + */ + public function testPropertyInvestedCapitalAverage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "investments" + */ + public function testPropertyInvestments() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "investments_current" + */ + public function testPropertyInvestmentsCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "investments_non_current" + */ + public function testPropertyInvestmentsNonCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "issuance_debt_securities" + */ + public function testPropertyIssuanceDebtSecurities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "issuance_equity_shares" + */ + public function testPropertyIssuanceEquityShares() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "liabilities_non_current" + */ + public function testPropertyLiabilitiesNonCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_capitalization" + */ + public function testPropertyMarketCapitalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow" + */ + public function testPropertyNetCashFlow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow_business_acquisitions_disposals" + */ + public function testPropertyNetCashFlowBusinessAcquisitionsDisposals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow_from_financing" + */ + public function testPropertyNetCashFlowFromFinancing() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow_from_investing" + */ + public function testPropertyNetCashFlowFromInvesting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow_from_operations" + */ + public function testPropertyNetCashFlowFromOperations() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_cash_flow_investment_acquisitions_disposals" + */ + public function testPropertyNetCashFlowInvestmentAcquisitionsDisposals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_income" + */ + public function testPropertyNetIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_income_common_stock" + */ + public function testPropertyNetIncomeCommonStock() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_income_common_stock_usd" + */ + public function testPropertyNetIncomeCommonStockUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_income_to_non_controlling_interests" + */ + public function testPropertyNetIncomeToNonControllingInterests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_loss_income_from_discontinued_operations" + */ + public function testPropertyNetLossIncomeFromDiscontinuedOperations() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_expenses" + */ + public function testPropertyOperatingExpenses() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_income" + */ + public function testPropertyOperatingIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_dividends_other_cash_distributions" + */ + public function testPropertyPaymentDividendsOtherCashDistributions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payout_ratio" + */ + public function testPropertyPayoutRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "period" + */ + public function testPropertyPeriod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "preferred_dividends_income_statement_impact" + */ + public function testPropertyPreferredDividendsIncomeStatementImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_earnings" + */ + public function testPropertyPriceEarnings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_sales" + */ + public function testPropertyPriceSales() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_to_book_value" + */ + public function testPropertyPriceToBookValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_to_earnings_ratio" + */ + public function testPropertyPriceToEarningsRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_to_sales_ratio" + */ + public function testPropertyPriceToSalesRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "profit_margin" + */ + public function testPropertyProfitMargin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "property_plant_equipment_net" + */ + public function testPropertyPropertyPlantEquipmentNet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "report_period" + */ + public function testPropertyReportPeriod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "research_and_development_expense" + */ + public function testPropertyResearchAndDevelopmentExpense() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_on_average_assets" + */ + public function testPropertyReturnOnAverageAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_on_average_equity" + */ + public function testPropertyReturnOnAverageEquity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_on_invested_capital" + */ + public function testPropertyReturnOnInvestedCapital() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_on_sales" + */ + public function testPropertyReturnOnSales() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "revenues" + */ + public function testPropertyRevenues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "revenues_usd" + */ + public function testPropertyRevenuesUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sales_per_share" + */ + public function testPropertySalesPerShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "selling_general_and_administrative_expense" + */ + public function testPropertySellingGeneralAndAdministrativeExpense() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_based_compensation" + */ + public function testPropertyShareBasedCompensation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_factor" + */ + public function testPropertyShareFactor() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_price_adjusted_close" + */ + public function testPropertySharePriceAdjustedClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shareholders_equity" + */ + public function testPropertyShareholdersEquity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shareholders_equity_usd" + */ + public function testPropertyShareholdersEquityUsd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shares" + */ + public function testPropertyShares() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tangible_asset_value" + */ + public function testPropertyTangibleAssetValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tangible_assets_book_value_per_share" + */ + public function testPropertyTangibleAssetsBookValuePerShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_assets" + */ + public function testPropertyTaxAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_liabilities" + */ + public function testPropertyTaxLiabilities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_liabilities" + */ + public function testPropertyTotalLiabilities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trade_and_non_trade_payables" + */ + public function testPropertyTradeAndNonTradePayables() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trade_and_non_trade_receivables" + */ + public function testPropertyTradeAndNonTradeReceivables() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "weighted_average_shares" + */ + public function testPropertyWeightedAverageShares() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "weighted_average_shares_diluted" + */ + public function testPropertyWeightedAverageSharesDiluted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "working_capital" + */ + public function testPropertyWorkingCapital() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexConversionLastTest.php b/test/Model/ForexConversionLastTest.php new file mode 100644 index 0000000..4a1c0d5 --- /dev/null +++ b/test/Model/ForexConversionLastTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask" + */ + public function testPropertyAsk() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid" + */ + public function testPropertyBid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexConversionTest.php b/test/Model/ForexConversionTest.php new file mode 100644 index 0000000..fa21715 --- /dev/null +++ b/test/Model/ForexConversionTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "converted" + */ + public function testPropertyConverted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "initial_amount" + */ + public function testPropertyInitialAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexGroupedResultsTest.php b/test/Model/ForexGroupedResultsTest.php new file mode 100644 index 0000000..8618e57 --- /dev/null +++ b/test/Model/ForexGroupedResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexHistoricTradesTest.php b/test/Model/ForexHistoricTradesTest.php new file mode 100644 index 0000000..55dbdec --- /dev/null +++ b/test/Model/ForexHistoricTradesTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "map" + */ + public function testPropertyMap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ms_latency" + */ + public function testPropertyMsLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pair" + */ + public function testPropertyPair() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticks" + */ + public function testPropertyTicks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexPairLastQuoteTest.php b/test/Model/ForexPairLastQuoteTest.php new file mode 100644 index 0000000..ca942b8 --- /dev/null +++ b/test/Model/ForexPairLastQuoteTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexPreviousCloseTest.php b/test/Model/ForexPreviousCloseTest.php new file mode 100644 index 0000000..4b37ca9 --- /dev/null +++ b/test/Model/ForexPreviousCloseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexSnapshotLastQuoteTest.php b/test/Model/ForexSnapshotLastQuoteTest.php new file mode 100644 index 0000000..86ddb94 --- /dev/null +++ b/test/Model/ForexSnapshotLastQuoteTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "a" + */ + public function testPropertyA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "b" + */ + public function testPropertyB() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexSnapshotPrevDayTest.php b/test/Model/ForexSnapshotPrevDayTest.php new file mode 100644 index 0000000..aa8083a --- /dev/null +++ b/test/Model/ForexSnapshotPrevDayTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexSnapshotTickerTest.php b/test/Model/ForexSnapshotTickerTest.php new file mode 100644 index 0000000..ee34d50 --- /dev/null +++ b/test/Model/ForexSnapshotTickerTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexSnapshotTickersTest.php b/test/Model/ForexSnapshotTickersTest.php new file mode 100644 index 0000000..0ba89b6 --- /dev/null +++ b/test/Model/ForexSnapshotTickersTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ForexTickerResultsTest.php b/test/Model/ForexTickerResultsTest.php new file mode 100644 index 0000000..980e869 --- /dev/null +++ b/test/Model/ForexTickerResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTest.php b/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTest.php new file mode 100644 index 0000000..fea2301 --- /dev/null +++ b/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker_change" + */ + public function testPropertyTickerChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChangeTest.php b/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChangeTest.php new file mode 100644 index 0000000..32b09cc --- /dev/null +++ b/test/Model/GetEvents200ResponseResultsEventsInnerOneOfTickerChangeTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetEvents200ResponseResultsEventsInnerTest.php b/test/Model/GetEvents200ResponseResultsEventsInnerTest.php new file mode 100644 index 0000000..b59acb1 --- /dev/null +++ b/test/Model/GetEvents200ResponseResultsEventsInnerTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker_change" + */ + public function testPropertyTickerChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetEvents200ResponseResultsTest.php b/test/Model/GetEvents200ResponseResultsTest.php new file mode 100644 index 0000000..eebac06 --- /dev/null +++ b/test/Model/GetEvents200ResponseResultsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "events" + */ + public function testPropertyEvents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetEvents200ResponseTest.php b/test/Model/GetEvents200ResponseTest.php new file mode 100644 index 0000000..f4b5ab6 --- /dev/null +++ b/test/Model/GetEvents200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMarketHolidays200ResponseInnerTest.php b/test/Model/GetMarketHolidays200ResponseInnerTest.php new file mode 100644 index 0000000..04a0ffc --- /dev/null +++ b/test/Model/GetMarketHolidays200ResponseInnerTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMarketStatus200ResponseCurrenciesTest.php b/test/Model/GetMarketStatus200ResponseCurrenciesTest.php new file mode 100644 index 0000000..44ffdd3 --- /dev/null +++ b/test/Model/GetMarketStatus200ResponseCurrenciesTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "crypto" + */ + public function testPropertyCrypto() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fx" + */ + public function testPropertyFx() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMarketStatus200ResponseExchangesTest.php b/test/Model/GetMarketStatus200ResponseExchangesTest.php new file mode 100644 index 0000000..55178f4 --- /dev/null +++ b/test/Model/GetMarketStatus200ResponseExchangesTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nasdaq" + */ + public function testPropertyNasdaq() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nyse" + */ + public function testPropertyNyse() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMarketStatus200ResponseIndicesGroupsTest.php b/test/Model/GetMarketStatus200ResponseIndicesGroupsTest.php new file mode 100644 index 0000000..549747c --- /dev/null +++ b/test/Model/GetMarketStatus200ResponseIndicesGroupsTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cccy" + */ + public function testPropertyCccy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dow_jones" + */ + public function testPropertyDowJones() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ftse_russell" + */ + public function testPropertyFtseRussell() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msci" + */ + public function testPropertyMsci() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mstar" + */ + public function testPropertyMstar() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mstarc" + */ + public function testPropertyMstarc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nasdaq" + */ + public function testPropertyNasdaq() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s_and_p" + */ + public function testPropertySAndP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "societe_generale" + */ + public function testPropertySocieteGenerale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMarketStatus200ResponseTest.php b/test/Model/GetMarketStatus200ResponseTest.php new file mode 100644 index 0000000..f4d16bf --- /dev/null +++ b/test/Model/GetMarketStatus200ResponseTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currencies" + */ + public function testPropertyCurrencies() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "early_hours" + */ + public function testPropertyEarlyHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchanges" + */ + public function testPropertyExchanges() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indices_groups" + */ + public function testPropertyIndicesGroups() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "server_time" + */ + public function testPropertyServerTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetOptionsContract200ResponseTest.php b/test/Model/GetOptionsContract200ResponseTest.php new file mode 100644 index 0000000..8bd6ae5 --- /dev/null +++ b/test/Model/GetOptionsContract200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetTicker200ResponseResultsAddressTest.php b/test/Model/GetTicker200ResponseResultsAddressTest.php new file mode 100644 index 0000000..d0cefa3 --- /dev/null +++ b/test/Model/GetTicker200ResponseResultsAddressTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address1" + */ + public function testPropertyAddress1() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "city" + */ + public function testPropertyCity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "postal_code" + */ + public function testPropertyPostalCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "state" + */ + public function testPropertyState() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetTicker200ResponseResultsBrandingTest.php b/test/Model/GetTicker200ResponseResultsBrandingTest.php new file mode 100644 index 0000000..62978e2 --- /dev/null +++ b/test/Model/GetTicker200ResponseResultsBrandingTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "icon_url" + */ + public function testPropertyIconUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo_url" + */ + public function testPropertyLogoUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetTicker200ResponseResultsTest.php b/test/Model/GetTicker200ResponseResultsTest.php new file mode 100644 index 0000000..d3f67ab --- /dev/null +++ b/test/Model/GetTicker200ResponseResultsTest.php @@ -0,0 +1,324 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "active" + */ + public function testPropertyActive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "branding" + */ + public function testPropertyBranding() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "composite_figi" + */ + public function testPropertyCompositeFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency_name" + */ + public function testPropertyCurrencyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "delisted_utc" + */ + public function testPropertyDelistedUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "homepage_url" + */ + public function testPropertyHomepageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "list_date" + */ + public function testPropertyListDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "locale" + */ + public function testPropertyLocale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_cap" + */ + public function testPropertyMarketCap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone_number" + */ + public function testPropertyPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "primary_exchange" + */ + public function testPropertyPrimaryExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "round_lot" + */ + public function testPropertyRoundLot() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_class_figi" + */ + public function testPropertyShareClassFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_class_shares_outstanding" + */ + public function testPropertyShareClassSharesOutstanding() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sic_code" + */ + public function testPropertySicCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sic_description" + */ + public function testPropertySicDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker_root" + */ + public function testPropertyTickerRoot() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker_suffix" + */ + public function testPropertyTickerSuffix() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_employees" + */ + public function testPropertyTotalEmployees() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "weighted_shares_outstanding" + */ + public function testPropertyWeightedSharesOutstanding() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetTicker200ResponseTest.php b/test/Model/GetTicker200ResponseTest.php new file mode 100644 index 0000000..201d5ee --- /dev/null +++ b/test/Model/GetTicker200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndexAggsBaseTest.php b/test/Model/IndexAggsBaseTest.php new file mode 100644 index 0000000..2e06cce --- /dev/null +++ b/test/Model/IndexAggsBaseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesGroupedResultsTest.php b/test/Model/IndicesGroupedResultsTest.php new file mode 100644 index 0000000..52f5174 --- /dev/null +++ b/test/Model/IndicesGroupedResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesOpenCloseTest.php b/test/Model/IndicesOpenCloseTest.php new file mode 100644 index 0000000..16957be --- /dev/null +++ b/test/Model/IndicesOpenCloseTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pre_market" + */ + public function testPropertyPreMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesSnapshot200ResponseResultsInnerSessionTest.php b/test/Model/IndicesSnapshot200ResponseResultsInnerSessionTest.php new file mode 100644 index 0000000..2a247bf --- /dev/null +++ b/test/Model/IndicesSnapshot200ResponseResultsInnerSessionTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change" + */ + public function testPropertyChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change_percent" + */ + public function testPropertyChangePercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "previous_close" + */ + public function testPropertyPreviousClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesSnapshot200ResponseResultsInnerTest.php b/test/Model/IndicesSnapshot200ResponseResultsInnerTest.php new file mode 100644 index 0000000..54794d2 --- /dev/null +++ b/test/Model/IndicesSnapshot200ResponseResultsInnerTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_status" + */ + public function testPropertyMarketStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "session" + */ + public function testPropertySession() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesSnapshot200ResponseTest.php b/test/Model/IndicesSnapshot200ResponseTest.php new file mode 100644 index 0000000..c0625a8 --- /dev/null +++ b/test/Model/IndicesSnapshot200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesTickerResultsResultsInnerTest.php b/test/Model/IndicesTickerResultsResultsInnerTest.php new file mode 100644 index 0000000..8604851 --- /dev/null +++ b/test/Model/IndicesTickerResultsResultsInnerTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IndicesTickerResultsTest.php b/test/Model/IndicesTickerResultsTest.php new file mode 100644 index 0000000..8d9f080 --- /dev/null +++ b/test/Model/IndicesTickerResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastQuote200ResponseResultsTest.php b/test/Model/LastQuote200ResponseResultsTest.php new file mode 100644 index 0000000..fa8764f --- /dev/null +++ b/test/Model/LastQuote200ResponseResultsTest.php @@ -0,0 +1,213 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ +/* + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +/* + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + /* + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + /** + * Test attribute "x" + */ +/* + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastQuote200ResponseTest.php b/test/Model/LastQuote200ResponseTest.php new file mode 100644 index 0000000..cc84158 --- /dev/null +++ b/test/Model/LastQuote200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastQuoteCurrencies200ResponseTest.php b/test/Model/LastQuoteCurrencies200ResponseTest.php new file mode 100644 index 0000000..b7a8980 --- /dev/null +++ b/test/Model/LastQuoteCurrencies200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastTradeCrypto200ResponseLastTest.php b/test/Model/LastTradeCrypto200ResponseLastTest.php new file mode 100644 index 0000000..e462be4 --- /dev/null +++ b/test/Model/LastTradeCrypto200ResponseLastTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastTradeCrypto200ResponseTest.php b/test/Model/LastTradeCrypto200ResponseTest.php new file mode 100644 index 0000000..b48d944 --- /dev/null +++ b/test/Model/LastTradeCrypto200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastTradeOptions200ResponseResultsTest.php b/test/Model/LastTradeOptions200ResponseResultsTest.php new file mode 100644 index 0000000..55436cd --- /dev/null +++ b/test/Model/LastTradeOptions200ResponseResultsTest.php @@ -0,0 +1,200 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "e" + */ + public function testPropertyE() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "r" + */ + public function testPropertyR() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LastTradeOptions200ResponseTest.php b/test/Model/LastTradeOptions200ResponseTest.php new file mode 100644 index 0000000..4d74cfc --- /dev/null +++ b/test/Model/LastTradeOptions200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseResultsInnerSipMappingTest.php b/test/Model/ListConditions200ResponseResultsInnerSipMappingTest.php new file mode 100644 index 0000000..476e764 --- /dev/null +++ b/test/Model/ListConditions200ResponseResultsInnerSipMappingTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cta" + */ + public function testPropertyCta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "opra" + */ + public function testPropertyOpra() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "utp" + */ + public function testPropertyUtp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseResultsInnerTest.php b/test/Model/ListConditions200ResponseResultsInnerTest.php new file mode 100644 index 0000000..72488bd --- /dev/null +++ b/test/Model/ListConditions200ResponseResultsInnerTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abbreviation" + */ + public function testPropertyAbbreviation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_class" + */ + public function testPropertyAssetClass() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data_types" + */ + public function testPropertyDataTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "legacy" + */ + public function testPropertyLegacy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_mapping" + */ + public function testPropertySipMapping() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "update_rules" + */ + public function testPropertyUpdateRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidatedTest.php b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidatedTest.php new file mode 100644 index 0000000..54cb139 --- /dev/null +++ b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesConsolidatedTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_high_low" + */ + public function testPropertyUpdatesHighLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_open_close" + */ + public function testPropertyUpdatesOpenClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_volume" + */ + public function testPropertyUpdatesVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenterTest.php b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenterTest.php new file mode 100644 index 0000000..fae4e76 --- /dev/null +++ b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesMarketCenterTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_high_low" + */ + public function testPropertyUpdatesHighLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_open_close" + */ + public function testPropertyUpdatesOpenClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updates_volume" + */ + public function testPropertyUpdatesVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseResultsInnerUpdateRulesTest.php b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesTest.php new file mode 100644 index 0000000..eec7d0a --- /dev/null +++ b/test/Model/ListConditions200ResponseResultsInnerUpdateRulesTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "consolidated" + */ + public function testPropertyConsolidated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_center" + */ + public function testPropertyMarketCenter() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions200ResponseTest.php b/test/Model/ListConditions200ResponseTest.php new file mode 100644 index 0000000..1e81669 --- /dev/null +++ b/test/Model/ListConditions200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListConditions400ResponseTest.php b/test/Model/ListConditions400ResponseTest.php new file mode 100644 index 0000000..ed0b480 --- /dev/null +++ b/test/Model/ListConditions400ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListDividends200ResponseResultsInnerTest.php b/test/Model/ListDividends200ResponseResultsInnerTest.php new file mode 100644 index 0000000..ea58c69 --- /dev/null +++ b/test/Model/ListDividends200ResponseResultsInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_amount" + */ + public function testPropertyCashAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "declaration_date" + */ + public function testPropertyDeclarationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dividend_type" + */ + public function testPropertyDividendType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ex_dividend_date" + */ + public function testPropertyExDividendDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "frequency" + */ + public function testPropertyFrequency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pay_date" + */ + public function testPropertyPayDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "record_date" + */ + public function testPropertyRecordDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListDividends200ResponseTest.php b/test/Model/ListDividends200ResponseTest.php new file mode 100644 index 0000000..c493bd2 --- /dev/null +++ b/test/Model/ListDividends200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListExchanges200ResponseResultsInnerTest.php b/test/Model/ListExchanges200ResponseResultsInnerTest.php new file mode 100644 index 0000000..299e2ef --- /dev/null +++ b/test/Model/ListExchanges200ResponseResultsInnerTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "acronym" + */ + public function testPropertyAcronym() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_class" + */ + public function testPropertyAssetClass() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "locale" + */ + public function testPropertyLocale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mic" + */ + public function testPropertyMic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operating_mic" + */ + public function testPropertyOperatingMic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_id" + */ + public function testPropertyParticipantId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListExchanges200ResponseTest.php b/test/Model/ListExchanges200ResponseTest.php new file mode 100644 index 0000000..2044075 --- /dev/null +++ b/test/Model/ListExchanges200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListExchanges400ResponseTest.php b/test/Model/ListExchanges400ResponseTest.php new file mode 100644 index 0000000..610b875 --- /dev/null +++ b/test/Model/ListExchanges400ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilingFiles200ResponseResultsInnerTest.php b/test/Model/ListFilingFiles200ResponseResultsInnerTest.php new file mode 100644 index 0000000..016631d --- /dev/null +++ b/test/Model/ListFilingFiles200ResponseResultsInnerTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filename" + */ + public function testPropertyFilename() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sequence" + */ + public function testPropertySequence() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size_bytes" + */ + public function testPropertySizeBytes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source_url" + */ + public function testPropertySourceUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilingFiles200ResponseTest.php b/test/Model/ListFilingFiles200ResponseTest.php new file mode 100644 index 0000000..f6d33cd --- /dev/null +++ b/test/Model/ListFilingFiles200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyDataTest.php b/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyDataTest.php new file mode 100644 index 0000000..1649a68 --- /dev/null +++ b/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerCompanyDataTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sic" + */ + public function testPropertySic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerTest.php b/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerTest.php new file mode 100644 index 0000000..7a15ce3 --- /dev/null +++ b/test/Model/ListFilings200ResponseResultsInnerEntitiesInnerTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company_data" + */ + public function testPropertyCompanyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relation" + */ + public function testPropertyRelation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilings200ResponseResultsInnerTest.php b/test/Model/ListFilings200ResponseResultsInnerTest.php new file mode 100644 index 0000000..bd5b40f --- /dev/null +++ b/test/Model/ListFilings200ResponseResultsInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "acceptance_datetime" + */ + public function testPropertyAcceptanceDatetime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "accession_number" + */ + public function testPropertyAccessionNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entities" + */ + public function testPropertyEntities() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "files_count" + */ + public function testPropertyFilesCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filing_date" + */ + public function testPropertyFilingDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "period_of_report_date" + */ + public function testPropertyPeriodOfReportDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source_url" + */ + public function testPropertySourceUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilings200ResponseTest.php b/test/Model/ListFilings200ResponseTest.php new file mode 100644 index 0000000..39e514f --- /dev/null +++ b/test/Model/ListFilings200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheetTest.php b/test/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheetTest.php new file mode 100644 index 0000000..0d73e9f --- /dev/null +++ b/test/Model/ListFinancials200ResponseResultsInnerFinancialsBalanceSheetTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "" + */ + public function testProperty() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFinancials200ResponseResultsInnerFinancialsTest.php b/test/Model/ListFinancials200ResponseResultsInnerFinancialsTest.php new file mode 100644 index 0000000..6914b94 --- /dev/null +++ b/test/Model/ListFinancials200ResponseResultsInnerFinancialsTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "balance_sheet" + */ + public function testPropertyBalanceSheet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_flow_statement" + */ + public function testPropertyCashFlowStatement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comprehensive_income" + */ + public function testPropertyComprehensiveIncome() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "income_statement" + */ + public function testPropertyIncomeStatement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFinancials200ResponseResultsInnerTest.php b/test/Model/ListFinancials200ResponseResultsInnerTest.php new file mode 100644 index 0000000..882ed33 --- /dev/null +++ b/test/Model/ListFinancials200ResponseResultsInnerTest.php @@ -0,0 +1,198 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "acceptance_datetime" + */ + public function testPropertyAcceptanceDatetime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company_name" + */ + public function testPropertyCompanyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "end_date" + */ + public function testPropertyEndDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filing_date" + */ + public function testPropertyFilingDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "financials" + */ + public function testPropertyFinancials() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fiscal_period" + */ + public function testPropertyFiscalPeriod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fiscal_year" + */ + public function testPropertyFiscalYear() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source_filing_file_url" + */ + public function testPropertySourceFilingFileUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source_filing_url" + */ + public function testPropertySourceFilingUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "start_date" + */ + public function testPropertyStartDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFinancials200ResponseTest.php b/test/Model/ListFinancials200ResponseTest.php new file mode 100644 index 0000000..7ee44fb --- /dev/null +++ b/test/Model/ListFinancials200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListNews200ResponseResultsInnerPublisherTest.php b/test/Model/ListNews200ResponseResultsInnerPublisherTest.php new file mode 100644 index 0000000..e4fd348 --- /dev/null +++ b/test/Model/ListNews200ResponseResultsInnerPublisherTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "favicon_url" + */ + public function testPropertyFaviconUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "homepage_url" + */ + public function testPropertyHomepageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo_url" + */ + public function testPropertyLogoUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListNews200ResponseResultsInnerTest.php b/test/Model/ListNews200ResponseResultsInnerTest.php new file mode 100644 index 0000000..c61e0c2 --- /dev/null +++ b/test/Model/ListNews200ResponseResultsInnerTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "amp_url" + */ + public function testPropertyAmpUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "article_url" + */ + public function testPropertyArticleUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "author" + */ + public function testPropertyAuthor() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "image_url" + */ + public function testPropertyImageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keywords" + */ + public function testPropertyKeywords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "published_utc" + */ + public function testPropertyPublishedUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "publisher" + */ + public function testPropertyPublisher() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListNews200ResponseTest.php b/test/Model/ListNews200ResponseTest.php new file mode 100644 index 0000000..64b91e7 --- /dev/null +++ b/test/Model/ListNews200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListNewsPublishedUtcParameterTest.php b/test/Model/ListNewsPublishedUtcParameterTest.php new file mode 100644 index 0000000..1571ed7 --- /dev/null +++ b/test/Model/ListNewsPublishedUtcParameterTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInnerTest.php b/test/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInnerTest.php new file mode 100644 index 0000000..f1cb180 --- /dev/null +++ b/test/Model/ListOptionsContracts200ResponseResultsInnerAdditionalUnderlyingsInnerTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "amount" + */ + public function testPropertyAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying" + */ + public function testPropertyUnderlying() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListOptionsContracts200ResponseResultsInnerTest.php b/test/Model/ListOptionsContracts200ResponseResultsInnerTest.php new file mode 100644 index 0000000..d5cc20e --- /dev/null +++ b/test/Model/ListOptionsContracts200ResponseResultsInnerTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "additional_underlyings" + */ + public function testPropertyAdditionalUnderlyings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cfi" + */ + public function testPropertyCfi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contract_type" + */ + public function testPropertyContractType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "correction" + */ + public function testPropertyCorrection() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exercise_style" + */ + public function testPropertyExerciseStyle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "primary_exchange" + */ + public function testPropertyPrimaryExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shares_per_contract" + */ + public function testPropertySharesPerContract() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strike_price" + */ + public function testPropertyStrikePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying_ticker" + */ + public function testPropertyUnderlyingTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListOptionsContracts200ResponseTest.php b/test/Model/ListOptionsContracts200ResponseTest.php new file mode 100644 index 0000000..eeecef6 --- /dev/null +++ b/test/Model/ListOptionsContracts200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListStockSplits200ResponseResultsInnerTest.php b/test/Model/ListStockSplits200ResponseResultsInnerTest.php new file mode 100644 index 0000000..71b8be7 --- /dev/null +++ b/test/Model/ListStockSplits200ResponseResultsInnerTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "execution_date" + */ + public function testPropertyExecutionDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "split_from" + */ + public function testPropertySplitFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "split_to" + */ + public function testPropertySplitTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListStockSplits200ResponseTest.php b/test/Model/ListStockSplits200ResponseTest.php new file mode 100644 index 0000000..d86e24c --- /dev/null +++ b/test/Model/ListStockSplits200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickerTaxonomyClassifications200ResponseResultsInnerTest.php b/test/Model/ListTickerTaxonomyClassifications200ResponseResultsInnerTest.php new file mode 100644 index 0000000..68ae5fd --- /dev/null +++ b/test/Model/ListTickerTaxonomyClassifications200ResponseResultsInnerTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "category" + */ + public function testPropertyCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reason" + */ + public function testPropertyReason() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevance" + */ + public function testPropertyRelevance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tag" + */ + public function testPropertyTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickerTaxonomyClassifications200ResponseTest.php b/test/Model/ListTickerTaxonomyClassifications200ResponseTest.php new file mode 100644 index 0000000..0ce21cc --- /dev/null +++ b/test/Model/ListTickerTaxonomyClassifications200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickerTypes200ResponseResultsInnerTest.php b/test/Model/ListTickerTypes200ResponseResultsInnerTest.php new file mode 100644 index 0000000..23026b5 --- /dev/null +++ b/test/Model/ListTickerTypes200ResponseResultsInnerTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_class" + */ + public function testPropertyAssetClass() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "locale" + */ + public function testPropertyLocale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickerTypes200ResponseTest.php b/test/Model/ListTickerTypes200ResponseTest.php new file mode 100644 index 0000000..f94a9d8 --- /dev/null +++ b/test/Model/ListTickerTypes200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickers200ResponseResultsInnerTest.php b/test/Model/ListTickers200ResponseResultsInnerTest.php new file mode 100644 index 0000000..d9cb572 --- /dev/null +++ b/test/Model/ListTickers200ResponseResultsInnerTest.php @@ -0,0 +1,198 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "active" + */ + public function testPropertyActive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "composite_figi" + */ + public function testPropertyCompositeFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency_name" + */ + public function testPropertyCurrencyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "delisted_utc" + */ + public function testPropertyDelistedUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated_utc" + */ + public function testPropertyLastUpdatedUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "locale" + */ + public function testPropertyLocale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "primary_exchange" + */ + public function testPropertyPrimaryExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share_class_figi" + */ + public function testPropertyShareClassFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListTickers200ResponseTest.php b/test/Model/ListTickers200ResponseTest.php new file mode 100644 index 0000000..a6b9676 --- /dev/null +++ b/test/Model/ListTickers200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LocalesResultsInnerTest.php b/test/Model/LocalesResultsInnerTest.php new file mode 100644 index 0000000..7da93ac --- /dev/null +++ b/test/Model/LocalesResultsInnerTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "locale" + */ + public function testPropertyLocale() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LocalesTest.php b/test/Model/LocalesTest.php new file mode 100644 index 0000000..fb76de3 --- /dev/null +++ b/test/Model/LocalesTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MapKeyTest.php b/test/Model/MapKeyTest.php new file mode 100644 index 0000000..fcf8423 --- /dev/null +++ b/test/Model/MapKeyTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MapTest.php b/test/Model/MapTest.php new file mode 100644 index 0000000..51d9964 --- /dev/null +++ b/test/Model/MapTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketHolidayInnerTest.php b/test/Model/MarketHolidayInnerTest.php new file mode 100644 index 0000000..44ec8a0 --- /dev/null +++ b/test/Model/MarketHolidayInnerTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketStatusCurrenciesTest.php b/test/Model/MarketStatusCurrenciesTest.php new file mode 100644 index 0000000..413f7e9 --- /dev/null +++ b/test/Model/MarketStatusCurrenciesTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "crypto" + */ + public function testPropertyCrypto() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fx" + */ + public function testPropertyFx() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketStatusExchangesTest.php b/test/Model/MarketStatusExchangesTest.php new file mode 100644 index 0000000..dde8ecc --- /dev/null +++ b/test/Model/MarketStatusExchangesTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nasdaq" + */ + public function testPropertyNasdaq() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nyse" + */ + public function testPropertyNyse() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketStatusTest.php b/test/Model/MarketStatusTest.php new file mode 100644 index 0000000..27e6709 --- /dev/null +++ b/test/Model/MarketStatusTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currencies" + */ + public function testPropertyCurrencies() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "early_hours" + */ + public function testPropertyEarlyHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchanges" + */ + public function testPropertyExchanges() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "server_time" + */ + public function testPropertyServerTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketsResultsInnerTest.php b/test/Model/MarketsResultsInnerTest.php new file mode 100644 index 0000000..0195ee4 --- /dev/null +++ b/test/Model/MarketsResultsInnerTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "desc" + */ + public function testPropertyDesc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market" + */ + public function testPropertyMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketsTest.php b/test/Model/MarketsTest.php new file mode 100644 index 0000000..30368b5 --- /dev/null +++ b/test/Model/MarketsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NewsInnerTest.php b/test/Model/NewsInnerTest.php new file mode 100644 index 0000000..92a4a80 --- /dev/null +++ b/test/Model/NewsInnerTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "image" + */ + public function testPropertyImage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keywords" + */ + public function testPropertyKeywords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source" + */ + public function testPropertySource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "summary" + */ + public function testPropertySummary() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbols" + */ + public function testPropertySymbols() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionContract200ResponseTest.php b/test/Model/OptionContract200ResponseTest.php new file mode 100644 index 0000000..82a0eeb --- /dev/null +++ b/test/Model/OptionContract200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseResultsInnerDayTest.php b/test/Model/OptionsChain200ResponseResultsInnerDayTest.php new file mode 100644 index 0000000..d1ac5cd --- /dev/null +++ b/test/Model/OptionsChain200ResponseResultsInnerDayTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change" + */ + public function testPropertyChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change_percent" + */ + public function testPropertyChangePercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "previous_close" + */ + public function testPropertyPreviousClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "volume" + */ + public function testPropertyVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vwap" + */ + public function testPropertyVwap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseResultsInnerDetailsTest.php b/test/Model/OptionsChain200ResponseResultsInnerDetailsTest.php new file mode 100644 index 0000000..1cfe8c2 --- /dev/null +++ b/test/Model/OptionsChain200ResponseResultsInnerDetailsTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contract_type" + */ + public function testPropertyContractType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exercise_style" + */ + public function testPropertyExerciseStyle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shares_per_contract" + */ + public function testPropertySharesPerContract() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strike_price" + */ + public function testPropertyStrikePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseResultsInnerLastQuoteTest.php b/test/Model/OptionsChain200ResponseResultsInnerLastQuoteTest.php new file mode 100644 index 0000000..16883a2 --- /dev/null +++ b/test/Model/OptionsChain200ResponseResultsInnerLastQuoteTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask" + */ + public function testPropertyAsk() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_exchange" + */ + public function testPropertyAskExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_size" + */ + public function testPropertyAskSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid" + */ + public function testPropertyBid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_exchange" + */ + public function testPropertyBidExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_size" + */ + public function testPropertyBidSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "midpoint" + */ + public function testPropertyMidpoint() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseResultsInnerLastTradeTest.php b/test/Model/OptionsChain200ResponseResultsInnerLastTradeTest.php new file mode 100644 index 0000000..8b62f05 --- /dev/null +++ b/test/Model/OptionsChain200ResponseResultsInnerLastTradeTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseResultsInnerTest.php b/test/Model/OptionsChain200ResponseResultsInnerTest.php new file mode 100644 index 0000000..78a2c07 --- /dev/null +++ b/test/Model/OptionsChain200ResponseResultsInnerTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "break_even_price" + */ + public function testPropertyBreakEvenPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "details" + */ + public function testPropertyDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fmv" + */ + public function testPropertyFmv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "greeks" + */ + public function testPropertyGreeks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "implied_volatility" + */ + public function testPropertyImpliedVolatility() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_quote" + */ + public function testPropertyLastQuote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_trade" + */ + public function testPropertyLastTrade() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open_interest" + */ + public function testPropertyOpenInterest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying_asset" + */ + public function testPropertyUnderlyingAsset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OptionsChain200ResponseTest.php b/test/Model/OptionsChain200ResponseTest.php new file mode 100644 index 0000000..2b44182 --- /dev/null +++ b/test/Model/OptionsChain200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaginationHooksBaseTest.php b/test/Model/PaginationHooksBaseTest.php new file mode 100644 index 0000000..3fd49e4 --- /dev/null +++ b/test/Model/PaginationHooksBaseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Quotes200ResponseResultsInnerTest.php b/test/Model/Quotes200ResponseResultsInnerTest.php new file mode 100644 index 0000000..93a639a --- /dev/null +++ b/test/Model/Quotes200ResponseResultsInnerTest.php @@ -0,0 +1,198 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_exchange" + */ + public function testPropertyAskExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_price" + */ + public function testPropertyAskPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_size" + */ + public function testPropertyAskSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_exchange" + */ + public function testPropertyBidExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_price" + */ + public function testPropertyBidPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_size" + */ + public function testPropertyBidSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indicators" + */ + public function testPropertyIndicators() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sequence_number" + */ + public function testPropertySequenceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tape" + */ + public function testPropertyTape() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trf_timestamp" + */ + public function testPropertyTrfTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Quotes200ResponseTest.php b/test/Model/Quotes200ResponseTest.php new file mode 100644 index 0000000..b3f31ba --- /dev/null +++ b/test/Model/Quotes200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/QuotesFx200ResponseResultsInnerTest.php b/test/Model/QuotesFx200ResponseResultsInnerTest.php new file mode 100644 index 0000000..17b6e30 --- /dev/null +++ b/test/Model/QuotesFx200ResponseResultsInnerTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_exchange" + */ + public function testPropertyAskExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_price" + */ + public function testPropertyAskPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_exchange" + */ + public function testPropertyBidExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_price" + */ + public function testPropertyBidPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/QuotesFx200ResponseTest.php b/test/Model/QuotesFx200ResponseTest.php new file mode 100644 index 0000000..3402d6a --- /dev/null +++ b/test/Model/QuotesFx200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/QuotesOptions200ResponseResultsInnerTest.php b/test/Model/QuotesOptions200ResponseResultsInnerTest.php new file mode 100644 index 0000000..c8ac4f7 --- /dev/null +++ b/test/Model/QuotesOptions200ResponseResultsInnerTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_exchange" + */ + public function testPropertyAskExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_price" + */ + public function testPropertyAskPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_size" + */ + public function testPropertyAskSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_exchange" + */ + public function testPropertyBidExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_price" + */ + public function testPropertyBidPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_size" + */ + public function testPropertyBidSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sequence_number" + */ + public function testPropertySequenceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/QuotesOptions200ResponseTest.php b/test/Model/QuotesOptions200ResponseTest.php new file mode 100644 index 0000000..b2f20d3 --- /dev/null +++ b/test/Model/QuotesOptions200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RatingSectionTest.php b/test/Model/RatingSectionTest.php new file mode 100644 index 0000000..af03b90 --- /dev/null +++ b/test/Model/RatingSectionTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current" + */ + public function testPropertyCurrent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "month1" + */ + public function testPropertyMonth1() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "month2" + */ + public function testPropertyMonth2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "month3" + */ + public function testPropertyMonth3() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "month4" + */ + public function testPropertyMonth4() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "month5" + */ + public function testPropertyMonth5() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeCurrencyConversion200ResponseLastTest.php b/test/Model/RealTimeCurrencyConversion200ResponseLastTest.php new file mode 100644 index 0000000..0a54424 --- /dev/null +++ b/test/Model/RealTimeCurrencyConversion200ResponseLastTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask" + */ + public function testPropertyAsk() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid" + */ + public function testPropertyBid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeCurrencyConversion200ResponseTest.php b/test/Model/RealTimeCurrencyConversion200ResponseTest.php new file mode 100644 index 0000000..aefd922 --- /dev/null +++ b/test/Model/RealTimeCurrencyConversion200ResponseTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "converted" + */ + public function testPropertyConverted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "initial_amount" + */ + public function testPropertyInitialAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last" + */ + public function testPropertyLast() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RequestIdBaseTest.php b/test/Model/RequestIdBaseTest.php new file mode 100644 index 0000000..095b2b5 --- /dev/null +++ b/test/Model/RequestIdBaseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotMinOHLCVTest.php b/test/Model/SnapshotMinOHLCVTest.php new file mode 100644 index 0000000..3545a23 --- /dev/null +++ b/test/Model/SnapshotMinOHLCVTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotOHLCVTest.php b/test/Model/SnapshotOHLCVTest.php new file mode 100644 index 0000000..d73a39e --- /dev/null +++ b/test/Model/SnapshotOHLCVTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotOHLCVVWOtcTest.php b/test/Model/SnapshotOHLCVVWOtcTest.php new file mode 100644 index 0000000..f515436 --- /dev/null +++ b/test/Model/SnapshotOHLCVVWOtcTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotOHLCVVWTest.php b/test/Model/SnapshotOHLCVVWTest.php new file mode 100644 index 0000000..af14491 --- /dev/null +++ b/test/Model/SnapshotOHLCVVWTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotSummary200ResponseResultsInnerBrandingTest.php b/test/Model/SnapshotSummary200ResponseResultsInnerBrandingTest.php new file mode 100644 index 0000000..22bf855 --- /dev/null +++ b/test/Model/SnapshotSummary200ResponseResultsInnerBrandingTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "icon_url" + */ + public function testPropertyIconUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo_url" + */ + public function testPropertyLogoUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotSummary200ResponseResultsInnerOptionsTest.php b/test/Model/SnapshotSummary200ResponseResultsInnerOptionsTest.php new file mode 100644 index 0000000..67508bc --- /dev/null +++ b/test/Model/SnapshotSummary200ResponseResultsInnerOptionsTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contract_type" + */ + public function testPropertyContractType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exercise_style" + */ + public function testPropertyExerciseStyle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shares_per_contract" + */ + public function testPropertySharesPerContract() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strike_price" + */ + public function testPropertyStrikePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying_ticker" + */ + public function testPropertyUnderlyingTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotSummary200ResponseResultsInnerSessionTest.php b/test/Model/SnapshotSummary200ResponseResultsInnerSessionTest.php new file mode 100644 index 0000000..c9cf244 --- /dev/null +++ b/test/Model/SnapshotSummary200ResponseResultsInnerSessionTest.php @@ -0,0 +1,198 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change" + */ + public function testPropertyChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change_percent" + */ + public function testPropertyChangePercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "early_trading_change" + */ + public function testPropertyEarlyTradingChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "early_trading_change_percent" + */ + public function testPropertyEarlyTradingChangePercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "late_trading_change" + */ + public function testPropertyLateTradingChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "late_trading_change_percent" + */ + public function testPropertyLateTradingChangePercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "previous_close" + */ + public function testPropertyPreviousClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "volume" + */ + public function testPropertyVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotSummary200ResponseResultsInnerTest.php b/test/Model/SnapshotSummary200ResponseResultsInnerTest.php new file mode 100644 index 0000000..ed6c53f --- /dev/null +++ b/test/Model/SnapshotSummary200ResponseResultsInnerTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "branding" + */ + public function testPropertyBranding() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_status" + */ + public function testPropertyMarketStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "options" + */ + public function testPropertyOptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "session" + */ + public function testPropertySession() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SnapshotSummary200ResponseTest.php b/test/Model/SnapshotSummary200ResponseTest.php new file mode 100644 index 0000000..bb46134 --- /dev/null +++ b/test/Model/SnapshotSummary200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerDetailsTest.php b/test/Model/Snapshots200ResponseResultsInnerDetailsTest.php new file mode 100644 index 0000000..2e8725e --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerDetailsTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "contract_type" + */ + public function testPropertyContractType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exercise_style" + */ + public function testPropertyExerciseStyle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shares_per_contract" + */ + public function testPropertySharesPerContract() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strike_price" + */ + public function testPropertyStrikePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerGreeksTest.php b/test/Model/Snapshots200ResponseResultsInnerGreeksTest.php new file mode 100644 index 0000000..b4e6995 --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerGreeksTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "delta" + */ + public function testPropertyDelta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gamma" + */ + public function testPropertyGamma() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "theta" + */ + public function testPropertyTheta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vega" + */ + public function testPropertyVega() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerLastQuoteTest.php b/test/Model/Snapshots200ResponseResultsInnerLastQuoteTest.php new file mode 100644 index 0000000..2466bac --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerLastQuoteTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask" + */ + public function testPropertyAsk() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_exchange" + */ + public function testPropertyAskExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_size" + */ + public function testPropertyAskSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid" + */ + public function testPropertyBid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_exchange" + */ + public function testPropertyBidExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_size" + */ + public function testPropertyBidSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "midpoint" + */ + public function testPropertyMidpoint() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerLastTradeTest.php b/test/Model/Snapshots200ResponseResultsInnerLastTradeTest.php new file mode 100644 index 0000000..e12e0a1 --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerLastTradeTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerTest.php b/test/Model/Snapshots200ResponseResultsInnerTest.php new file mode 100644 index 0000000..ff91e24 --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerTest.php @@ -0,0 +1,234 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "break_even_price" + */ + public function testPropertyBreakEvenPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "details" + */ + public function testPropertyDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fmv" + */ + public function testPropertyFmv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "greeks" + */ + public function testPropertyGreeks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "implied_volatility" + */ + public function testPropertyImpliedVolatility() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_quote" + */ + public function testPropertyLastQuote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_trade" + */ + public function testPropertyLastTrade() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "market_status" + */ + public function testPropertyMarketStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open_interest" + */ + public function testPropertyOpenInterest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "session" + */ + public function testPropertySession() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying_asset" + */ + public function testPropertyUnderlyingAsset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseResultsInnerUnderlyingAssetTest.php b/test/Model/Snapshots200ResponseResultsInnerUnderlyingAssetTest.php new file mode 100644 index 0000000..256b78a --- /dev/null +++ b/test/Model/Snapshots200ResponseResultsInnerUnderlyingAssetTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change_to_break_even" + */ + public function testPropertyChangeToBreakEven() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_updated" + */ + public function testPropertyLastUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Snapshots200ResponseTest.php b/test/Model/Snapshots200ResponseTest.php new file mode 100644 index 0000000..51c73c8 --- /dev/null +++ b/test/Model/Snapshots200ResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StandardBaseTest.php b/test/Model/StandardBaseTest.php new file mode 100644 index 0000000..dda650c --- /dev/null +++ b/test/Model/StandardBaseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatusBaseTest.php b/test/Model/StatusBaseTest.php new file mode 100644 index 0000000..74407d0 --- /dev/null +++ b/test/Model/StatusBaseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatusCountBaseTest.php b/test/Model/StatusCountBaseTest.php new file mode 100644 index 0000000..119c39b --- /dev/null +++ b/test/Model/StatusCountBaseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksGroupedResultsTest.php b/test/Model/StocksGroupedResultsTest.php new file mode 100644 index 0000000..3ffc78e --- /dev/null +++ b/test/Model/StocksGroupedResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksOpenCloseTest.php b/test/Model/StocksOpenCloseTest.php new file mode 100644 index 0000000..a2c522b --- /dev/null +++ b/test/Model/StocksOpenCloseTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pre_market" + */ + public function testPropertyPreMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "volume" + */ + public function testPropertyVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksSnapshotLastQuoteTest.php b/test/Model/StocksSnapshotLastQuoteTest.php new file mode 100644 index 0000000..f71f419 --- /dev/null +++ b/test/Model/StocksSnapshotLastQuoteTest.php @@ -0,0 +1,130 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ +/* + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "s" + */ +/* + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksSnapshotMinuteOTCTest.php b/test/Model/StocksSnapshotMinuteOTCTest.php new file mode 100644 index 0000000..154a17c --- /dev/null +++ b/test/Model/StocksSnapshotMinuteOTCTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "av" + */ + public function testPropertyAv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksSnapshotMinuteTest.php b/test/Model/StocksSnapshotMinuteTest.php new file mode 100644 index 0000000..8e3013d --- /dev/null +++ b/test/Model/StocksSnapshotMinuteTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "av" + */ + public function testPropertyAv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksSnapshotTickerTest.php b/test/Model/StocksSnapshotTickerTest.php new file mode 100644 index 0000000..430bbd3 --- /dev/null +++ b/test/Model/StocksSnapshotTickerTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksSnapshotTickersTest.php b/test/Model/StocksSnapshotTickersTest.php new file mode 100644 index 0000000..3532bae --- /dev/null +++ b/test/Model/StocksSnapshotTickersTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksTickerResultsOTCTest.php b/test/Model/StocksTickerResultsOTCTest.php new file mode 100644 index 0000000..b460ba9 --- /dev/null +++ b/test/Model/StocksTickerResultsOTCTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2BaseTest.php b/test/Model/StocksV2BaseTest.php new file mode 100644 index 0000000..30a2b97 --- /dev/null +++ b/test/Model/StocksV2BaseTest.php @@ -0,0 +1,128 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2NBBOAllOfXTest.php b/test/Model/StocksV2NBBOAllOfXTest.php new file mode 100644 index 0000000..11bb0a3 --- /dev/null +++ b/test/Model/StocksV2NBBOAllOfXTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2NBBOTest.php b/test/Model/StocksV2NBBOTest.php new file mode 100644 index 0000000..472d622 --- /dev/null +++ b/test/Model/StocksV2NBBOTest.php @@ -0,0 +1,215 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ +/* + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "s" + */ +/* + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "x" + */ +/* + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2NBBOsTest.php b/test/Model/StocksV2NBBOsTest.php new file mode 100644 index 0000000..51af60a --- /dev/null +++ b/test/Model/StocksV2NBBOsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2TradeTest.php b/test/Model/StocksV2TradeTest.php new file mode 100644 index 0000000..0effdb9 --- /dev/null +++ b/test/Model/StocksV2TradeTest.php @@ -0,0 +1,200 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "e" + */ + public function testPropertyE() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "r" + */ + public function testPropertyR() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StocksV2TradesTest.php b/test/Model/StocksV2TradesTest.php new file mode 100644 index 0000000..6061bfe --- /dev/null +++ b/test/Model/StocksV2TradesTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TickerBaseTest.php b/test/Model/TickerBaseTest.php new file mode 100644 index 0000000..ff7c099 --- /dev/null +++ b/test/Model/TickerBaseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TickerResultsTest.php b/test/Model/TickerResultsTest.php new file mode 100644 index 0000000..a05ce03 --- /dev/null +++ b/test/Model/TickerResultsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TradeDetailsMapItemTest.php b/test/Model/TradeDetailsMapItemTest.php new file mode 100644 index 0000000..bfe44ff --- /dev/null +++ b/test/Model/TradeDetailsMapItemTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Trades200ResponseResultsInnerTest.php b/test/Model/Trades200ResponseResultsInnerTest.php new file mode 100644 index 0000000..6d1cb05 --- /dev/null +++ b/test/Model/Trades200ResponseResultsInnerTest.php @@ -0,0 +1,189 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "correction" + */ + public function testPropertyCorrection() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sequence_number" + */ + public function testPropertySequenceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tape" + */ + public function testPropertyTape() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trf_id" + */ + public function testPropertyTrfId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trf_timestamp" + */ + public function testPropertyTrfTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Trades200ResponseTest.php b/test/Model/Trades200ResponseTest.php new file mode 100644 index 0000000..9d9fde5 --- /dev/null +++ b/test/Model/Trades200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TradesCrypto200ResponseResultsInnerTest.php b/test/Model/TradesCrypto200ResponseResultsInnerTest.php new file mode 100644 index 0000000..40c96fa --- /dev/null +++ b/test/Model/TradesCrypto200ResponseResultsInnerTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TradesCrypto200ResponseTest.php b/test/Model/TradesCrypto200ResponseTest.php new file mode 100644 index 0000000..a9647a9 --- /dev/null +++ b/test/Model/TradesCrypto200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TradesOptions200ResponseResultsInnerTest.php b/test/Model/TradesOptions200ResponseResultsInnerTest.php new file mode 100644 index 0000000..935a881 --- /dev/null +++ b/test/Model/TradesOptions200ResponseResultsInnerTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "correction" + */ + public function testPropertyCorrection() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "participant_timestamp" + */ + public function testPropertyParticipantTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sip_timestamp" + */ + public function testPropertySipTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TradesOptions200ResponseTest.php b/test/Model/TradesOptions200ResponseTest.php new file mode 100644 index 0000000..6e23488 --- /dev/null +++ b/test/Model/TradesOptions200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInnerTest.php b/test/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInnerTest.php new file mode 100644 index 0000000..c4bd4bd --- /dev/null +++ b/test/Model/V1HistoricCryptoFromToDateGet200ResponseAllOfTicksInnerTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1HistoricCryptoFromToDateGet200ResponseTest.php b/test/Model/V1HistoricCryptoFromToDateGet200ResponseTest.php new file mode 100644 index 0000000..4d8ffad --- /dev/null +++ b/test/Model/V1HistoricCryptoFromToDateGet200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "map" + */ + public function testPropertyMap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ms_latency" + */ + public function testPropertyMsLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticks" + */ + public function testPropertyTicks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInnerTest.php b/test/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInnerTest.php new file mode 100644 index 0000000..349e149 --- /dev/null +++ b/test/Model/V1HistoricForexFromToDateGet200ResponseAllOfTicksInnerTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "a" + */ + public function testPropertyA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "b" + */ + public function testPropertyB() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1HistoricForexFromToDateGet200ResponseTest.php b/test/Model/V1HistoricForexFromToDateGet200ResponseTest.php new file mode 100644 index 0000000..93637f4 --- /dev/null +++ b/test/Model/V1HistoricForexFromToDateGet200ResponseTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "map" + */ + public function testPropertyMap() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ms_latency" + */ + public function testPropertyMsLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pair" + */ + public function testPropertyPair() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticks" + */ + public function testPropertyTicks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1LastBaseTest.php b/test/Model/V1LastBaseTest.php new file mode 100644 index 0000000..e73a9f7 --- /dev/null +++ b/test/Model/V1LastBaseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1OpenCloseCryptoFromToDateGet200ResponseTest.php b/test/Model/V1OpenCloseCryptoFromToDateGet200ResponseTest.php new file mode 100644 index 0000000..d14a9ad --- /dev/null +++ b/test/Model/V1OpenCloseCryptoFromToDateGet200ResponseTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "closing_trades" + */ + public function testPropertyClosingTrades() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_utc" + */ + public function testPropertyIsUtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open_trades" + */ + public function testPropertyOpenTrades() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1OpenCloseIndicesTickerDateGet200ResponseTest.php b/test/Model/V1OpenCloseIndicesTickerDateGet200ResponseTest.php new file mode 100644 index 0000000..2bbdcea --- /dev/null +++ b/test/Model/V1OpenCloseIndicesTickerDateGet200ResponseTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pre_market" + */ + public function testPropertyPreMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V1OpenCloseOptionsTickerDateGet200ResponseTest.php b/test/Model/V1OpenCloseOptionsTickerDateGet200ResponseTest.php new file mode 100644 index 0000000..fe82eaa --- /dev/null +++ b/test/Model/V1OpenCloseOptionsTickerDateGet200ResponseTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "after_hours" + */ + public function testPropertyAfterHours() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "close" + */ + public function testPropertyClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "high" + */ + public function testPropertyHigh() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "low" + */ + public function testPropertyLow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "open" + */ + public function testPropertyOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pre_market" + */ + public function testPropertyPreMarket() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "volume" + */ + public function testPropertyVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsBaseTest.php b/test/Model/V2AggsBaseTest.php new file mode 100644 index 0000000..f380014 --- /dev/null +++ b/test/Model/V2AggsBaseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..f11c93c --- /dev/null +++ b/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,164 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseTest.php b/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseTest.php new file mode 100644 index 0000000..86bf8d5 --- /dev/null +++ b/test/Model/V2AggsGroupedLocaleGlobalMarketCryptoDateGet200ResponseTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..0abc41c --- /dev/null +++ b/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,173 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseTest.php b/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseTest.php new file mode 100644 index 0000000..b6efd66 --- /dev/null +++ b/test/Model/V2AggsGroupedLocaleUsMarketStocksDateGet200ResponseTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerCryptoTickerPrevGet200ResponseTest.php b/test/Model/V2AggsTickerCryptoTickerPrevGet200ResponseTest.php new file mode 100644 index 0000000..6ca110b --- /dev/null +++ b/test/Model/V2AggsTickerCryptoTickerPrevGet200ResponseTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..76c5995 --- /dev/null +++ b/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseTest.php b/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseTest.php new file mode 100644 index 0000000..f817682 --- /dev/null +++ b/test/Model/V2AggsTickerCryptoTickerRangeMultiplierTimespanFromToGet200ResponseTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..ebbe066 --- /dev/null +++ b/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseTest.php b/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseTest.php new file mode 100644 index 0000000..828c7c5 --- /dev/null +++ b/test/Model/V2AggsTickerIndicesTickerPrevGet200ResponseTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..1f81c96 --- /dev/null +++ b/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseTest.php b/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseTest.php new file mode 100644 index 0000000..d8092a2 --- /dev/null +++ b/test/Model/V2AggsTickerStocksTickerRangeMultiplierTimespanFromToGet200ResponseTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "adjusted" + */ + public function testPropertyAdjusted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_count" + */ + public function testPropertyQueryCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_url" + */ + public function testPropertyNextUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2LastBaseTest.php b/test/Model/V2LastBaseTest.php new file mode 100644 index 0000000..92c8de2 --- /dev/null +++ b/test/Model/V2LastBaseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200ResponseTest.php new file mode 100644 index 0000000..bbcc3e6 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoDirectionGet200ResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDayTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDayTest.php new file mode 100644 index 0000000..5174f42 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerDayTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTradeTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTradeTest.php new file mode 100644 index 0000000..eea01c3 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerLastTradeTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMinTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMinTest.php new file mode 100644 index 0000000..abf87b3 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerMinTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDayTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDayTest.php new file mode 100644 index 0000000..38bd468 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerPrevDayTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerTest.php new file mode 100644 index 0000000..b405ca3 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseAllOfTickersInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fmv" + */ + public function testPropertyFmv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_trade" + */ + public function testPropertyLastTrade() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "min" + */ + public function testPropertyMin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_day" + */ + public function testPropertyPrevDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change" + */ + public function testPropertyTodaysChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change_perc" + */ + public function testPropertyTodaysChangePerc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseTest.php new file mode 100644 index 0000000..ec12026 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersGet200ResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInnerTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInnerTest.php new file mode 100644 index 0000000..f53a95a --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataAsksInnerTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataTest.php new file mode 100644 index 0000000..e2cad8c --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseAllOfDataTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ask_count" + */ + public function testPropertyAskCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asks" + */ + public function testPropertyAsks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bid_count" + */ + public function testPropertyBidCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bids" + */ + public function testPropertyBids() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "spread" + */ + public function testPropertySpread() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseTest.php new file mode 100644 index 0000000..284af0a --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerBookGet200ResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200ResponseTest.php new file mode 100644 index 0000000..dd50096 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsCryptoTickersTickerGet200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDayTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDayTest.php new file mode 100644 index 0000000..e1be4ba --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerDayTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php new file mode 100644 index 0000000..a855a0f --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "a" + */ + public function testPropertyA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "b" + */ + public function testPropertyB() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMinTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMinTest.php new file mode 100644 index 0000000..2970f43 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerMinTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerTest.php new file mode 100644 index 0000000..37d1d81 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseAllOfTickersInnerTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fmv" + */ + public function testPropertyFmv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_quote" + */ + public function testPropertyLastQuote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "min" + */ + public function testPropertyMin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_day" + */ + public function testPropertyPrevDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change" + */ + public function testPropertyTodaysChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change_perc" + */ + public function testPropertyTodaysChangePerc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseTest.php new file mode 100644 index 0000000..67d2c4d --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersGet200ResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200ResponseTest.php b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200ResponseTest.php new file mode 100644 index 0000000..c5d31a2 --- /dev/null +++ b/test/Model/V2SnapshotLocaleGlobalMarketsForexTickersTickerGet200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200ResponseTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200ResponseTest.php new file mode 100644 index 0000000..47fc5b1 --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksDirectionGet200ResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDayTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDayTest.php new file mode 100644 index 0000000..82ca4a7 --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerDayTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php new file mode 100644 index 0000000..2cb17e2 --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastQuoteTest.php @@ -0,0 +1,130 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ +/* + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "s" + */ +/* + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTradeTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTradeTest.php new file mode 100644 index 0000000..11a3a1b --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerLastTradeTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMinTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMinTest.php new file mode 100644 index 0000000..ffd67b0 --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerMinTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "av" + */ + public function testPropertyAv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "n" + */ + public function testPropertyN() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDayTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDayTest.php new file mode 100644 index 0000000..39983cf --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerPrevDayTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "h" + */ + public function testPropertyH() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "l" + */ + public function testPropertyL() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "o" + */ + public function testPropertyO() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "otc" + */ + public function testPropertyOtc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "v" + */ + public function testPropertyV() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vw" + */ + public function testPropertyVw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerTest.php new file mode 100644 index 0000000..68ef26a --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseAllOfTickersInnerTest.php @@ -0,0 +1,171 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "day" + */ + public function testPropertyDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fmv" + */ + public function testPropertyFmv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_quote" + */ + public function testPropertyLastQuote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_trade" + */ + public function testPropertyLastTrade() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "min" + */ + public function testPropertyMin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_day" + */ + public function testPropertyPrevDay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change" + */ + public function testPropertyTodaysChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "todays_change_perc" + */ + public function testPropertyTodaysChangePerc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated" + */ + public function testPropertyUpdated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseTest.php new file mode 100644 index 0000000..89869ca --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersGet200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickers" + */ + public function testPropertyTickers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200ResponseTest.php b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200ResponseTest.php new file mode 100644 index 0000000..84665ee --- /dev/null +++ b/test/Model/V2SnapshotLocaleUsMarketsStocksTickersStocksTickerGet200ResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "request_id" + */ + public function testPropertyRequestId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksBaseTest.php b/test/Model/V2TicksBaseTest.php new file mode 100644 index 0000000..67cfef0 --- /dev/null +++ b/test/Model/V2TicksBaseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "db_latency" + */ + public function testPropertyDbLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "success" + */ + public function testPropertySuccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfXTest.php b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfXTest.php new file mode 100644 index 0000000..14980f5 --- /dev/null +++ b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerAllOfXTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..e2bbd18 --- /dev/null +++ b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,213 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ +/* + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "s" + */ +/* + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + /** + * Test attribute "x" + */ +/* + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksStocksNbboTickerDateGet200ResponseTest.php b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseTest.php new file mode 100644 index 0000000..4e8afb2 --- /dev/null +++ b/test/Model/V2TicksStocksNbboTickerDateGet200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "db_latency" + */ + public function testPropertyDbLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "success" + */ + public function testPropertySuccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInnerTest.php b/test/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInnerTest.php new file mode 100644 index 0000000..62e478a --- /dev/null +++ b/test/Model/V2TicksStocksTradesTickerDateGet200ResponseAllOfResultsInnerTest.php @@ -0,0 +1,200 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "f" + */ + public function testPropertyF() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "q" + */ + public function testPropertyQ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ +/* + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +*/ + + /** + * Test attribute "y" + */ + public function testPropertyY() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "e" + */ + public function testPropertyE() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "i" + */ + public function testPropertyI() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p" + */ + public function testPropertyP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "r" + */ + public function testPropertyR() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "x" + */ + public function testPropertyX() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "z" + */ + public function testPropertyZ() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/V2TicksStocksTradesTickerDateGet200ResponseTest.php b/test/Model/V2TicksStocksTradesTickerDateGet200ResponseTest.php new file mode 100644 index 0000000..e6d84e2 --- /dev/null +++ b/test/Model/V2TicksStocksTradesTickerDateGet200ResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "db_latency" + */ + public function testPropertyDbLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results_count" + */ + public function testPropertyResultsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "success" + */ + public function testPropertySuccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/tests/Concerns/LoadsStub.php b/tests/Concerns/LoadsStub.php deleted file mode 100644 index 23797b5..0000000 --- a/tests/Concerns/LoadsStub.php +++ /dev/null @@ -1,26 +0,0 @@ -loadStubFile($filePath), true); - } -} diff --git a/tests/Concerns/MocksHttp.php b/tests/Concerns/MocksHttp.php deleted file mode 100644 index 144d545..0000000 --- a/tests/Concerns/MocksHttp.php +++ /dev/null @@ -1,34 +0,0 @@ -push($history); - - return new Client(['handler' => $handler]); - } - - private function assertPath($requests, $path) - { - $this->assertCount(1, $requests); - $this->assertEquals($path, $requests[0]['request']->getUri()->getPath()); - } -} diff --git a/tests/Rest/Common/MappersTest.php b/tests/Rest/Common/MappersTest.php deleted file mode 100644 index b8b82cb..0000000 --- a/tests/Rest/Common/MappersTest.php +++ /dev/null @@ -1,426 +0,0 @@ - 'dummyC', - 'bE' => 'dummyBE', - 'aE' => 'dummyAE', - 'aP' => 'dummyAP', - 'bP' => 'dummyBP', - 'bS' => 'dummyBS', - 'aS' => 'dummyAS', - 't' => 'dummyT', - ]; - - $expectedReturn = [ - 'c' => 'dummyC', - 'bE' => 'dummyBE', - 'aE' => 'dummyAE', - 'aP' => 'dummyAP', - 'bP' => 'dummyBP', - 'bS' => 'dummyBS', - 'aS' => 'dummyAS', - 't' => 'dummyT', - 'condition' => 'dummyC', - 'bidExchange' => 'dummyBE', - 'askExchange' => 'dummyAE', - 'askPrice' => 'dummyAP', - 'buyPrice' => 'dummyBP', - 'bidSize' => 'dummyBS', - 'askSize' => 'dummyAS', - 'timestamp' => 'dummyT', - ]; - - $actualReturn = Mappers::quoteV1($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testSnapshotQuote() - { - $tickData = [ - 'p' => 'dummyBidPrice', - 's' => 'dummyBidSize', - 'P' => 'dummyAskPrice', - 'S' => 'dummyAskSize', - 't' => 'dummyTimestamp', - ]; - - $expectedReturn = [ - 'p' => 'dummyBidPrice', - 's' => 'dummyBidSize', - 'P' => 'dummyAskPrice', - 'S' => 'dummyAskSize', - 't' => 'dummyTimestamp', - 'bidPrice' => 'dummyBidPrice', - 'bidSize' => 'dummyBidSize', - 'askPrice' => 'dummyAskPrice', - 'askSize' => 'dummyAskSize', - 'lastUpdateTimestamp' => 'dummyTimestamp', - ]; - - $actualReturn = Mappers::snapshotQuote($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testTradeV1() - { - $tickData = [ - 'c1' => 'dummyCondition1', - 'c2' => 'dummyCondition2', - 'c3' => 'dummyCondition3', - 'c4' => 'dummyCondition4', - 'e' => 'dummyExchange', - 'p' => 'dummyPrice', - 's' => 'dummySize', - 't' => 'dummyTimestamp', - ]; - - $expectedReturn = [ - 'c1' => 'dummyCondition1', - 'c2' => 'dummyCondition2', - 'c3' => 'dummyCondition3', - 'c4' => 'dummyCondition4', - 'e' => 'dummyExchange', - 'p' => 'dummyPrice', - 's' => 'dummySize', - 't' => 'dummyTimestamp', - 'condition1' => 'dummyCondition1', - 'condition2' => 'dummyCondition2', - 'condition3' => 'dummyCondition3', - 'condition4' => 'dummyCondition4', - 'exchange' => 'dummyExchange', - 'price' => 'dummyPrice', - 'size' => 'dummySize', - 'timestamp' => 'dummyTimestamp', - ]; - - $actualReturn = Mappers::tradeV1($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testSnapshotAgg() - { - $tickData = [ - 'c' => 'dummyClose', - 'h' => 'dummyHigh', - 'l' => 'dummyLow', - 'o' => 'dummyOpen', - 'v' => 'dummyVolume', - ]; - - $expectedReturn = [ - 'c' => 'dummyClose', - 'h' => 'dummyHigh', - 'l' => 'dummyLow', - 'o' => 'dummyOpen', - 'v' => 'dummyVolume', - 'close' => 'dummyClose', - 'high' => 'dummyHigh', - 'low' => 'dummyLow', - 'open' => 'dummyOpen', - 'volume' => 'dummyVolume', - ]; - - $actualReturn = Mappers::snapshotAgg($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testSnapshotAggV2() - { - $tickData = [ - 'T' => 'dummyTickerSymbol', - 'v' => 'dummyVolume', - 'o' => 'dummyOpen', - 'c' => 'dummyClose', - 'h' => 'dummyHigh', - 'l' => 'dummyLow', - 't' => 'dummyTimestamp', - 'n' => 'dummyNumberOfItems', - ]; - - $expectedReturn = [ - 'T' => 'dummyTickerSymbol', - 'v' => 'dummyVolume', - 'o' => 'dummyOpen', - 'c' => 'dummyClose', - 'h' => 'dummyHigh', - 'l' => 'dummyLow', - 't' => 'dummyTimestamp', - 'n' => 'dummyNumberOfItems', - 'tickerSymbol' => 'dummyTickerSymbol', - 'volume' => 'dummyVolume', - 'open' => 'dummyOpen', - 'close' => 'dummyClose', - 'high' => 'dummyHigh', - 'low' => 'dummyLow', - 'timestamp' => 'dummyTimestamp', - 'numberOfItems' => 'dummyNumberOfItems', - ]; - - $actualReturn = Mappers::snapshotAggV2($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testCryptoTick() - { - $tickData = [ - 'p' => 'dummyPrice', - 's' => 'dummySize', - 'x' => 'dummyExchange', - 'c' => 'dummyConditions', - 't' => 'dummyTimestamp', - ]; - - $expectedReturn = [ - 'p' => 'dummyPrice', - 's' => 'dummySize', - 'x' => 'dummyExchange', - 'c' => 'dummyConditions', - 't' => 'dummyTimestamp', - 'price' => 'dummyPrice', - 'size' => 'dummySize', - 'exchange' => 'dummyExchange', - 'conditions' => 'dummyConditions', - 'timestamp' => 'dummyTimestamp', - ]; - - $actualReturn = Mappers::cryptoTick($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testCryptoSnapshotBookItem() - { - $tickData = [ - 'p' => 'dummyPrice', - ]; - - $expectedReturn = [ - 'p' => 'dummyPrice', - 'price' => 'dummyPrice', - ]; - - $actualReturn = Mappers::cryptoSnapshotBookItem($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testSnapshotTicker() - { - $tickData = [ - 'day' => [ - 'c' => 'dummyDayClose', - 'h' => 'dummyDayHigh', - 'l' => 'dummyDayLow', - 'o' => 'dummyDayOpen', - 'v' => 'dummyDayVolume', - ], - 'lastTrade' => [ - 'c1' => 'dummyLastTradeCondition1', - 'c2' => 'dummyLastTradeCondition2', - 'c3' => 'dummyLastTradeCondition3', - 'c4' => 'dummyLastTradeCondition4', - 'e' => 'dummyLastTradeExchange', - 'p' => 'dummyLastTradePrice', - 's' => 'dummyLastTradeSize', - 't' => 'dummyLastTradeTimestamp', - ], - 'lastQuote' => [ - 'p' => 'dummyLastQuoteBidPrice', - 's' => 'dummyLastQuoteBidSize', - 'P' => 'dummyLastQuoteAskPrice', - 'S' => 'dummyLastQuoteAskSize', - 't' => 'dummyLastQuoteTimestamp', - ], - 'min' => [ - 'c' => 'dummyMinClose', - 'h' => 'dummyMinHigh', - 'l' => 'dummyMinLow', - 'o' => 'dummyMinOpen', - 'v' => 'dummyMinVolume', - ], - 'prevDay' => [ - 'c' => 'dummyPrevDayClose', - 'h' => 'dummyPrevDayHigh', - 'l' => 'dummyPrevDayLow', - 'o' => 'dummyPrevDayOpen', - 'v' => 'dummyPrevDayVolume', - ], - ]; - - $expectedReturn = [ - 'day' => [ - 'c' => 'dummyDayClose', - 'h' => 'dummyDayHigh', - 'l' => 'dummyDayLow', - 'o' => 'dummyDayOpen', - 'v' => 'dummyDayVolume', - 'close' => 'dummyDayClose', - 'high' => 'dummyDayHigh', - 'low' => 'dummyDayLow', - 'open' => 'dummyDayOpen', - 'volume' => 'dummyDayVolume', - ], - 'lastTrade' => [ - 'c1' => 'dummyLastTradeCondition1', - 'c2' => 'dummyLastTradeCondition2', - 'c3' => 'dummyLastTradeCondition3', - 'c4' => 'dummyLastTradeCondition4', - 'e' => 'dummyLastTradeExchange', - 'p' => 'dummyLastTradePrice', - 's' => 'dummyLastTradeSize', - 't' => 'dummyLastTradeTimestamp', - 'condition1' => 'dummyLastTradeCondition1', - 'condition2' => 'dummyLastTradeCondition2', - 'condition3' => 'dummyLastTradeCondition3', - 'condition4' => 'dummyLastTradeCondition4', - 'exchange' => 'dummyLastTradeExchange', - 'price' => 'dummyLastTradePrice', - 'size' => 'dummyLastTradeSize', - 'timestamp' => 'dummyLastTradeTimestamp', - ], - 'lastQuote' => [ - 'p' => 'dummyLastQuoteBidPrice', - 's' => 'dummyLastQuoteBidSize', - 'P' => 'dummyLastQuoteAskPrice', - 'S' => 'dummyLastQuoteAskSize', - 't' => 'dummyLastQuoteTimestamp', - 'bidPrice' => 'dummyLastQuoteBidPrice', - 'bidSize' => 'dummyLastQuoteBidSize', - 'askPrice' => 'dummyLastQuoteAskPrice', - 'askSize' => 'dummyLastQuoteAskSize', - 'lastUpdateTimestamp' => 'dummyLastQuoteTimestamp', - ], - 'min' => [ - 'c' => 'dummyMinClose', - 'h' => 'dummyMinHigh', - 'l' => 'dummyMinLow', - 'o' => 'dummyMinOpen', - 'v' => 'dummyMinVolume', - 'close' => 'dummyMinClose', - 'high' => 'dummyMinHigh', - 'low' => 'dummyMinLow', - 'open' => 'dummyMinOpen', - 'volume' => 'dummyMinVolume', - ], - 'prevDay' => [ - 'c' => 'dummyPrevDayClose', - 'h' => 'dummyPrevDayHigh', - 'l' => 'dummyPrevDayLow', - 'o' => 'dummyPrevDayOpen', - 'v' => 'dummyPrevDayVolume', - 'close' => 'dummyPrevDayClose', - 'high' => 'dummyPrevDayHigh', - 'low' => 'dummyPrevDayLow', - 'open' => 'dummyPrevDayOpen', - 'volume' => 'dummyPrevDayVolume', - ], - ]; - - $actualReturn = Mappers::snapshotTicker($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } - - public function testSnapshotCryptoTicker() - { - $tickData = [ - 'day' => [ - 'c' => 'dummyDayClose', - 'h' => 'dummyDayHigh', - 'l' => 'dummyDayLow', - 'o' => 'dummyDayOpen', - 'v' => 'dummyDayVolume', - ], - 'lastTrade' => [ - 'p' => 'dummyPrice', - 's' => 'dummySize', - 'x' => 'dummyExchange', - 'c' => 'dummyConditions', - 't' => 'dummyTimestamp', - ], - 'min' => [ - 'c' => 'dummyMinClose', - 'h' => 'dummyMinHigh', - 'l' => 'dummyMinLow', - 'o' => 'dummyMinOpen', - 'v' => 'dummyMinVolume', - ], - 'prevDay' => [ - 'c' => 'dummyPrevDayClose', - 'h' => 'dummyPrevDayHigh', - 'l' => 'dummyPrevDayLow', - 'o' => 'dummyPrevDayOpen', - 'v' => 'dummyPrevDayVolume', - ], - ]; - - $expectedReturn = [ - 'day' => [ - 'c' => 'dummyDayClose', - 'h' => 'dummyDayHigh', - 'l' => 'dummyDayLow', - 'o' => 'dummyDayOpen', - 'v' => 'dummyDayVolume', - 'close' => 'dummyDayClose', - 'high' => 'dummyDayHigh', - 'low' => 'dummyDayLow', - 'open' => 'dummyDayOpen', - 'volume' => 'dummyDayVolume', - ], - 'lastTrade' => [ - 'p' => 'dummyPrice', - 's' => 'dummySize', - 'x' => 'dummyExchange', - 'c' => 'dummyConditions', - 't' => 'dummyTimestamp', - 'price' => 'dummyPrice', - 'size' => 'dummySize', - 'exchange' => 'dummyExchange', - 'conditions' => 'dummyConditions', - 'timestamp' => 'dummyTimestamp', - ], - 'min' => [ - 'c' => 'dummyMinClose', - 'h' => 'dummyMinHigh', - 'l' => 'dummyMinLow', - 'o' => 'dummyMinOpen', - 'v' => 'dummyMinVolume', - 'close' => 'dummyMinClose', - 'high' => 'dummyMinHigh', - 'low' => 'dummyMinLow', - 'open' => 'dummyMinOpen', - 'volume' => 'dummyMinVolume', - ], - 'prevDay' => [ - 'c' => 'dummyPrevDayClose', - 'h' => 'dummyPrevDayHigh', - 'l' => 'dummyPrevDayLow', - 'o' => 'dummyPrevDayOpen', - 'v' => 'dummyPrevDayVolume', - 'close' => 'dummyPrevDayClose', - 'high' => 'dummyPrevDayHigh', - 'low' => 'dummyPrevDayLow', - 'open' => 'dummyPrevDayOpen', - 'volume' => 'dummyPrevDayVolume', - ], - ]; - - $actualReturn = Mappers::snapshotCryptoTicker($tickData); - - $this->assertEquals($expectedReturn, $actualReturn); - } -} diff --git a/tests/Rest/Crypto/AggregatesTest.php b/tests/Rest/Crypto/AggregatesTest.php deleted file mode 100644 index 58f8f4b..0000000 --- a/tests/Rest/Crypto/AggregatesTest.php +++ /dev/null @@ -1,28 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/ticker/AAPL/range/1/day/2020-10-14/2020-10-15.json') - ); - - $previousClose->get('AAPL', 1, '2020-10-14', '2020-10-15'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/AAPL/range/1/day/2020-10-14/2020-10-15'); - } -} diff --git a/tests/Rest/Crypto/CryptoExchangesTest.php b/tests/Rest/Crypto/CryptoExchangesTest.php deleted file mode 100644 index 63e3fee..0000000 --- a/tests/Rest/Crypto/CryptoExchangesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/meta/crypto-exchanges.json') - ); - - $cryptoExchanges->get(); - - $this->assertPath($requestsContainer, '/v1/meta/crypto-exchanges'); - } -} diff --git a/tests/Rest/Crypto/CryptoTest.php b/tests/Rest/Crypto/CryptoTest.php deleted file mode 100644 index 2673b12..0000000 --- a/tests/Rest/Crypto/CryptoTest.php +++ /dev/null @@ -1,91 +0,0 @@ -crypto = new Crypto('API_KEY'); - } - - public function testAggregates() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->aggregates); - $this->assertInstanceOf(RestResource::class, $this->crypto->aggregates()); - } - - public function testGroupedDaily() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->groupedDaily); - $this->assertInstanceOf(RestResource::class, $this->crypto->groupedDaily()); - } - - public function testPreviousClose() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->previousClose); - $this->assertInstanceOf(RestResource::class, $this->crypto->previousClose()); - } - - public function testCryptoExchanges() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->cryptoExchanges); - $this->assertInstanceOf(RestResource::class, $this->crypto->cryptoExchanges()); - } - - public function testLastTradeForCryptoPair() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->lastTradeForCryptoPair); - $this->assertInstanceOf(RestResource::class, $this->crypto->lastTradeForCryptoPair()); - } - - public function testDailyOpenClose() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->dailyOpenClose); - $this->assertInstanceOf(RestResource::class, $this->crypto->dailyOpenClose()); - } - - public function testHistoricCryptoTrade() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->historicCryptoTrade); - $this->assertInstanceOf(RestResource::class, $this->crypto->historicCryptoTrade()); - } - - public function testSnapshotAllTickers() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotAllTickers); - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotAllTickers()); - } - - public function testSnapshotSingleTicker() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotSingleTicker); - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotSingleTicker()); - } - - public function testSnapshotGainersLosers() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotGainersLosers); - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotGainersLosers()); - } - - public function testSnapshotSingleTickerFullBook() - { - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotSingleTickerFullBook); - $this->assertInstanceOf(RestResource::class, $this->crypto->snapshotSingleTickerFullBook()); - } -} diff --git a/tests/Rest/Crypto/DailyOpenCloseTest.php b/tests/Rest/Crypto/DailyOpenCloseTest.php deleted file mode 100644 index 2bc8e6c..0000000 --- a/tests/Rest/Crypto/DailyOpenCloseTest.php +++ /dev/null @@ -1,28 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, - $this->loadJsonStubFile('api/v1/open-close/crypto/BTC/USD/2020-10-14.json') - ); - - $dailyOpenClose->get('BTC', 'USD', '2020-10-14'); - - $this->assertPath($requestsContainer, '/v1/open-close/crypto/BTC/USD/2020-10-14'); - } -} diff --git a/tests/Rest/Crypto/GroupedDailyTest.php b/tests/Rest/Crypto/GroupedDailyTest.php deleted file mode 100644 index aa90c7a..0000000 --- a/tests/Rest/Crypto/GroupedDailyTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/grouped/locale/global/market/crypto/2020-10-14.json') - ); - - $groupedDaily->get('2020-10-14'); - - $this->assertPath($requestsContainer, '/v2/aggs/grouped/locale/global/market/crypto/2020-10-14'); - } -} diff --git a/tests/Rest/Crypto/HistoricCryptoTradeTest.php b/tests/Rest/Crypto/HistoricCryptoTradeTest.php deleted file mode 100644 index 6eb1e8f..0000000 --- a/tests/Rest/Crypto/HistoricCryptoTradeTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/historic/crypto/BTC/USD/2020-10-14.json') - ); - - $historicCryptoTrade->get('BTC', 'USD', '2020-10-14'); - - $this->assertPath($requestsContainer, '/v1/historic/crypto/BTC/USD/2020-10-14'); - } -} diff --git a/tests/Rest/Crypto/LastTradeForCryptoPairTest.php b/tests/Rest/Crypto/LastTradeForCryptoPairTest.php deleted file mode 100644 index fe2518b..0000000 --- a/tests/Rest/Crypto/LastTradeForCryptoPairTest.php +++ /dev/null @@ -1,28 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, - $this->loadJsonStubFile('api/v1/last/crypto/BTC/USD.json') - ); - - $lastTradeForCryptoPair->get('BTC', 'USD'); - - $this->assertPath($requestsContainer, '/v1/last/crypto/BTC/USD'); - } -} diff --git a/tests/Rest/Crypto/PreviousCloseTest.php b/tests/Rest/Crypto/PreviousCloseTest.php deleted file mode 100644 index 25dae15..0000000 --- a/tests/Rest/Crypto/PreviousCloseTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/ticker/AAPL/prev.json') - ); - - $previousClose->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/AAPL/prev'); - } -} diff --git a/tests/Rest/Crypto/SnapshotAllTickersTest.php b/tests/Rest/Crypto/SnapshotAllTickersTest.php deleted file mode 100644 index 26d7af0..0000000 --- a/tests/Rest/Crypto/SnapshotAllTickersTest.php +++ /dev/null @@ -1,28 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, - $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/crypto/tickers.json') - ); - - $snapshotAllTickers->get(); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/global/markets/crypto/tickers'); - } -} diff --git a/tests/Rest/Crypto/SnapshotGainersLosersTest.php b/tests/Rest/Crypto/SnapshotGainersLosersTest.php deleted file mode 100644 index f5bef0b..0000000 --- a/tests/Rest/Crypto/SnapshotGainersLosersTest.php +++ /dev/null @@ -1,29 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, - $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/crypto/gainers.json') - ); - - $snapshotGainersLosers->get(); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/global/markets/crypto/gainers'); - } -} diff --git a/tests/Rest/Crypto/SnapshotSingleTickerFullBookTest.php b/tests/Rest/Crypto/SnapshotSingleTickerFullBookTest.php deleted file mode 100644 index a0f181e..0000000 --- a/tests/Rest/Crypto/SnapshotSingleTickerFullBookTest.php +++ /dev/null @@ -1,31 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD/book.json') - ); - - $snapshotSingleTickerFullBook->get('X:BTCUSD'); - - $this->assertPath($requestsContainer, - '/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD/book'); - } -} diff --git a/tests/Rest/Crypto/SnapshotSingleTickerTest.php b/tests/Rest/Crypto/SnapshotSingleTickerTest.php deleted file mode 100644 index f4b3b3b..0000000 --- a/tests/Rest/Crypto/SnapshotSingleTickerTest.php +++ /dev/null @@ -1,28 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD.json') - ); - - $singleTicker->get('X:BTCUSD'); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD'); - } -} diff --git a/tests/Rest/Forex/AggregatesTest.php b/tests/Rest/Forex/AggregatesTest.php deleted file mode 100644 index 22f8057..0000000 --- a/tests/Rest/Forex/AggregatesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/ticker/C:EURUSD/range/1/day/2020-10-14/2020-10-15.json') - ); - - $previousClose->get('C:EURUSD', 1, '2020-10-14', '2020-10-15'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/C:EURUSD/range/1/day/2020-10-14/2020-10-15'); - } -} diff --git a/tests/Rest/Forex/ForexTest.php b/tests/Rest/Forex/ForexTest.php deleted file mode 100644 index e29f3c6..0000000 --- a/tests/Rest/Forex/ForexTest.php +++ /dev/null @@ -1,74 +0,0 @@ -forex = new Forex('API_KEY'); - } - - public function testAggregates() - { - $this->assertInstanceOf(RestResource::class, $this->forex->aggregates); - $this->assertInstanceOf(RestResource::class, $this->forex->aggregates()); - } - - public function testGroupedDaily() - { - $this->assertInstanceOf(RestResource::class, $this->forex->groupedDaily); - $this->assertInstanceOf(RestResource::class, $this->forex->groupedDaily()); - } - - public function testPreviousClose() - { - $this->assertInstanceOf(RestResource::class, $this->forex->previousClose); - $this->assertInstanceOf(RestResource::class, $this->forex->previousClose()); - } - - public function testHistoricForexTick() - { - $this->assertInstanceOf(RestResource::class, $this->forex->historicForexTick); - $this->assertInstanceOf(RestResource::class, $this->forex->historicForexTick()); - } - - public function testRealTimeCurrencyConversion() - { - $this->assertInstanceOf(RestResource::class, $this->forex->realTimeCurrencyConversion); - $this->assertInstanceOf(RestResource::class, $this->forex->realTimeCurrencyConversion()); - } - - public function testLastQuoteForCurrencyPair() - { - $this->assertInstanceOf(RestResource::class, $this->forex->lastQuoteForCurrencyPair); - $this->assertInstanceOf(RestResource::class, $this->forex->lastQuoteForCurrencyPair()); - } - - public function testSnapshotGainersLosers() - { - $this->assertInstanceOf(RestResource::class, $this->forex->snapshotGainersLosers); - $this->assertInstanceOf(RestResource::class, $this->forex->snapshotGainersLosers()); - } - - public function testSnapshotAllTickers() - { - $this->assertInstanceOf(RestResource::class, $this->forex->snapshotAllTickers); - $this->assertInstanceOf(RestResource::class, $this->forex->snapshotAllTickers()); - } -} diff --git a/tests/Rest/Forex/GroupedDailyTest.php b/tests/Rest/Forex/GroupedDailyTest.php deleted file mode 100644 index 4be4922..0000000 --- a/tests/Rest/Forex/GroupedDailyTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/grouped/locale/us/market/fx/2020-10-14.json') - ); - - $groupedDaily->get('2020-10-14'); - - $this->assertPath($requestsContainer, '/v2/aggs/grouped/locale/us/market/fx/2020-10-14'); - } -} diff --git a/tests/Rest/Forex/HistoricForexTickTest.php b/tests/Rest/Forex/HistoricForexTickTest.php deleted file mode 100644 index 295c8f4..0000000 --- a/tests/Rest/Forex/HistoricForexTickTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/historic/forex/AUD/USD/2020-10-14.json') - ); - - $historicForexTick->get('AUD', 'USD', '2020-10-14'); - - $this->assertPath($requestsContainer, '/v1/historic/forex/AUD/USD/2020-10-14'); - } -} diff --git a/tests/Rest/Forex/LastQuoteForCurrencyPairTest.php b/tests/Rest/Forex/LastQuoteForCurrencyPairTest.php deleted file mode 100644 index be504ed..0000000 --- a/tests/Rest/Forex/LastQuoteForCurrencyPairTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/last_quote/currencies/AUD/USD.json') - ); - - $lastQuoteForCurrencyPair->get('AUD', 'USD'); - - $this->assertPath($requestsContainer, '/v1/last_quote/currencies/AUD/USD'); - } -} diff --git a/tests/Rest/Forex/PreviousCloseTest.php b/tests/Rest/Forex/PreviousCloseTest.php deleted file mode 100644 index c5124eb..0000000 --- a/tests/Rest/Forex/PreviousCloseTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/aggs/ticker/C:EURUSD/prev.json') - ); - - $previousClose->get('C:EURUSD'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/C:EURUSD/prev'); - } -} diff --git a/tests/Rest/Forex/RealTimeCurrencyConversionTest.php b/tests/Rest/Forex/RealTimeCurrencyConversionTest.php deleted file mode 100644 index a0a310d..0000000 --- a/tests/Rest/Forex/RealTimeCurrencyConversionTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/conversion/AUD/USD.json') - ); - - $realTimeCurrencyConversion->get('AUD', 'USD'); - - $this->assertPath($requestsContainer, '/v1/conversion/AUD/USD'); - } -} diff --git a/tests/Rest/Forex/SnapshotAllTickersTest.php b/tests/Rest/Forex/SnapshotAllTickersTest.php deleted file mode 100644 index f34b270..0000000 --- a/tests/Rest/Forex/SnapshotAllTickersTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/forex/tickers.json') - ); - - $snapshotAllTickers->get(); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/global/markets/forex/tickers'); - } -} diff --git a/tests/Rest/Forex/SnapshotGainersLosersTest.php b/tests/Rest/Forex/SnapshotGainersLosersTest.php deleted file mode 100644 index 96c5b90..0000000 --- a/tests/Rest/Forex/SnapshotGainersLosersTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/snapshot/locale/global/markets/forex/gainers.json') - ); - - $snapshotGainersLosers->get(); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/global/markets/forex/gainers'); - } -} diff --git a/tests/Rest/Options/ContractTest.php b/tests/Rest/Options/ContractTest.php deleted file mode 100644 index 55d5d9c..0000000 --- a/tests/Rest/Options/ContractTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $contract->get('O:EVRI240119C00002500'); - - $this->assertPath($requestsContainer, '/v3/reference/options/contracts/O:EVRI240119C00002500'); - } -} diff --git a/tests/Rest/Options/ContractsTest.php b/tests/Rest/Options/ContractsTest.php deleted file mode 100644 index d452bb1..0000000 --- a/tests/Rest/Options/ContractsTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $contract->get(); - - $this->assertPath($requestsContainer, '/v3/reference/options/contracts'); - } -} diff --git a/tests/Rest/Reference/LocalesTest.php b/tests/Rest/Reference/LocalesTest.php deleted file mode 100644 index 8fe4116..0000000 --- a/tests/Rest/Reference/LocalesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/locales.json') - ); - - $locales->get(); - - $this->assertPath($requestsContainer, '/v2/reference/locales'); - } -} diff --git a/tests/Rest/Reference/MarketHolidaysTest.php b/tests/Rest/Reference/MarketHolidaysTest.php deleted file mode 100644 index 8cab179..0000000 --- a/tests/Rest/Reference/MarketHolidaysTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/marketstatus/upcoming.json') - ); - - $marketHolidays->get(); - - $this->assertPath($requestsContainer, '/v1/marketstatus/upcoming'); - } -} diff --git a/tests/Rest/Reference/MarketStatusTest.php b/tests/Rest/Reference/MarketStatusTest.php deleted file mode 100644 index 7b658c3..0000000 --- a/tests/Rest/Reference/MarketStatusTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/marketstatus/now.json') - ); - - $marketStatus->get(); - - $this->assertPath($requestsContainer, '/v1/marketstatus/now'); - } -} diff --git a/tests/Rest/Reference/MarketsTest.php b/tests/Rest/Reference/MarketsTest.php deleted file mode 100644 index c14ffd7..0000000 --- a/tests/Rest/Reference/MarketsTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/markets.json') - ); - - $markets->get(); - - $this->assertPath($requestsContainer, '/v2/reference/markets'); - } -} diff --git a/tests/Rest/Reference/ReferenceTest.php b/tests/Rest/Reference/ReferenceTest.php deleted file mode 100644 index df79dec..0000000 --- a/tests/Rest/Reference/ReferenceTest.php +++ /dev/null @@ -1,88 +0,0 @@ -reference = new Reference('API_KEY'); - } - - public function testTickers() - { - $this->assertInstanceOf(RestResource::class, $this->reference->Tickers()); - $this->assertInstanceOf(RestResource::class, $this->reference->tickers); - } - - public function testTickerTypes() - { - $this->assertInstanceOf(RestResource::class, $this->reference->TickerTypes()); - $this->assertInstanceOf(RestResource::class, $this->reference->tickerTypes); - } - - public function testTickerDetails() - { - $this->assertInstanceOf(RestResource::class, $this->reference->TickerDetails()); - $this->assertInstanceOf(RestResource::class, $this->reference->tickerDetails); - } - - public function testTickerNews() - { - $this->assertInstanceOf(RestResource::class, $this->reference->TickerNews()); - $this->assertInstanceOf(RestResource::class, $this->reference->tickerNews); - } - - public function testMarkets() - { - $this->assertInstanceOf(RestResource::class, $this->reference->Markets()); - $this->assertInstanceOf(RestResource::class, $this->reference->markets); - } - - public function testLocales() - { - $this->assertInstanceOf(RestResource::class, $this->reference->Locales()); - $this->assertInstanceOf(RestResource::class, $this->reference->locales); - } - - public function testStockSplits() - { - $this->assertInstanceOf(RestResource::class, $this->reference->StockSplits()); - $this->assertInstanceOf(RestResource::class, $this->reference->stockSplits); - } - - public function testStockDividends() - { - $this->assertInstanceOf(RestResource::class, $this->reference->StockDividends()); - $this->assertInstanceOf(RestResource::class, $this->reference->stockDividends); - } - - public function testStockFinancials() - { - $this->assertInstanceOf(RestResource::class, $this->reference->StockFinancials()); - $this->assertInstanceOf(RestResource::class, $this->reference->stockFinancials); - } - - public function testMarketStatus() - { - $this->assertInstanceOf(RestResource::class, $this->reference->MarketStatus()); - $this->assertInstanceOf(RestResource::class, $this->reference->marketStatus); - } - - public function testMarketHolidays() - { - $this->assertInstanceOf(RestResource::class, $this->reference->MarketHolidays()); - $this->assertInstanceOf(RestResource::class, $this->reference->marketHolidays); - } -} diff --git a/tests/Rest/Reference/StockDividendsTest.php b/tests/Rest/Reference/StockDividendsTest.php deleted file mode 100644 index 90b9abd..0000000 --- a/tests/Rest/Reference/StockDividendsTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/dividends.json') - ); - - $stockDividends->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/reference/dividends/AAPL'); - } -} diff --git a/tests/Rest/Reference/StockFinancialsTest.php b/tests/Rest/Reference/StockFinancialsTest.php deleted file mode 100644 index 858a3c0..0000000 --- a/tests/Rest/Reference/StockFinancialsTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/financials.json') - ); - - $stockFinancials->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/reference/financials/AAPL'); - } -} diff --git a/tests/Rest/Reference/StockSplitsTest.php b/tests/Rest/Reference/StockSplitsTest.php deleted file mode 100644 index 6be6276..0000000 --- a/tests/Rest/Reference/StockSplitsTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/splits.json') - ); - - $stockSplits->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/reference/splits/AAPL'); - } -} diff --git a/tests/Rest/Reference/TickerDetailsTest.php b/tests/Rest/Reference/TickerDetailsTest.php deleted file mode 100644 index b802c7e..0000000 --- a/tests/Rest/Reference/TickerDetailsTest.php +++ /dev/null @@ -1,29 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v1/meta/symbols/AAPL/company.json') - ); - - $tickerDetails->get('AAPL'); - - $this->assertPath($requestsContainer, '/v1/meta/symbols/AAPL/company'); - } -} diff --git a/tests/Rest/Reference/TickerTypesTest.php b/tests/Rest/Reference/TickerTypesTest.php deleted file mode 100644 index 834613a..0000000 --- a/tests/Rest/Reference/TickerTypesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/reference/types.json') - ); - - $tickerTypes->get(); - - $this->assertPath($requestsContainer, '/v2/reference/types'); - } -} diff --git a/tests/Rest/Stocks/AggregatesTest.php b/tests/Rest/Stocks/AggregatesTest.php deleted file mode 100644 index 377eac2..0000000 --- a/tests/Rest/Stocks/AggregatesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $previousClose->get('AAPL', 1, '2018-2-2', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/AAPL/range/1/days/2018-2-2/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/ConditionMappingsTest.php b/tests/Rest/Stocks/ConditionMappingsTest.php deleted file mode 100644 index 8c8bd0d..0000000 --- a/tests/Rest/Stocks/ConditionMappingsTest.php +++ /dev/null @@ -1,24 +0,0 @@ -httpClient = $this->getHttpMock($requestsContainer); - - $conditionMappings->get(); - - $this->assertPath($requestsContainer, '/v1/meta/conditions/trades'); - } - -} diff --git a/tests/Rest/Stocks/DailyOpenCloseTest.php b/tests/Rest/Stocks/DailyOpenCloseTest.php deleted file mode 100644 index ca7d585..0000000 --- a/tests/Rest/Stocks/DailyOpenCloseTest.php +++ /dev/null @@ -1,23 +0,0 @@ -httpClient = $this->getHttpMock($requestsContainer); - - $dailyOpenClose->get('AAPL', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v1/open-close/AAPL/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/ExchangesTest.php b/tests/Rest/Stocks/ExchangesTest.php deleted file mode 100644 index 4c3439a..0000000 --- a/tests/Rest/Stocks/ExchangesTest.php +++ /dev/null @@ -1,23 +0,0 @@ -httpClient = $this->getHttpMock($requestsContainer); - - $exchanges->get(); - - $this->assertPath($requestsContainer, '/v1/meta/exchanges'); - } -} diff --git a/tests/Rest/Stocks/GroupedDailyTest.php b/tests/Rest/Stocks/GroupedDailyTest.php deleted file mode 100644 index 2f6377b..0000000 --- a/tests/Rest/Stocks/GroupedDailyTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $groupedDaily->get('2019-2-2'); - - $this->assertPath($requestsContainer, '/v2/aggs/grouped/locale/US/market/STOCKS/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/HistoricQuotesTest.php b/tests/Rest/Stocks/HistoricQuotesTest.php deleted file mode 100644 index dae425d..0000000 --- a/tests/Rest/Stocks/HistoricQuotesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'ticks' => [], - ] - ); - - $historicQuotes->get('AAPL', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v1/historic/quotes/AAPL/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/HistoricQuotesV2Test.php b/tests/Rest/Stocks/HistoricQuotesV2Test.php deleted file mode 100644 index 3a136ca..0000000 --- a/tests/Rest/Stocks/HistoricQuotesV2Test.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $historicQuotesV2->get('AAPL', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v2/ticks/stocks/nbbo/AAPL/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/HistoricTradesTest.php b/tests/Rest/Stocks/HistoricTradesTest.php deleted file mode 100644 index 6d852d5..0000000 --- a/tests/Rest/Stocks/HistoricTradesTest.php +++ /dev/null @@ -1,29 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'ticks' => [], - ] - ); - - $historicTrades->get('AAPL', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v1/historic/trades/AAPL/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/HistoricTradesV2Test.php b/tests/Rest/Stocks/HistoricTradesV2Test.php deleted file mode 100644 index a563c06..0000000 --- a/tests/Rest/Stocks/HistoricTradesV2Test.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, $this->loadJsonStubFile('api/v2/ticks/stocks/AAPL/2020-10-14.json') - ); - - $historicTradesV2->get('AAPL', '2019-2-2'); - - $this->assertPath($requestsContainer, '/v2/ticks/stocks/trades/AAPL/2019-2-2'); - } -} diff --git a/tests/Rest/Stocks/LastQuoteForSymbolTest.php b/tests/Rest/Stocks/LastQuoteForSymbolTest.php deleted file mode 100644 index e6bd217..0000000 --- a/tests/Rest/Stocks/LastQuoteForSymbolTest.php +++ /dev/null @@ -1,23 +0,0 @@ -httpClient = $this->getHttpMock($requestsContainer); - - $lastTradeForSymbol->get('AAPL'); - - $this->assertPath($requestsContainer, '/v1/last_quote/stocks/AAPL'); - } -} diff --git a/tests/Rest/Stocks/LastTradeForSymbolTest.php b/tests/Rest/Stocks/LastTradeForSymbolTest.php deleted file mode 100644 index ced7f12..0000000 --- a/tests/Rest/Stocks/LastTradeForSymbolTest.php +++ /dev/null @@ -1,23 +0,0 @@ -httpClient = $this->getHttpMock($requestsContainer); - - $lastTradeForSymbol->get('AAPL'); - - $this->assertPath($requestsContainer, '/v1/last/stocks/AAPL'); - } -} diff --git a/tests/Rest/Stocks/PreviousCloseTest.php b/tests/Rest/Stocks/PreviousCloseTest.php deleted file mode 100644 index 3276085..0000000 --- a/tests/Rest/Stocks/PreviousCloseTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'results' => [], - ] - ); - - $previousClose->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/aggs/ticker/AAPL/prev'); - } -} diff --git a/tests/Rest/Stocks/SnapshotAllTickersTest.php b/tests/Rest/Stocks/SnapshotAllTickersTest.php deleted file mode 100644 index d88204b..0000000 --- a/tests/Rest/Stocks/SnapshotAllTickersTest.php +++ /dev/null @@ -1,27 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'tickers' => [], - ] - ); - - $snapshotAllTickers->get(); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/us/markets/stocks/tickers'); - } -} diff --git a/tests/Rest/Stocks/SnapshotGainersLosersTest.php b/tests/Rest/Stocks/SnapshotGainersLosersTest.php deleted file mode 100644 index 3079e35..0000000 --- a/tests/Rest/Stocks/SnapshotGainersLosersTest.php +++ /dev/null @@ -1,26 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'tickers' => [], - ] - ); - - $snapshotGainersLosers->get(); - $this->assertPath($requestsContainer, '/v2/snapshot/locale/us/markets/stocks/gainers'); - } -} diff --git a/tests/Rest/Stocks/SnapshotSingleTickerTest.php b/tests/Rest/Stocks/SnapshotSingleTickerTest.php deleted file mode 100644 index 8c56856..0000000 --- a/tests/Rest/Stocks/SnapshotSingleTickerTest.php +++ /dev/null @@ -1,67 +0,0 @@ -httpClient = $this->getHttpMock( - $requestsContainer, [ - 'ticker' => [ - 'day' => [ - 'c' => 'c', - 'h' => 'h', - 'l' => 'l', - 'o' => 'o', - 'v' => 'v', - ], - 'lastTrade' => [ - 'c1' => 'c1', - 'c2' => 'c2', - 'c3' => 'c3', - 'c4' => 'c4', - 'e' => 'e', - 'p' => 'p', - 's' => 's', - 't' => 't', - ], - 'lastQuote' => [ - 'p' => 'p', - 's' => 's', - 'S' => 'S', - 'P' => 'P', - 't' => 't', - ], - 'min' => [ - 'c' => 'c', - 'h' => 'h', - 'l' => 'l', - 'o' => 'o', - 'v' => 'v', - ], - 'prevDay' => [ - 'c' => 'c', - 'h' => 'h', - 'l' => 'l', - 'o' => 'o', - 'v' => 'v', - ], - ], - ] - ); - - $singleTicker->get('AAPL'); - - $this->assertPath($requestsContainer, '/v2/snapshot/locale/us/markets/stocks/tickers/AAPL'); - } -} diff --git a/tests/Rest/Stocks/StocksTest.php b/tests/Rest/Stocks/StocksTest.php deleted file mode 100644 index 85e37b5..0000000 --- a/tests/Rest/Stocks/StocksTest.php +++ /dev/null @@ -1,116 +0,0 @@ -stocks = new Stocks('API_KEY'); - } - - public function testExchanges() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->exchanges); - $this->assertInstanceOf(RestResource::class, $this->stocks->exchanges()); - } - - public function testHistoricTrades() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->historicTrades); - $this->assertInstanceOf(RestResource::class, $this->stocks->historicTrades()); - } - - public function testHistoricTradesV2() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->historicTradesV2); - $this->assertInstanceOf(RestResource::class, $this->stocks->historicTradesV2()); - } - - public function testHistoricQuotes() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->historicQuotes); - $this->assertInstanceOf(RestResource::class, $this->stocks->historicQuotes()); - } - - public function testHistoricQuotesV2() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->historicQuotesV2); - $this->assertInstanceOf(RestResource::class, $this->stocks->historicQuotesV2()); - } - - public function testLastTradeForSymbol() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->lastTradeForSymbol); - $this->assertInstanceOf(RestResource::class, $this->stocks->lastTradeForSymbol()); - } - - public function testLastQuoteForSymbol() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->lastQuoteForSymbol); - $this->assertInstanceOf(RestResource::class, $this->stocks->lastQuoteForSymbol()); - } - - public function testDailyOpenClose() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->dailyOpenClose); - $this->assertInstanceOf(RestResource::class, $this->stocks->dailyOpenClose()); - } - - public function testConditionMappings() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->conditionMappings); - $this->assertInstanceOf(RestResource::class, $this->stocks->conditionMappings()); - } - - public function testSnapshotAllTickers() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotAllTickers); - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotAllTickers()); - } - - public function testSnapshotSingleTicker() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotSingleTicker); - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotSingleTicker()); - } - - public function testSnapshotGainersLosers() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotGainersLosers); - $this->assertInstanceOf(RestResource::class, $this->stocks->snapshotGainersLosers()); - } - - public function testPreviousClose() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->previousClose); - $this->assertInstanceOf(RestResource::class, $this->stocks->previousClose()); - } - - public function testAggregates() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->aggregates); - $this->assertInstanceOf(RestResource::class, $this->stocks->aggregates()); - } - - public function testGroupedDaily() - { - $this->assertInstanceOf(RestResource::class, $this->stocks->groupedDaily); - $this->assertInstanceOf(RestResource::class, $this->stocks->groupedDaily()); - } -} diff --git a/tests/stubs/api/v1/conversion/AUD/USD.json b/tests/stubs/api/v1/conversion/AUD/USD.json deleted file mode 100644 index ee4ed44..0000000 --- a/tests/stubs/api/v1/conversion/AUD/USD.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "status": "success", - "last": { - "bid": 1.3672596, - "ask": 1.3673344, - "exchange": 48, - "timestamp": 1605555313000 - }, - "from": "AUD", - "to": "USD", - "initialAmount": 100, - "converted": 73.14 -} diff --git a/tests/stubs/api/v1/historic/crypto/BTC/USD/2020-10-14.json b/tests/stubs/api/v1/historic/crypto/BTC/USD/2020-10-14.json deleted file mode 100644 index 77bc87b..0000000 --- a/tests/stubs/api/v1/historic/crypto/BTC/USD/2020-10-14.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "day": "2020-10-14T00:00:00.000Z", - "map": { - "c": "conditions", - "p": "price", - "s": "size", - "t": "timestamp", - "x": "exchange" - }, - "msLatency": 1, - "status": "success", - "symbol": "BTC-USD", - "ticks": [ - { - "s": 0.00188217, - "p": 15482.89, - "x": 1, - "t": 1604880000067, - "c": [ - 2 - ] - }, - { - "s": 0.00161739, - "p": 15482.11, - "x": 1, - "t": 1604880000167, - "c": [ - 2 - ] - } - ], - "type": "crypto" -} diff --git a/tests/stubs/api/v1/historic/forex/AUD/USD/2020-10-14.json b/tests/stubs/api/v1/historic/forex/AUD/USD/2020-10-14.json deleted file mode 100644 index 003c7ca..0000000 --- a/tests/stubs/api/v1/historic/forex/AUD/USD/2020-10-14.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "day": "2020-10-14", - "map": { - "ap": "ask", - "bp": "bid", - "t": "timestamp" - }, - "msLatency": "0", - "pair": "AUD/USD", - "status": "success", - "ticks": [ - { - "x": 48, - "ap": 0.71703, - "bp": 0.71701, - "t": 1602633600000 - }, - { - "x": 48, - "ap": 0.71703, - "bp": 0.717, - "t": 1602633600000 - }, - { - "x": 48, - "ap": 0.71702, - "bp": 0.717, - "t": 1602633600000 - } - ], - "type": "forex" -} diff --git a/tests/stubs/api/v1/last/crypto/BTC/USD.json b/tests/stubs/api/v1/last/crypto/BTC/USD.json deleted file mode 100644 index d9a64ab..0000000 --- a/tests/stubs/api/v1/last/crypto/BTC/USD.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "last": { - "conditions": [ - 1 - ], - "exchange": 4, - "price": 16835.42, - "size": 0.006909, - "timestamp": 1605560885027 - }, - "request_id": "d2d779df015fe2b7fbb8e58366610ef7", - "status": "success", - "symbol": "BTC-USD" -} diff --git a/tests/stubs/api/v1/last/stocks/AAPL.json b/tests/stubs/api/v1/last/stocks/AAPL.json deleted file mode 100644 index 0a4f2f0..0000000 --- a/tests/stubs/api/v1/last/stocks/AAPL.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "symbol": "AAPL", - "status": "success", - "request_id": "fbb6074f249ea54a1ad924e4967c36af", - "last": { - "cond1": 37, - "exchange": 4, - "price": 119.1802, - "size": 10, - "timestamp": 1605122370210 - } -} diff --git a/tests/stubs/api/v1/last_quote/currencies/2020-10-14/2020-10-14.json b/tests/stubs/api/v1/last_quote/currencies/2020-10-14/2020-10-14.json deleted file mode 100644 index 528e3cb..0000000 --- a/tests/stubs/api/v1/last_quote/currencies/2020-10-14/2020-10-14.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "last": { - "ask": 0.73124, - "bid": 0.73122, - "exchange": 48, - "timestamp": 1605557756000 - }, - "request_id": "a73a29dbcab4613eeaf48583d3baacf0", - "status": "success", - "symbol": "AUD/USD" -} diff --git a/tests/stubs/api/v1/last_quote/currencies/AUD/USD.json b/tests/stubs/api/v1/last_quote/currencies/AUD/USD.json deleted file mode 100644 index 528e3cb..0000000 --- a/tests/stubs/api/v1/last_quote/currencies/AUD/USD.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "last": { - "ask": 0.73124, - "bid": 0.73122, - "exchange": 48, - "timestamp": 1605557756000 - }, - "request_id": "a73a29dbcab4613eeaf48583d3baacf0", - "status": "success", - "symbol": "AUD/USD" -} diff --git a/tests/stubs/api/v1/last_quote/stocks/AAPL.json b/tests/stubs/api/v1/last_quote/stocks/AAPL.json deleted file mode 100644 index eb5964b..0000000 --- a/tests/stubs/api/v1/last_quote/stocks/AAPL.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "symbol": "AAPL", - "status": "success", - "request_id": "9463580f28a577b10c3b46266fc7203e", - "last": { - "askexchange": 8, - "askprice": 119.51, - "asksize": 8, - "bidexchange": 11, - "bidprice": 119.5, - "bidsize": 2, - "timestamp": 1605121721850 - } -} diff --git a/tests/stubs/api/v1/marketstatus/now.json b/tests/stubs/api/v1/marketstatus/now.json deleted file mode 100644 index 990cc08..0000000 --- a/tests/stubs/api/v1/marketstatus/now.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "market": "extended-hours", - "earlyHours": false, - "afterHours": true, - "serverTime": "2020-11-10T22:37:37.000Z", - "exchanges": { - "nyse": "extended-hours", - "nasdaq": "extended-hours", - "otc": "closed" - }, - "currencies": { - "fx": "open", - "crypto": "open" - } -} diff --git a/tests/stubs/api/v1/marketstatus/upcoming.json b/tests/stubs/api/v1/marketstatus/upcoming.json deleted file mode 100644 index abc5784..0000000 --- a/tests/stubs/api/v1/marketstatus/upcoming.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "exchange": "NYSE", - "name": "Thanksgiving", - "date": "2020-11-26T00:00:00.000Z", - "status": "closed" - }, - { - "exchange": "NASDAQ", - "name": "Thanksgiving", - "date": "2020-11-26T00:00:00.000Z", - "status": "closed" - }, - { - "exchange": "OTC", - "name": "Thanksgiving", - "date": "2020-11-26T00:00:00.000Z", - "status": "closed" - }, - { - "exchange": "NASDAQ", - "name": "Thanksgiving", - "date": "2020-11-27T00:00:00.000Z", - "status": "early-close", - "open": "2020-11-27T14:30:00.000Z", - "close": "2020-11-27T18:00:00.000Z" - }, - { - "exchange": "NYSE", - "name": "Thanksgiving", - "date": "2020-11-27T00:00:00.000Z", - "status": "early-close", - "open": "2020-11-27T14:30:00.000Z", - "close": "2020-11-27T18:00:00.000Z" - } -] diff --git a/tests/stubs/api/v1/meta/conditions.json b/tests/stubs/api/v1/meta/conditions.json deleted file mode 100644 index b9e5134..0000000 --- a/tests/stubs/api/v1/meta/conditions.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "0": "Regular", - "1": "Acquisition", - "2": "AveragePrice", - "3": "AutomaticExecution", - "4": "Bunched", - "5": "BunchSold", - "6": "CAPElection", - "7": "CashTrade", - "8": "Closing", - "9": "Cross", - "10": "DerivativelyPriced", - "11": "Distribution", - "12": "FormT(ExtendedHours)", - "13": "FormTOutOfSequence", - "14": "InterMarketSweep", - "15": "MarketCenterOfficialClose", - "16": "MarketCenterOfficialOpen", - "17": "MarketCenterOpening", - "18": "MarketCenterReOpenning", - "19": "MarketCenterClosing", - "20": "NextDay", - "21": "PriceVariation", - "22": "PriorReferencePrice", - "23": "Rule155Amex", - "24": "Rule127Nyse", - "25": "Opening", - "26": "Opened", - "27": "RegularStoppedStock", - "28": "ReOpening", - "29": "Seller", - "30": "SoldLast", - "31": "SoldLastStoppedStock", - "32": "SoldOutOfSequence", - "33": "SoldOutOfSequenceStoppedStock", - "34": "Split", - "35": "StockOption", - "36": "YellowFlag", - "37": "OddLot", - "38": "CorrectedConsolidatedClosePrice", - "39": "Unknown", - "40": "Held", - "41": "TradeThruExempt", - "42": "NonEligible", - "43": "NonEligible-extended", - "44": "Cancelled", - "45": "Recovery", - "46": "Correction", - "47": "AsOf", - "48": "AsOfCorrection", - "49": "AsOfCancel", - "50": "OOB", - "51": "Summary", - "52": "Contingent", - "53": "Contingent(Qualified)", - "54": "Errored" -} diff --git a/tests/stubs/api/v1/meta/crypto-exchanges.json b/tests/stubs/api/v1/meta/crypto-exchanges.json deleted file mode 100644 index 5e6af80..0000000 --- a/tests/stubs/api/v1/meta/crypto-exchanges.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "id": 1, - "type": "exchange", - "market": "crypto", - "name": "Coinbase", - "url": "https://www.coinbase.com/" - }, - { - "id": 2, - "type": "exchange", - "market": "crypto", - "name": "BITFINEX", - "url": "https://www.bitfinex.com/" - }, - { - "id": 6, - "type": "exchange", - "market": "crypto", - "name": "Bitstamp", - "url": "https://www.bitstamp.net/" - }, - { - "id": 23, - "type": "exchange", - "market": "crypto", - "name": "Kraken", - "url": "https://www.kraken.com/en-us/" - } -] diff --git a/tests/stubs/api/v1/meta/exchanges.json b/tests/stubs/api/v1/meta/exchanges.json deleted file mode 100644 index dd539a6..0000000 --- a/tests/stubs/api/v1/meta/exchanges.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "id": 0, - "type": "TRF", - "market": "equities", - "mic": "TFF", - "name": "Multiple", - "tape": "-" - }, - { - "id": 1, - "type": "exchange", - "market": "equities", - "mic": "XASE", - "name": "NYSE American (AMEX)", - "tape": "A", - "code": "AMX" - }, - { - "id": 2, - "type": "exchange", - "market": "equities", - "mic": "XNAS", - "name": "NASDAQ OMX BX", - "tape": "B", - "code": "NSD" - }, - { - "id": 3, - "type": "TRF", - "market": "equities", - "name": "National Stock Exchange", - "mic": "XCIS", - "tape": "C" - } -] diff --git a/tests/stubs/api/v1/meta/symbols/AAPL/company.json b/tests/stubs/api/v1/meta/symbols/AAPL/company.json deleted file mode 100644 index 0ee372a..0000000 --- a/tests/stubs/api/v1/meta/symbols/AAPL/company.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "logo": "https://s3.polygon.io/logos/aapl/logo.png", - "listdate": "1990-01-02T00:00:00.000Z", - "cik": 320193, - "bloomberg": "EQ0010169500001000", - "figi": null, - "lei": "HWUPKR0MPOU8FGXBT394", - "sic": 3571, - "country": "usa", - "industry": "Computer Hardware", - "sector": "Technology", - "marketcap": 908316631180, - "employees": 123000, - "phone": "+1 408 996-1010", - "ceo": "Timothy D. Cook", - "url": "http://www.apple.com", - "description": "Apple Inc is designs, manufactures and markets mobile communication and media devices and personal computers, and sells a variety of related software, services, accessories, networking solutions and third-party digital content and applications.", - "exchange": "Nasdaq Global Select", - "name": "Apple Inc.", - "symbol": "AAPL", - "exchangeSymbol": "NGS", - "hq_address": "1 Infinite Loop Cupertino CA, 95014", - "hq_state": "CA", - "hq_country": "USA", - "type": "CS", - "updated": "11/16/2018", - "tags": [ - "Technology", - "Consumer Electronics", - "Computer Hardware" - ], - "similar": [ - "MSFT", - "NOK", - "IBM", - "HPQ", - "GOOGL", - "BB", - "XLK" - ], - "active": true -} diff --git a/tests/stubs/api/v1/open-close/AAPL/2020-10-14.json b/tests/stubs/api/v1/open-close/AAPL/2020-10-14.json deleted file mode 100644 index 0bd9cab..0000000 --- a/tests/stubs/api/v1/open-close/AAPL/2020-10-14.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "status": "OK", - "from": "2020-10-14T00:00:00.000Z", - "symbol": "AAPL", - "open": 324.66, - "high": 326.2, - "low": 322.3, - "close": 325.12, - "volume": 26122646, - "afterHours": 322.1, - "preMarket": 324.5 -} diff --git a/tests/stubs/api/v1/open-close/crypto/BTC/USD/2020-10-14.json b/tests/stubs/api/v1/open-close/crypto/BTC/USD/2020-10-14.json deleted file mode 100644 index 022ead1..0000000 --- a/tests/stubs/api/v1/open-close/crypto/BTC/USD/2020-10-14.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "symbol": "BTC-USD", - "isUTC": true, - "day": "2020-10-09T00:00:00.000Z", - "open": 10932.44, - "close": 11050.64, - "openTrades": [ - { - "s": 0.002, - "p": 10932.44, - "x": 1, - "t": 1602201600056, - "c": [ - 2 - ] - }, - { - "s": 0.02, - "p": 10923.76, - "x": 4, - "t": 1602201600141, - "c": [ - 2 - ] - } - ], - "closingTrades": [ - { - "s": 0.006128, - "p": 11050.64, - "x": 4, - "t": 1602287999795, - "c": [ - 2 - ] - }, - { - "s": 0.014, - "p": 11049.4, - "x": 17, - "t": 1602287999659, - "c": [ - 1 - ] - } - ] -} diff --git a/tests/stubs/api/v2/aggs/grouped/locale/global/market/crypto/2020-10-14.json b/tests/stubs/api/v2/aggs/grouped/locale/global/market/crypto/2020-10-14.json deleted file mode 100644 index 6825627..0000000 --- a/tests/stubs/api/v2/aggs/grouped/locale/global/market/crypto/2020-10-14.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "status": "OK", - "queryCount": 3, - "resultsCount": 3, - "adjusted": true, - "results": [ - { - "T": "X:ARDRUSD", - "v": 2, - "vw": 0.0551, - "o": 0.0550762, - "c": 0.0550762, - "h": 0.0550762, - "l": 0.0550762, - "t": 1580676480000 - }, - { - "T": "X:NGCUSD", - "v": 4734, - "vw": 0.0273, - "o": 0.0273733, - "c": 0.0272983, - "h": 0.0273733, - "l": 0.0272983, - "t": 1580674080000 - }, - { - "T": "X:ZSCUSD", - "v": 390, - "vw": 0.0003, - "o": 0.00028531, - "c": 0.00028531, - "h": 0.00028531, - "l": 0.00028531, - "t": 1580671080000 - } - ] -} diff --git a/tests/stubs/api/v2/aggs/grouped/locale/global/market/fx/2020-10-14.json b/tests/stubs/api/v2/aggs/grouped/locale/global/market/fx/2020-10-14.json deleted file mode 100644 index ad3c643..0000000 --- a/tests/stubs/api/v2/aggs/grouped/locale/global/market/fx/2020-10-14.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ticker": "C:EURUSD", - "status": "OK", - "queryCount": 1, - "resultsCount": 1, - "adjusted": true, - "results": [ - { - "T": "C:EURUSD", - "v": 14500, - "o": 1.18421, - "c": 1.18522, - "h": 1.18545, - "l": 1.18341, - "t": 1605416400000 - } - ] -} diff --git a/tests/stubs/api/v2/aggs/grouped/locale/us/market/fx/2020-10-14.json b/tests/stubs/api/v2/aggs/grouped/locale/us/market/fx/2020-10-14.json deleted file mode 100644 index 8c4e329..0000000 --- a/tests/stubs/api/v2/aggs/grouped/locale/us/market/fx/2020-10-14.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "status": "OK", - "queryCount": 3, - "resultsCount": 3, - "adjusted": true, - "results": [ - { - "T": "C:CZKMXN", - "v": 29035, - "o": 0.98688, - "c": 0.97531, - "h": 0.9884522, - "l": 0.97468, - "t": 1599019200000 - }, - { - "T": "C:GBPCAD", - "v": 174749, - "o": 1.74807, - "c": 1.74102, - "h": 1.748579, - "l": 1.73482, - "t": 1599019200000 - }, - { - "T": "C:DKKAUD", - "v": 97005, - "o": 0.217479, - "c": 0.217072, - "h": 0.2176943, - "l": 0.2166342, - "t": 1599019200000 - } - ] -} diff --git a/tests/stubs/api/v2/aggs/ticker/AAPL/prev.json b/tests/stubs/api/v2/aggs/ticker/AAPL/prev.json deleted file mode 100644 index f8f223b..0000000 --- a/tests/stubs/api/v2/aggs/ticker/AAPL/prev.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ticker": "AAPL", - "status": "OK", - "queryCount": 1, - "resultsCount": 1, - "adjusted": true, - "results": [ - { - "T": "AAPL", - "v": 131704427, - "vw": 116.3058, - "o": 115.55, - "c": 115.97, - "h": 117.59, - "l": 114.13, - "t": 1605042000000 - } - ], - "request_id": "6a7e466379af0a71039d60cc78e72282" -} diff --git a/tests/stubs/api/v2/aggs/ticker/AAPL/range/1/day/2020-10-14/2020-10-15.json b/tests/stubs/api/v2/aggs/ticker/AAPL/range/1/day/2020-10-14/2020-10-15.json deleted file mode 100644 index ab88845..0000000 --- a/tests/stubs/api/v2/aggs/ticker/AAPL/range/1/day/2020-10-14/2020-10-15.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "ticker": "AAPL", - "status": "OK", - "queryCount": 2, - "resultsCount": 2, - "adjusted": true, - "results": [ - { - "v": 135647456, - "vw": 74.6099, - "o": 74.06, - "c": 75.0875, - "h": 75.15, - "l": 73.7975, - "t": 1577941200000, - "n": 1 - }, - { - "v": 146535512, - "vw": 74.7026, - "o": 74.2875, - "c": 74.3575, - "h": 75.145, - "l": 74.125, - "t": 1578027600000, - "n": 1 - } - ], - "request_id": "6a7e466379af0a71039d60cc78e72282" -} diff --git a/tests/stubs/api/v2/aggs/ticker/C:EURUSD/prev.json b/tests/stubs/api/v2/aggs/ticker/C:EURUSD/prev.json deleted file mode 100644 index ad3c643..0000000 --- a/tests/stubs/api/v2/aggs/ticker/C:EURUSD/prev.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ticker": "C:EURUSD", - "status": "OK", - "queryCount": 1, - "resultsCount": 1, - "adjusted": true, - "results": [ - { - "T": "C:EURUSD", - "v": 14500, - "o": 1.18421, - "c": 1.18522, - "h": 1.18545, - "l": 1.18341, - "t": 1605416400000 - } - ] -} diff --git a/tests/stubs/api/v2/aggs/ticker/C:EURUSD/range/1/day/2020-10-14/2020-10-15.json b/tests/stubs/api/v2/aggs/ticker/C:EURUSD/range/1/day/2020-10-14/2020-10-15.json deleted file mode 100644 index 36e9ad4..0000000 --- a/tests/stubs/api/v2/aggs/ticker/C:EURUSD/range/1/day/2020-10-14/2020-10-15.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "ticker": "C:EURUSD", - "status": "OK", - "queryCount": 2, - "resultsCount": 2, - "adjusted": true, - "results": [ - { - "v": 126690, - "o": 1.11327, - "c": 1.1126, - "h": 1.11536, - "l": 1.1099, - "t": 1590984000000, - "n": 1 - }, - { - "v": 155844, - "o": 1.11269, - "c": 1.12084, - "h": 1.12111, - "l": 1.1114, - "t": 1591070400000, - "n": 1 - } - ], - "request_id": "bb8fedcdc2e6237fc61f32024602593b" -} diff --git a/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/prev.json b/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/prev.json deleted file mode 100644 index def195a..0000000 --- a/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/prev.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "ticker": "X:BTCUSD", - "status": "OK", - "queryCount": 1, - "resultsCount": 1, - "adjusted": true, - "results": [ - { - "T": "X:BTCUSD", - "v": 95045.16897951, - "vw": 15954.2111, - "o": 15937.1, - "c": 16035.9, - "h": 16180, - "l": 15639.2, - "t": 1605416400000 - } - ] -} diff --git a/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/range/1/day/2020-10-14/2020-10-14.json b/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/range/1/day/2020-10-14/2020-10-14.json deleted file mode 100644 index a01ff76..0000000 --- a/tests/stubs/api/v2/aggs/ticker/X:BTCUSD/range/1/day/2020-10-14/2020-10-14.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "ticker": "X:BTCUSD", - "status": "OK", - "queryCount": 2, - "resultsCount": 2, - "adjusted": true, - "results": [ - { - "v": 303067.6562332156, - "vw": 9874.5529, - "o": 9557.9, - "c": 10094.75, - "h": 10429.26, - "l": 9490, - "t": 1590984000000, - "n": 1 - }, - { - "v": 323339.6922892879, - "vw": 9729.5701, - "o": 10096.87, - "c": 9492.62, - "h": 10222.72, - "l": 9135.68, - "t": 1591070400000, - "n": 1 - } - ], - "request_id": "0cf72b6da685bcd386548ffe2895904a" -} diff --git a/tests/stubs/api/v2/last/trade/AAPL.json b/tests/stubs/api/v2/last/trade/AAPL.json deleted file mode 100644 index c62c35d..0000000 --- a/tests/stubs/api/v2/last/trade/AAPL.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "request_id": "f05562305bd26ced64b98ed68b3c5d96", - "status": "OK", - "results": { - "T": "AAPL", - "c": [ - 37 - ], - "f": 1617901342969796400, - "i": "118749", - "p": 129.8473, - "q": 3135876, - "r": 202, - "s": 25, - "t": 1617901342969834000, - "x": 4, - "y": 1617901342968000000, - "z": 3 - } -} diff --git a/tests/stubs/api/v2/last/trade/nbbo/AAPL.json b/tests/stubs/api/v2/last/trade/nbbo/AAPL.json deleted file mode 100644 index 14f8815..0000000 --- a/tests/stubs/api/v2/last/trade/nbbo/AAPL.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "request_id": "b84e24636301f19f88e0dfbf9a45ed5c", - "status": "OK", - "results": { - "P": 127.98, - "S": 7, - "T": "AAPL", - "X": 19, - "p": 127.96, - "q": 83480742, - "s": 1, - "t": 1617827221349730300, - "x": 11, - "y": 1617827221349366000, - "z": 3 - } -} diff --git a/tests/stubs/api/v2/reference/dividends.json b/tests/stubs/api/v2/reference/dividends.json deleted file mode 100644 index 4336ef9..0000000 --- a/tests/stubs/api/v2/reference/dividends.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "status": "OK", - "count": 2, - "results": [ - { - "ticker": "AAPL", - "exDate": "2020-05-08T00:00:00.000Z", - "paymentDate": "2020-05-14T00:00:00.000Z", - "recordDate": "2020-05-11T00:00:00.000Z", - "amount": 0.82 - }, - { - "ticker": "AAPL", - "exDate": "2020-02-07T00:00:00.000Z", - "paymentDate": "2020-02-13T00:00:00.000Z", - "recordDate": "2020-02-10T00:00:00.000Z", - "amount": 0.77 - } - ] -} diff --git a/tests/stubs/api/v2/reference/financials.json b/tests/stubs/api/v2/reference/financials.json deleted file mode 100644 index 85ba34a..0000000 --- a/tests/stubs/api/v2/reference/financials.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "status": "OK", - "count": 1, - "results": [ - { - "ticker": "string", - "period": "Q", - "calendarDate": "2019-03-31", - "reportPeriod": "2019-03-31", - "updated": "1999-03-28", - "accumulatedOtherComprehensiveIncome": 0, - "assets": 0, - "assetsAverage": 0, - "assetsCurrent": 0, - "assetTurnover": 0, - "assetsNonCurrent": 0, - "bookValuePerShare": 0, - "capitalExpenditure": 0, - "cashAndEquivalents": 0, - "cashAndEquivalentsUSD": 0, - "costOfRevenue": 0, - "consolidatedIncome": 0, - "currentRatio": 0, - "debtToEquityRatio": 0, - "debt": 0, - "debtCurrent": 0, - "debtNonCurrent": 0, - "debtUSD": 0, - "deferredRevenue": 0, - "depreciationAmortizationAndAccretion": 0, - "deposits": 0, - "dividendYield": 0, - "dividendsPerBasicCommonShare": 0, - "earningBeforeInterestTaxes": 0, - "earningsBeforeInterestTaxesDepreciationAmortization": 0, - "EBITDAMargin": 0, - "earningsBeforeInterestTaxesDepreciationAmortizationUSD": 0, - "earningBeforeInterestTaxesUSD": 0, - "earningsBeforeTax": 0, - "earningsPerBasicShare": 0, - "earningsPerDilutedShare": 0, - "earningsPerBasicShareUSD": 0, - "shareholdersEquity": 0, - "averageEquity": 0, - "shareholdersEquityUSD": 0, - "enterpriseValue": 0, - "enterpriseValueOverEBIT": 0, - "enterpriseValueOverEBITDA": 0, - "freeCashFlow": 0, - "freeCashFlowPerShare": 0, - "foreignCurrencyUSDExchangeRate": 0, - "grossProfit": 0, - "grossMargin": 0, - "goodwillAndIntangibleAssets": 0, - "interestExpense": 0, - "investedCapital": 0, - "investedCapitalAverage": 0, - "inventory": 0, - "investments": 0, - "investmentsCurrent": 0, - "investmentsNonCurrent": 0, - "totalLiabilities": 0, - "currentLiabilities": 0, - "liabilitiesNonCurrent": 0, - "marketCapitalization": 0, - "netCashFlow": 0, - "netCashFlowBusinessAcquisitionsDisposals": 0, - "issuanceEquityShares": 0, - "issuanceDebtSecurities": 0, - "paymentDividendsOtherCashDistributions": 0, - "netCashFlowFromFinancing": 0, - "netCashFlowFromInvesting": 0, - "netCashFlowInvestmentAcquisitionsDisposals": 0, - "netCashFlowFromOperations": 0, - "effectOfExchangeRateChangesOnCash": 0, - "netIncome": 0, - "netIncomeCommonStock": 0, - "netIncomeCommonStockUSD": 0, - "netLossIncomeFromDiscontinuedOperations": 0, - "netIncomeToNonControllingInterests": 0, - "profitMargin": 0, - "operatingExpenses": 0, - "operatingIncome": 0, - "tradeAndNonTradePayables": 0, - "payoutRatio": 0, - "priceToBookValue": 0, - "priceEarnings": 0, - "priceToEarningsRatio": 0, - "propertyPlantEquipmentNet": 0, - "preferredDividendsIncomeStatementImpact": 0, - "sharePriceAdjustedClose": 0, - "priceSales": 0, - "priceToSalesRatio": 0, - "tradeAndNonTradeReceivables": 0, - "accumulatedRetainedEarningsDeficit": 0, - "revenues": 0, - "revenuesUSD": 0, - "researchAndDevelopmentExpense": 0, - "returnOnAverageAssets": 0, - "returnOnAverageEquity": 0, - "returnOnInvestedCapital": 0, - "returnOnSales": 0, - "shareBasedCompensation": 0, - "sellingGeneralAndAdministrativeExpense": 0, - "shareFactor": 0, - "shares": 0, - "weightedAverageShares": 0, - "weightedAverageSharesDiluted": 0, - "salesPerShare": 0, - "tangibleAssetValue": 0, - "taxAssets": 0, - "incomeTaxExpense": 0, - "taxLiabilities": 0, - "tangibleAssetsBookValuePerShare": 0, - "workingCapital": 0 - } - ] -} diff --git a/tests/stubs/api/v2/reference/locales.json b/tests/stubs/api/v2/reference/locales.json deleted file mode 100644 index 8f4643f..0000000 --- a/tests/stubs/api/v2/reference/locales.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "status": "OK", - "results": [ - { - "locale": "G", - "name": "Global" - }, - { - "locale": "US", - "name": "United States of America" - }, - { - "locale": "GB", - "name": "Great Britain" - }, - { - "locale": "CA", - "name": "Canada" - }, - { - "locale": "NL", - "name": "Netherlands" - }, - { - "locale": "GR", - "name": "Greece" - }, - { - "locale": "SP", - "name": "Spain" - }, - { - "locale": "DE", - "name": "Germany" - }, - { - "locale": "BE", - "name": "Belgium" - }, - { - "locale": "DK", - "name": "Denmark" - }, - { - "locale": "FI", - "name": "Finland" - }, - { - "locale": "IE", - "name": "Ireland" - }, - { - "locale": "PT", - "name": "Portugal" - }, - { - "locale": "IN", - "name": "India" - }, - { - "locale": "MX", - "name": "Mexico" - }, - { - "locale": "FR", - "name": "France" - }, - { - "locale": "CN", - "name": "China" - }, - { - "locale": "CH", - "name": "Switzerland" - }, - { - "locale": "SE", - "name": "Sweden" - } - ] -} diff --git a/tests/stubs/api/v2/reference/markets.json b/tests/stubs/api/v2/reference/markets.json deleted file mode 100644 index 66d242d..0000000 --- a/tests/stubs/api/v2/reference/markets.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "status": "OK", - "results": [ - { - "market": "STOCKS", - "desc": "Stocks / Equities / ETFs" - }, - { - "market": "INDICES", - "desc": "Indices" - }, - { - "market": "MF", - "desc": "Mutual Funds" - }, - { - "market": "MMF", - "desc": "Money Market Funds" - }, - { - "market": "CRYPTO", - "desc": "Crypto" - }, - { - "market": "FX", - "desc": "Forex / Currencies" - }, - { - "market": "BONDS", - "desc": "Bonds" - } - ] -} diff --git a/tests/stubs/api/v2/reference/news.json b/tests/stubs/api/v2/reference/news.json deleted file mode 100644 index 45cd958..0000000 --- a/tests/stubs/api/v2/reference/news.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "results": [ - { - "id": "nJsSJJdwViHZcw5367rZi7_qkXLfMzacXBfpv-vD9UA", - "publisher": { - "name": "Benzinga", - "homepage_url": "https://www.benzinga.com/", - "logo_url": "https://storage.googleapis.com/polygon-io-public/assets/news/logos/benzinga.svg", - "favicon_url": "https://storage.googleapis.com/polygon-io-public/assets/news/favicons/benzinga.ico" - }, - "title": "Cathie Wood Adds More Coinbase, Skillz, Trims Square", - "author": "Rachit Vats", - "published_utc": "2021-04-26T02:33:17Z", - "article_url": "https://www.benzinga.com/markets/cryptocurrency/21/04/20784086/cathie-wood-adds-more-coinbase-skillz-trims-square", - "tickers": [ - "DOCU", - "DDD", - "NIU", - "ARKF", - "NVDA", - "SKLZ", - "PCAR", - "MASS", - "PSTI", - "SPFR", - "TREE", - "PHR", - "IRDM", - "BEAM", - "ARKW", - "ARKK", - "ARKG", - "PSTG", - "SQ", - "IONS", - "SYRS" - ], - "amp_url": "https://amp.benzinga.com/amp/content/20784086", - "image_url": "https://cdn2.benzinga.com/files/imagecache/og_image_social_share_1200x630/images/story/2012/andre-francois-mckenzie-auhr4gcqcce-unsplash.jpg?width=720", - "description": "

Cathie Wood-led Ark Investment Management on Friday snapped up another 221,167 shares of the cryptocurrency exchange Coinbase Global Inc (NASDAQ: COIN) worth about $64.49 million on the stock’s Friday’s dip and also its fourth-straight loss.

\n

The investment firm’s Ark Innovation ETF (NYSE: ARKK) bought the shares of the company that closed 0.63% lower at $291.60 on Friday, giving the cryptocurrency exchange a market cap of $58.09 billion. Coinbase’s market cap has dropped from $85.8 billion on its blockbuster listing earlier this month.

\n

The New York-based company also added another 3,873 shares of the mobile gaming company Skillz Inc (NYSE: SKLZ), just a day after snapping 1.2 million shares of the stock.

\n

ARKK bought the shares of the company which closed ...

Full story available on Benzinga.com

", - "keywords": [ - "Sector ETFs", - "Penny Stocks", - "Cryptocurrency", - "Small Cap", - "Markets", - "Trading Ideas", - "ETFs" - ] - } - ], - "status": "OK", - "request_id": "831afdb0b8078549fed053476984947a", - "count": 1, - "next_url": "https://api.polygon.io:443/v2/reference/news?cursor=eyJsaW1pdCI6MSwic29ydCI6InB1Ymxpc2hlZF91dGMiLCJvcmRlciI6ImFzY2VuZGluZyIsInRpY2tlciI6e30sInB1Ymxpc2hlZF91dGMiOnsiZ3RlIjoiMjAyMS0wNC0yNiJ9LCJzZWFyY2hfYWZ0ZXIiOlsxNjE5NDA0Mzk3MDAwLG51bGxdfQ" -} diff --git a/tests/stubs/api/v2/reference/splits.json b/tests/stubs/api/v2/reference/splits.json deleted file mode 100644 index 8755fac..0000000 --- a/tests/stubs/api/v2/reference/splits.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "status": "OK", - "count": 4, - "results": [ - { - "ticker": "AAPL", - "exDate": "2020-08-31T00:00:00.000Z", - "paymentDate": "2020-08-28T00:00:00.000Z", - "declaredDate": "2020-07-30T00:00:00.000Z", - "ratio": 0.25, - "tofactor": 1, - "forfactor": 4 - }, - { - "ticker": "AAPL", - "exDate": "2014-06-09T00:00:00.000Z", - "paymentDate": "2014-06-10T00:00:00.000Z", - "ratio": 0.14285714285714285, - "tofactor": 1, - "forfactor": 7 - }, - { - "ticker": "AAPL", - "exDate": "2005-02-28T00:00:00.000Z", - "paymentDate": "2005-02-28T00:00:00.000Z", - "ratio": 0.5 - }, - { - "ticker": "AAPL", - "exDate": "2000-06-21T00:00:00.000Z", - "paymentDate": "2000-06-21T00:00:00.000Z", - "ratio": 0.5 - } - ] -} diff --git a/tests/stubs/api/v2/reference/types.json b/tests/stubs/api/v2/reference/types.json deleted file mode 100644 index 1077ae7..0000000 --- a/tests/stubs/api/v2/reference/types.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "status": "OK", - "results": { - "types": { - "CS": "Common Stock", - "BOND": "Bond", - "BASKET": "Basket", - "ADRC": "American Depository Receipt Common", - "ADRP": "American Depository Receipt Preferred", - "ADRW": "American Depository Receipt Warrant", - "ADRR": "American Depository Receipt Right", - "NVDR": "Non-Voting Depository Receipt", - "GDR": "Global Depositary Receipt", - "SDR": "Special Drawing Right", - "CEF": "Closed-End Fund", - "ETP": "Exchange Traded Product/Fund", - "REIT": "Real Estate Investment Trust", - "MLP": "Master Limited Partnership", - "WRT": "Equity WRT", - "PUB": "Public", - "NYRS": "New York Registry Shares", - "UNIT": "Unit", - "RIGHT": "Right", - "TRAK": "Tracking stock or targeted stock", - "LTDP": "Limited Partnership", - "RYLT": "Royalty Trust", - "MF": "Mutual Fund", - "PFD": "Preferred Stock", - "FDR": "Foreign Ordinary Shares", - "OST": "Other Security Type", - "FUND": "Fund", - "SP": "Structured Product", - "SI": "Secondary Issue", - "WARRANT": "Warrant" - }, - "indexTypes": { - "INDEX": "Index", - "ETF": "Exchange Traded Fund (ETF)", - "ETN": "Exchange Traded Note (ETN)", - "ETMF": "Exchange Traded Managed Fund (ETMF)", - "SETTLEMENT": "Settlement", - "SPOT": "Spot", - "SUBPROD": "Subordinated product", - "WC": "World Currency", - "ALPHAINDEX": "Alpha Index" - } - } -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/gainers.json b/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/gainers.json deleted file mode 100644 index 9d20fbc..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/gainers.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "status": "OK", - "tickers": [ - { - "day": { - "c": 0.0374, - "h": 0.062377, - "l": 0.01162, - "o": 0.044834, - "v": 27313165.159427017, - "vw": 0 - }, - "lastTrade": { - "c": [ - 2 - ], - "i": "517478762", - "p": 0.0374, - "s": 499, - "t": 1604409649544, - "x": 2 - }, - "min": { - "c": 0.062377, - "h": 0.062377, - "l": 0.062377, - "o": 0.062377, - "v": 35420, - "vw": 0 - }, - "prevDay": { - "c": 0.01162, - "h": 0.044834, - "l": 0.01162, - "o": 0.044834, - "v": 53616273.36827199, - "vw": 0.0296 - }, - "ticker": "X:DRNUSD", - "todaysChange": 0.02578, - "todaysChangePerc": 221.858864, - "updated": 1605330008999 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers.json b/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers.json deleted file mode 100644 index 826315a..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "status": "OK", - "tickers": [ - { - "day": { - "c": 0.296, - "h": 0.59714, - "l": 0.23706, - "o": 0.28, - "v": 4097699.5691991993, - "vw": 0 - }, - "lastTrade": { - "c": [ - 1 - ], - "i": 413131, - "p": 0.293, - "s": 13.6191, - "t": 1605292686010, - "x": 17 - }, - "min": { - "c": 0.296, - "h": 0.296, - "l": 0.294, - "o": 0.296, - "v": 123.4866, - "vw": 0 - }, - "prevDay": { - "c": 0.281, - "h": 0.59714, - "l": 0.23706, - "o": 0.27, - "v": 6070178.786154971, - "vw": 0.4076 - }, - "ticker": "X:FSNUSD", - "todaysChange": 0.012, - "todaysChangePerc": 4.270463, - "updated": 1605330008999 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD.json b/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD.json deleted file mode 100644 index d6f377a..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "request_id": "ad92e92ce183112c593717f00dfebd2c", - "status": "OK", - "ticker": { - "day": { - "c": 16260.85, - "h": 16428.4, - "l": 15830.4, - "o": 16418.07, - "v": 105008.84231068, - "vw": 0 - }, - "lastTrade": { - "c": [ - 2 - ], - "i": "464569520", - "p": 16242.31, - "s": 0.001933, - "t": 1605294230780, - "x": 4 - }, - "min": { - "c": 16235.1, - "h": 16264.29, - "l": 16129.3, - "o": 16257.51, - "v": 19.30791925, - "vw": 0 - }, - "prevDay": { - "c": 16399.24, - "h": 16418.07, - "l": 16399.24, - "o": 16418.07, - "v": 0.99167108, - "vw": 16402.6893 - }, - "ticker": "X:BTCUSD", - "todaysChange": -156.93, - "todaysChangePerc": -0.956935, - "updated": 1605330008999 - } -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD/book.json b/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD/book.json deleted file mode 100644 index e4484f5..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/crypto/tickers/X:BTCUSD/book.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "status": "OK", - "data": { - "ticker": "X:BTCUSD", - "bids": [ - { - "p": 16303.17, - "x": { - "1": 2 - } - }, - { - "p": 16302.94, - "x": { - "1": 0.02859424, - "6": 0.023455 - } - } - ], - "asks": [ - { - "p": 11454, - "x": { - "2": 1 - } - }, - { - "p": 11455, - "x": { - "2": 1 - } - } - ], - "bidCount": 694.951789670001, - "askCount": 593.1412981600005, - "spread": -4849.17, - "updated": 1605295074162 - } -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/gainers.json b/tests/stubs/api/v2/snapshot/locale/global/markets/forex/gainers.json deleted file mode 100644 index c5bb28c..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/gainers.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "status": "OK", - "tickers": [ - { - "day": { - "c": 0.886156, - "h": 0.887111, - "l": 0.8825327, - "o": 0.8844732, - "v": 1041 - }, - "lastQuote": { - "a": 0.8879606, - "b": 0.886156, - "t": 1605283204000, - "x": 48 - }, - "min": { - "c": 0.886156, - "h": 0.886156, - "l": 0.886156, - "o": 0.886156, - "v": 1 - }, - "prevDay": { - "c": 0.8428527, - "h": 0.889773, - "l": 0.8428527, - "o": 0.8848539, - "v": 1078, - "vw": 0 - }, - "ticker": "C:PLNILS", - "todaysChange": 0.0433033, - "todaysChangePerc": 5.13770674, - "updated": 1605330008999 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers.json b/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers.json deleted file mode 100644 index 38075db..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "status": "OK", - "tickers": [ - { - "day": { - "c": 0.11778221, - "h": 0.11812263, - "l": 0.11766631, - "o": 0.11797149, - "v": 77794 - }, - "lastQuote": { - "a": 0.11780678, - "b": 0.11777952, - "t": 1605280919000, - "x": 48 - }, - "min": { - "c": 0.117769, - "h": 0.11779633, - "l": 0.11773698, - "o": 0.11778, - "v": 202 - }, - "prevDay": { - "c": 0.11797258, - "h": 0.11797258, - "l": 0.11797149, - "o": 0.11797149, - "v": 2, - "vw": 0 - }, - "ticker": "C:HKDCHF", - "todaysChange": -0.00019306, - "todaysChangePerc": -0.1636482, - "updated": 1605280919000 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers/C:EURUSD.json b/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers/C:EURUSD.json deleted file mode 100644 index 6174f40..0000000 --- a/tests/stubs/api/v2/snapshot/locale/global/markets/forex/tickers/C:EURUSD.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "request_id": "ad76e76ce183002c5937a7f02dfebde4", - "status": "OK", - "ticker": { - "day": { - "c": 1.18403, - "h": 1.1906, - "l": 1.18001, - "o": 1.18725, - "v": 83578 - }, - "lastQuote": { - "a": 1.18403, - "b": 1.18398, - "i": 0, - "t": 1606163759000, - "x": 48 - }, - "min": { - "c": 1.18396, - "h": 1.18423, - "l": 1.1838, - "o": 1.18404, - "v": 41 - }, - "prevDay": { - "c": 1.18724, - "h": 1.18727, - "l": 1.18725, - "o": 1.18725, - "v": 5, - "vw": 0 - }, - "ticker": "C:EURUSD", - "todaysChange": -0.00316, - "todaysChangePerc": -0.27458312, - "updated": 1606163759000 - } -} diff --git a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/gainers.json b/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/gainers.json deleted file mode 100644 index b602a06..0000000 --- a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/gainers.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "status": "OK", - "tickers": [ - { - "day": { - "c": 14.2284, - "h": 15.09, - "l": 14.2, - "o": 14.33, - "v": 133963, - "vw": 14.5311 - }, - "lastQuote": { - "P": 14.44, - "S": 11, - "p": 14.2, - "s": 25, - "t": 1605195929997325600 - }, - "lastTrade": { - "c": [ - 63 - ], - "i": "79372124707124", - "p": 14.2284, - "s": 536, - "t": 1605195848258266000, - "x": 4 - }, - "min": { - "av": 133963, - "c": 14.2284, - "h": 14.325, - "l": 14.2, - "o": 14.28, - "v": 6108, - "vw": 14.2426 - }, - "prevDay": { - "c": 0.73, - "h": 0.799, - "l": 0.73, - "o": 0.75, - "v": 1568097, - "vw": 0.7721 - }, - "ticker": "PDS", - "todaysChange": 13.498, - "todaysChangePerc": 1849.096, - "updated": 1605195848258266000 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers.json b/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers.json deleted file mode 100644 index 9bd0c93..0000000 --- a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "status": "OK", - "count": 1, - "tickers": [ - { - "day": { - "c": 20.506, - "h": 20.64, - "l": 20.506, - "o": 20.64, - "v": 37216, - "vw": 20.616 - }, - "lastQuote": { - "P": 20.6, - "S": 22, - "p": 20.5, - "s": 13, - "t": 1605192959994246100 - }, - "lastTrade": { - "c": [ - 14, - 41 - ], - "i": "71675577320245", - "p": 20.506, - "s": 2416, - "t": 1605192894630916600, - "x": 4 - }, - "min": { - "av": 37216, - "c": 20.506, - "h": 20.506, - "l": 20.506, - "o": 20.506, - "v": 5000, - "vw": 20.5105 - }, - "prevDay": { - "c": 20.63, - "h": 21, - "l": 20.5, - "o": 20.79, - "v": 292738, - "vw": 20.6939 - }, - "ticker": "BCAT", - "todaysChange": -0.124, - "todaysChangePerc": -0.601, - "updated": 1605192894630916600 - } - ] -} diff --git a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json b/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json deleted file mode 100644 index 089d571..0000000 --- a/tests/stubs/api/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "status": "OK", - "ticker": { - "day": { - "c": 120.4229, - "h": 120.53, - "l": 118.81, - "o": 119.62, - "v": 28727868, - "vw": 119.725 - }, - "lastQuote": { - "P": 120.47, - "S": 4, - "p": 120.46, - "s": 8, - "t": 1605195918507251700 - }, - "lastTrade": { - "c": [ - 14, - 41 - ], - "i": "4046", - "p": 120.47, - "s": 236, - "t": 1605195918306274000, - "x": 10 - }, - "min": { - "av": 28724441, - "c": 120.4201, - "h": 120.468, - "l": 120.37, - "o": 120.435, - "v": 270796, - "vw": 120.4129 - }, - "prevDay": { - "c": 119.49, - "h": 119.63, - "l": 116.44, - "o": 117.19, - "v": 110597265, - "vw": 118.4998 - }, - "ticker": "AAPL", - "todaysChange": 0.98, - "todaysChangePerc": 0.82, - "updated": 1605195918306274000 - } -} diff --git a/tests/stubs/api/v2/ticks/stocks/AAPL/2020-10-14.json b/tests/stubs/api/v2/ticks/stocks/AAPL/2020-10-14.json deleted file mode 100644 index 803e8f5..0000000 --- a/tests/stubs/api/v2/ticks/stocks/AAPL/2020-10-14.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "ticker": "AAPL", - "results_count": 2, - "db_latency": 11, - "success": true, - "results": [ - { - "t": 1517562000016036600, - "y": 1517562000015577000, - "q": 1063, - "i": "1", - "x": 11, - "s": 100, - "c": [ - 12, - 41 - ], - "p": 171.55, - "z": 3 - }, - { - "t": 1517562000016038100, - "y": 1517562000015577600, - "q": 1064, - "i": "2", - "x": 11, - "s": 100, - "c": [ - 12, - 41 - ], - "p": 171.55, - "z": 3 - } - ], - "map": { - "I": { - "name": "orig_id", - "type": "string" - }, - "x": { - "name": "exchange", - "type": "int" - }, - "p": { - "name": "price", - "type": "float64" - }, - "i": { - "name": "id", - "type": "string" - }, - "e": { - "name": "correction", - "type": "int" - }, - "r": { - "name": "trf_id", - "type": "int" - }, - "t": { - "name": "sip_timestamp", - "type": "int64" - }, - "y": { - "name": "participant_timestamp", - "type": "int64" - }, - "f": { - "name": "trf_timestamp", - "type": "int64" - }, - "q": { - "name": "sequence_number", - "type": "int64" - }, - "c": { - "name": "conditions", - "type": "int" - }, - "s": { - "name": "size", - "type": "int" - }, - "z": { - "name": "tape", - "type": "int" - } - } -} diff --git a/tests/stubs/api/v2/ticks/stocks/nbbo/AAPL/2020-10-14.json b/tests/stubs/api/v2/ticks/stocks/nbbo/AAPL/2020-10-14.json deleted file mode 100644 index 04a17a0..0000000 --- a/tests/stubs/api/v2/ticks/stocks/nbbo/AAPL/2020-10-14.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "ticker": "AAPL", - "success": true, - "results_count": 2, - "db_latency": 43, - "results": [ - { - "t": 1517562000065700400, - "y": 1517562000065321200, - "q": 2060, - "c": [ - 1 - ], - "z": 3, - "p": 102.7, - "s": 60, - "x": 11, - "P": 0, - "S": 0, - "X": 0 - }, - { - "t": 1517562000065791500, - "y": 1517562000065408300, - "q": 2061, - "c": [ - 1 - ], - "z": 3, - "p": 170, - "s": 2, - "x": 11, - "P": 0, - "S": 0, - "X": 0 - } - ], - "map": { - "t": { - "name": "sip_timestamp", - "type": "int64" - }, - "y": { - "name": "participant_timestamp", - "type": "int64" - }, - "i": { - "name": "indicators", - "type": "int" - }, - "P": { - "name": "ask_price", - "type": "float64" - }, - "X": { - "name": "ask_exchange", - "type": "int" - }, - "f": { - "name": "trf_timestamp", - "type": "int64" - }, - "q": { - "name": "sequence_number", - "type": "int" - }, - "c": { - "name": "conditions", - "type": "int" - }, - "p": { - "name": "bid_price", - "type": "float64" - }, - "s": { - "name": "bid_size", - "type": "int" - }, - "x": { - "name": "bid_exchange", - "type": "int" - }, - "S": { - "name": "ask_size", - "type": "int" - }, - "z": { - "name": "tape", - "type": "int" - } - } -} diff --git a/tests/stubs/api/v3/reference/tickers.json b/tests/stubs/api/v3/reference/tickers.json deleted file mode 100644 index 16df86c..0000000 --- a/tests/stubs/api/v3/reference/tickers.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "results": [ - { - "ticker": "A", - "name": "Agilent Technologies Inc.", - "market": "stocks", - "locale": "us", - "primary_exchange": "XNYS", - "type": "CS", - "active": true, - "currency_name": "usd", - "cik": "0001090872", - "composite_figi": "BBG000BWQYZ5", - "share_class_figi": "BBG001SCTQY4", - "last_updated_utc": "2021-04-25T00:00:00Z" - } - ], - "status": "OK", - "request_id": "e70013d92930de90e089dc8fa098888e", - "count": 1, - "next_url": "https://api.polygon.io/vX/reference/tickers?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy" -} diff --git a/tests/stubs/api/v3/reference/types.json b/tests/stubs/api/v3/reference/types.json deleted file mode 100644 index 1077ae7..0000000 --- a/tests/stubs/api/v3/reference/types.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "status": "OK", - "results": { - "types": { - "CS": "Common Stock", - "BOND": "Bond", - "BASKET": "Basket", - "ADRC": "American Depository Receipt Common", - "ADRP": "American Depository Receipt Preferred", - "ADRW": "American Depository Receipt Warrant", - "ADRR": "American Depository Receipt Right", - "NVDR": "Non-Voting Depository Receipt", - "GDR": "Global Depositary Receipt", - "SDR": "Special Drawing Right", - "CEF": "Closed-End Fund", - "ETP": "Exchange Traded Product/Fund", - "REIT": "Real Estate Investment Trust", - "MLP": "Master Limited Partnership", - "WRT": "Equity WRT", - "PUB": "Public", - "NYRS": "New York Registry Shares", - "UNIT": "Unit", - "RIGHT": "Right", - "TRAK": "Tracking stock or targeted stock", - "LTDP": "Limited Partnership", - "RYLT": "Royalty Trust", - "MF": "Mutual Fund", - "PFD": "Preferred Stock", - "FDR": "Foreign Ordinary Shares", - "OST": "Other Security Type", - "FUND": "Fund", - "SP": "Structured Product", - "SI": "Secondary Issue", - "WARRANT": "Warrant" - }, - "indexTypes": { - "INDEX": "Index", - "ETF": "Exchange Traded Fund (ETF)", - "ETN": "Exchange Traded Note (ETN)", - "ETMF": "Exchange Traded Managed Fund (ETMF)", - "SETTLEMENT": "Settlement", - "SPOT": "Spot", - "SUBPROD": "Subordinated product", - "WC": "World Currency", - "ALPHAINDEX": "Alpha Index" - } - } -} diff --git a/tests/stubs/api/vX/reference/tickers/AAPL.json b/tests/stubs/api/vX/reference/tickers/AAPL.json deleted file mode 100644 index de3ed27..0000000 --- a/tests/stubs/api/vX/reference/tickers/AAPL.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "results": { - "ticker": "AAPL", - "name": "Apple Inc.", - "market": "stocks", - "locale": "us", - "primary_exchange": "XNAS", - "type": "CS", - "active": true, - "currency_name": "usd", - "cik": "0000320193", - "composite_figi": "BBG000B9XRY4", - "share_class_figi": "BBG001S5N8V8", - "last_updated_utc": "2020-12-27T00:00:00Z", - "outstanding_shares": 17001800000, - "market_cap": 2082042128180, - "phone_number": "(408) 996-1010", - "address": { - "address1": "One Apple Park Way", - "city": "Cupertino", - "state": "CA" - }, - "sic_code": "3571", - "sic_description": "ELECTRONIC COMPUTERS" - }, - "status": "OK", - "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe", - "count": 1 -}