From 48ef341c0ecc8dc6bf61e8bb09a2b6a3f0033d27 Mon Sep 17 00:00:00 2001 From: jbonzo Date: Fri, 1 Nov 2019 08:17:30 -0400 Subject: [PATCH 01/16] Added gitignore --- .gitignore | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c1a28fd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,71 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Sphinx documentation +docs/_build/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ From 52b61106e1dade12d3043b852fee05056d5dc60e Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:12 -0500 Subject: [PATCH 02/16] Adding swagger generated code --- polygon/rest/api/__init__.py | 9 + polygon/rest/api/crypto_api.py | 1170 +++++++ polygon/rest/api/forex__currencies_api.py | 893 +++++ polygon/rest/api/reference_api.py | 1082 ++++++ polygon/rest/api/stocks__equities_api.py | 1590 +++++++++ polygon/rest/models/__init__.py | 66 + polygon/rest/models/agg_response.py | 255 ++ polygon/rest/models/aggregate.py | 288 ++ polygon/rest/models/aggv2.py | 314 ++ polygon/rest/models/analyst_ratings.py | 346 ++ polygon/rest/models/company.py | 700 ++++ polygon/rest/models/condition_type_map.py | 85 + polygon/rest/models/conflict.py | 111 + polygon/rest/models/crypto_exchange.py | 242 ++ polygon/rest/models/crypto_snapshot_agg.py | 230 ++ .../rest/models/crypto_snapshot_book_item.py | 143 + polygon/rest/models/crypto_snapshot_ticker.py | 309 ++ .../models/crypto_snapshot_ticker_book.py | 283 ++ polygon/rest/models/crypto_tick.py | 230 ++ polygon/rest/models/crypto_tick_json.py | 230 ++ polygon/rest/models/dividend.py | 345 ++ polygon/rest/models/earning.py | 458 +++ polygon/rest/models/error.py | 163 + polygon/rest/models/exchange.py | 271 ++ polygon/rest/models/financial.py | 666 ++++ polygon/rest/models/financials.py | 2954 +++++++++++++++++ polygon/rest/models/forex.py | 172 + polygon/rest/models/forex_aggregate.py | 259 ++ polygon/rest/models/forex_snapshot_agg.py | 230 ++ polygon/rest/models/forex_snapshot_ticker.py | 309 ++ polygon/rest/models/hist_trade.py | 317 ++ polygon/rest/models/last_forex_quote.py | 201 ++ polygon/rest/models/last_forex_trade.py | 172 + polygon/rest/models/last_quote.py | 288 ++ polygon/rest/models/last_trade.py | 317 ++ polygon/rest/models/market_holiday.py | 269 ++ polygon/rest/models/market_status.py | 202 ++ polygon/rest/models/news.py | 311 ++ polygon/rest/models/not_found.py | 111 + polygon/rest/models/quote.py | 317 ++ polygon/rest/models/rating_section.py | 257 ++ polygon/rest/models/split.py | 313 ++ polygon/rest/models/stock_symbol.py | 85 + polygon/rest/models/stocks_snapshot_agg.py | 230 ++ .../rest/models/stocks_snapshot_book_item.py | 143 + polygon/rest/models/stocks_snapshot_quote.py | 230 ++ polygon/rest/models/stocks_snapshot_ticker.py | 335 ++ .../models/stocks_snapshot_ticker_book.py | 283 ++ polygon/rest/models/stocks_v2_nbbo.py | 486 +++ polygon/rest/models/stocks_v2_trade.py | 401 +++ polygon/rest/models/symbol.py | 257 ++ polygon/rest/models/symbol_type_map.py | 85 + polygon/rest/models/ticker.py | 396 +++ polygon/rest/models/ticker_symbol.py | 85 + polygon/rest/models/trade.py | 317 ++ polygon/rest/models/unauthorized.py | 111 + 56 files changed, 20922 insertions(+) create mode 100644 polygon/rest/api/__init__.py create mode 100644 polygon/rest/api/crypto_api.py create mode 100644 polygon/rest/api/forex__currencies_api.py create mode 100644 polygon/rest/api/reference_api.py create mode 100644 polygon/rest/api/stocks__equities_api.py create mode 100644 polygon/rest/models/__init__.py create mode 100644 polygon/rest/models/agg_response.py create mode 100644 polygon/rest/models/aggregate.py create mode 100644 polygon/rest/models/aggv2.py create mode 100644 polygon/rest/models/analyst_ratings.py create mode 100644 polygon/rest/models/company.py create mode 100644 polygon/rest/models/condition_type_map.py create mode 100644 polygon/rest/models/conflict.py create mode 100644 polygon/rest/models/crypto_exchange.py create mode 100644 polygon/rest/models/crypto_snapshot_agg.py create mode 100644 polygon/rest/models/crypto_snapshot_book_item.py create mode 100644 polygon/rest/models/crypto_snapshot_ticker.py create mode 100644 polygon/rest/models/crypto_snapshot_ticker_book.py create mode 100644 polygon/rest/models/crypto_tick.py create mode 100644 polygon/rest/models/crypto_tick_json.py create mode 100644 polygon/rest/models/dividend.py create mode 100644 polygon/rest/models/earning.py create mode 100644 polygon/rest/models/error.py create mode 100644 polygon/rest/models/exchange.py create mode 100644 polygon/rest/models/financial.py create mode 100644 polygon/rest/models/financials.py create mode 100644 polygon/rest/models/forex.py create mode 100644 polygon/rest/models/forex_aggregate.py create mode 100644 polygon/rest/models/forex_snapshot_agg.py create mode 100644 polygon/rest/models/forex_snapshot_ticker.py create mode 100644 polygon/rest/models/hist_trade.py create mode 100644 polygon/rest/models/last_forex_quote.py create mode 100644 polygon/rest/models/last_forex_trade.py create mode 100644 polygon/rest/models/last_quote.py create mode 100644 polygon/rest/models/last_trade.py create mode 100644 polygon/rest/models/market_holiday.py create mode 100644 polygon/rest/models/market_status.py create mode 100644 polygon/rest/models/news.py create mode 100644 polygon/rest/models/not_found.py create mode 100644 polygon/rest/models/quote.py create mode 100644 polygon/rest/models/rating_section.py create mode 100644 polygon/rest/models/split.py create mode 100644 polygon/rest/models/stock_symbol.py create mode 100644 polygon/rest/models/stocks_snapshot_agg.py create mode 100644 polygon/rest/models/stocks_snapshot_book_item.py create mode 100644 polygon/rest/models/stocks_snapshot_quote.py create mode 100644 polygon/rest/models/stocks_snapshot_ticker.py create mode 100644 polygon/rest/models/stocks_snapshot_ticker_book.py create mode 100644 polygon/rest/models/stocks_v2_nbbo.py create mode 100644 polygon/rest/models/stocks_v2_trade.py create mode 100644 polygon/rest/models/symbol.py create mode 100644 polygon/rest/models/symbol_type_map.py create mode 100644 polygon/rest/models/ticker.py create mode 100644 polygon/rest/models/ticker_symbol.py create mode 100644 polygon/rest/models/trade.py create mode 100644 polygon/rest/models/unauthorized.py diff --git a/polygon/rest/api/__init__.py b/polygon/rest/api/__init__.py new file mode 100644 index 00000000..2d9a3a64 --- /dev/null +++ b/polygon/rest/api/__init__.py @@ -0,0 +1,9 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from .crypto_api import CryptoApi +from .forex__currencies_api import ForexCurrenciesApi +from .reference_api import ReferenceApi +from .stocks__equities_api import StocksEquitiesApi diff --git a/polygon/rest/api/crypto_api.py b/polygon/rest/api/crypto_api.py new file mode 100644 index 00000000..dbe867c6 --- /dev/null +++ b/polygon/rest/api/crypto_api.py @@ -0,0 +1,1170 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class CryptoApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def v1_historic_crypto_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 + """Historic Crypto Trades # noqa: E501 + + Get historic trade ticks for a crypto pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_crypto_from_to_date_get(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the crypto pair (required) + :param str to: To Symbol of the crypto pair (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 10000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + return data + + def v1_historic_crypto_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 + """Historic Crypto Trades # noqa: E501 + + Get historic trade ticks for a crypto pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the crypto pair (required) + :param str to: To Symbol of the crypto pair (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 10000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to', '_date', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_historic_crypto_from_to_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/historic/crypto/{from}/{to}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_last_crypto_from_to_get(self, _from, to, **kwargs): # noqa: E501 + """Last Trade for a Crypto Pair # noqa: E501 + + Get Last Trade Tick for a Currency Pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_crypto_from_to_get(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_last_crypto_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + else: + (data) = self.v1_last_crypto_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + return data + + def v1_last_crypto_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 + """Last Trade for a Crypto Pair # noqa: E501 + + Get Last Trade Tick for a Currency Pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_crypto_from_to_get_with_http_info(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_last_crypto_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_last_crypto_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_last_crypto_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/last/crypto/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_meta_crypto_exchanges_get(self, **kwargs): # noqa: E501 + """Crypto Exchanges # noqa: E501 + + List of crypto currency exchanges which are supported by Polygon.io # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_crypto_exchanges_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[CryptoExchange] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_meta_crypto_exchanges_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v1_meta_crypto_exchanges_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v1_meta_crypto_exchanges_get_with_http_info(self, **kwargs): # noqa: E501 + """Crypto Exchanges # noqa: E501 + + List of crypto currency exchanges which are supported by Polygon.io # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_crypto_exchanges_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[CryptoExchange] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_meta_crypto_exchanges_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/meta/crypto-exchanges', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CryptoExchange]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_open_close_crypto_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 + """Daily Open / Close # noqa: E501 + + Get the open, close prices of a symbol on a certain day. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_open_close_crypto_from_to_date_get(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :param date _date: Date of the requested open/close (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + return data + + def v1_open_close_crypto_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 + """Daily Open / Close # noqa: E501 + + Get the open, close prices of a symbol on a certain day. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :param date _date: Date of the requested open/close (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to', '_date'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_open_close_crypto_from_to_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/open-close/crypto/{from}/{to}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + return data + + def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'locale' is set + if ('locale' not in params or + params['locale'] is None): + raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter 'market' is set + if ('market' not in params or + params['market'] is None): + raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'locale' in params: + path_params['locale'] = params['locale'] # noqa: E501 + if 'market' in params: + path_params['market'] = params['market'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_prev_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/prev', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'multiplier' is set + if ('multiplier' not in params or + params['multiplier'] is None): + raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'timespan' is set + if ('timespan' not in params or + params['timespan'] is None): + raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + if 'multiplier' in params: + path_params['multiplier'] = params['multiplier'] # noqa: E501 + if 'timespan' in params: + path_params['timespan'] = params['timespan'] # noqa: E501 + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_crypto_direction_get(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_direction_get(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['direction'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_crypto_direction_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'direction' is set + if ('direction' not in params or + params['direction'] is None): + raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_global_markets_crypto_direction_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'direction' in params: + path_params['direction'] = params['direction'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/crypto/{direction}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_crypto_tickers_get(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_crypto_tickers_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/crypto/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker Full Book ( L2 ) # noqa: E501 + + See the current level 2 book of a single ticker. This is the combined book from all the exchanges. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker Full Book ( L2 ) # noqa: E501 + + See the current level 2 book of a single ticker. This is the combined book from all the exchanges. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_crypto_tickers_ticker_get(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker # noqa: E501 + + See the current snapshot of a single ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker # noqa: E501 + + See the current snapshot of a single ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_crypto_tickers_ticker_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_global_markets_crypto_tickers_ticker_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/polygon/rest/api/forex__currencies_api.py b/polygon/rest/api/forex__currencies_api.py new file mode 100644 index 00000000..f3d5a59e --- /dev/null +++ b/polygon/rest/api/forex__currencies_api.py @@ -0,0 +1,893 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class ForexCurrenciesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def v1_conversion_from_to_get(self, _from, to, **kwargs): # noqa: E501 + """Real-time Currency Conversion # noqa: E501 + + Convert currencies using the latest market conversion rates. Note than you can convert in both directions. For example USD->CAD or CAD->USD. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_conversion_from_to_get(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :param int amount: Amount we want to convert. With decimal + :param int precision: Decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_conversion_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + else: + (data) = self.v1_conversion_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + return data + + def v1_conversion_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 + """Real-time Currency Conversion # noqa: E501 + + Convert currencies using the latest market conversion rates. Note than you can convert in both directions. For example USD->CAD or CAD->USD. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_conversion_from_to_get_with_http_info(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :param int amount: Amount we want to convert. With decimal + :param int precision: Decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to', 'amount', 'precision'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_conversion_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_conversion_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_conversion_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + if 'amount' in params: + query_params.append(('amount', params['amount'])) # noqa: E501 + if 'precision' in params: + query_params.append(('precision', params['precision'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/conversion/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_historic_forex_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 + """Historic Forex Ticks # noqa: E501 + + Get historic ticks for a currency pair. Example for **USD/JPY** the from would be **USD** and to would be **JPY**. The date formatted like **2017-6-22** # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_forex_from_to_date_get(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the currency pair (required) + :param str to: To Symbol of the currency pair (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 10000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 + return data + + def v1_historic_forex_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 + """Historic Forex Ticks # noqa: E501 + + Get historic ticks for a currency pair. Example for **USD/JPY** the from would be **USD** and to would be **JPY**. The date formatted like **2017-6-22** # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the currency pair (required) + :param str to: To Symbol of the currency pair (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 10000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to', '_date', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_historic_forex_from_to_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/historic/forex/{from}/{to}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_last_quote_currencies_from_to_get(self, _from, to, **kwargs): # noqa: E501 + """Last Quote for a Currency Pair # noqa: E501 + + Get Last Quote Tick for a Currency Pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_quote_currencies_from_to_get(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + else: + (data) = self.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 + return data + + def v1_last_quote_currencies_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 + """Last Quote for a Currency Pair # noqa: E501 + + Get Last Quote Tick for a Currency Pair. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str _from: From Symbol of the pair (required) + :param str to: To Symbol of the pair (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['_from', 'to'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_last_quote_currencies_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v1_last_quote_currencies_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v1_last_quote_currencies_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/last_quote/currencies/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + return data + + def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'locale' is set + if ('locale' not in params or + params['locale'] is None): + raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter 'market' is set + if ('market' not in params or + params['market'] is None): + raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'locale' in params: + path_params['locale'] = params['locale'] # noqa: E501 + if 'market' in params: + path_params['market'] = params['market'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_prev_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/prev', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'multiplier' is set + if ('multiplier' not in params or + params['multiplier'] is None): + raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'timespan' is set + if ('timespan' not in params or + params['timespan'] is None): + raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + if 'multiplier' in params: + path_params['multiplier'] = params['multiplier'] # noqa: E501 + if 'timespan' in params: + path_params['timespan'] = params['timespan'] # noqa: E501 + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_forex_direction_get(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_forex_direction_get(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['direction'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_forex_direction_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'direction' is set + if ('direction' not in params or + params['direction'] is None): + raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_global_markets_forex_direction_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'direction' in params: + path_params['direction'] = params['direction'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/forex/{direction}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_global_markets_forex_tickers_get(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_forex_tickers_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_global_markets_forex_tickers_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/global/markets/forex/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/polygon/rest/api/reference_api.py b/polygon/rest/api/reference_api.py new file mode 100644 index 00000000..184d73fc --- /dev/null +++ b/polygon/rest/api/reference_api.py @@ -0,0 +1,1082 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class ReferenceApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def v1_marketstatus_now_get(self, **kwargs): # noqa: E501 + """Market Status # noqa: E501 + + Current status of each market # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_marketstatus_now_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: MarketStatus + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_marketstatus_now_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v1_marketstatus_now_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v1_marketstatus_now_get_with_http_info(self, **kwargs): # noqa: E501 + """Market Status # noqa: E501 + + Current status of each market # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_marketstatus_now_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: MarketStatus + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_marketstatus_now_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/marketstatus/now', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MarketStatus', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_marketstatus_upcoming_get(self, **kwargs): # noqa: E501 + """Market Holidays # noqa: E501 + + Get upcoming market holidays and their open/close times # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_marketstatus_upcoming_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[MarketHoliday] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_marketstatus_upcoming_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v1_marketstatus_upcoming_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v1_marketstatus_upcoming_get_with_http_info(self, **kwargs): # noqa: E501 + """Market Holidays # noqa: E501 + + Get upcoming market holidays and their open/close times # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_marketstatus_upcoming_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[MarketHoliday] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_marketstatus_upcoming_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/marketstatus/upcoming', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MarketHoliday]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_meta_symbols_symbol_company_get(self, symbol, **kwargs): # noqa: E501 + """Ticker Details # noqa: E501 + + Get the details of the symbol company/entity. These are important details which offer an overview of the entity. Things like name, sector, description, logo and similar companies. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_symbols_symbol_company_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want details for (required) + :return: Company + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_meta_symbols_symbol_company_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v1_meta_symbols_symbol_company_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v1_meta_symbols_symbol_company_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Ticker Details # noqa: E501 + + Get the details of the symbol company/entity. These are important details which offer an overview of the entity. Things like name, sector, description, logo and similar companies. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_symbols_symbol_company_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want details for (required) + :return: Company + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_meta_symbols_symbol_company_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_meta_symbols_symbol_company_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/meta/symbols/{symbol}/company', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Company', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_meta_symbols_symbol_news_get(self, symbol, **kwargs): # noqa: E501 + """Ticker News # noqa: E501 + + Get news articles for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_symbols_symbol_news_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Ticker we want details for (required) + :param float perpage: How many items to be on each page during pagination. Max 50 + :param float page: Which page of results to return + :return: list[News] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_meta_symbols_symbol_news_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v1_meta_symbols_symbol_news_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v1_meta_symbols_symbol_news_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Ticker News # noqa: E501 + + Get news articles for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_symbols_symbol_news_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Ticker we want details for (required) + :param float perpage: How many items to be on each page during pagination. Max 50 + :param float page: Which page of results to return + :return: list[News] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol', 'perpage', 'page'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_meta_symbols_symbol_news_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_meta_symbols_symbol_news_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + if 'perpage' in params: + query_params.append(('perpage', params['perpage'])) # noqa: E501 + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/meta/symbols/{symbol}/news', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[News]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_dividends_symbol_get(self, symbol, **kwargs): # noqa: E501 + """Stock Dividends # noqa: E501 + + Get the historical divdends for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_dividends_symbol_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want dividends for (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_dividends_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v2_reference_dividends_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v2_reference_dividends_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Stock Dividends # noqa: E501 + + Get the historical divdends for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_dividends_symbol_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want dividends for (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_dividends_symbol_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_dividends_symbol_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/dividends/{symbol}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_financials_symbol_get(self, symbol, **kwargs): # noqa: E501 + """Stock Financials # noqa: E501 + + Get the historical financials for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_financials_symbol_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want financials for (required) + :param float limit: Limit the number of results + :param str type: Type of reports + :param str sort: Sort direction + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_financials_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v2_reference_financials_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v2_reference_financials_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Stock Financials # noqa: E501 + + Get the historical financials for this ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_financials_symbol_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want financials for (required) + :param float limit: Limit the number of results + :param str type: Type of reports + :param str sort: Sort direction + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol', 'limit', 'type', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_financials_symbol_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_financials_symbol_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/financials/{symbol}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_locales_get(self, **kwargs): # noqa: E501 + """Locales # noqa: E501 + + Get the list of currently supported locales # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_locales_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_locales_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_reference_locales_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_reference_locales_get_with_http_info(self, **kwargs): # noqa: E501 + """Locales # noqa: E501 + + Get the list of currently supported locales # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_locales_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_locales_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/locales', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_markets_get(self, **kwargs): # noqa: E501 + """Markets # noqa: E501 + + Get the list of currently supported markets # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_markets_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_markets_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_reference_markets_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_reference_markets_get_with_http_info(self, **kwargs): # noqa: E501 + """Markets # noqa: E501 + + Get the list of currently supported markets # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_markets_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_markets_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/markets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_splits_symbol_get(self, symbol, **kwargs): # noqa: E501 + """Stock Splits # noqa: E501 + + Get the historical splits for this symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_splits_symbol_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want details for (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_splits_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v2_reference_splits_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v2_reference_splits_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Stock Splits # noqa: E501 + + Get the historical splits for this symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_splits_symbol_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol we want details for (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_splits_symbol_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_splits_symbol_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/splits/{symbol}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_tickers_get(self, **kwargs): # noqa: E501 + """Tickers # noqa: E501 + + Query all ticker symbols which are supported by Polygon.io. This API includes Indices, Crypto, FX, and Stocks/Equities. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_tickers_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str sort: Which field to sort by. For desc place a `-` in front of the field name. **Example:** - `?sort=-ticker` to sort symbols Z-A - `?sort=type` to sort symbols by type + :param str type: If you want the results to only container a certain type. **Example:** - `?type=etp` to get all ETFs - `?type=cs` to get all Common Stock's + :param str market: Get tickers for a specific market **Example:** - `?market=stocks` to get all stock tickers - `?market=indices` to get all index tickers + :param str locale: Get tickers for a specific region/locale **Example:** - `?locale=us` to get all US tickers - `?locale=g` to get all Global tickers + :param str search: Search the name of tickers **Example:** - `?search=microsoft` Search tickers for microsoft + :param float perpage: How many items to be on each page during pagination. Max 50 + :param float page: Which page of results to return + :param bool active: Filter for only active or inactive symbols + :return: list[Symbol] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_tickers_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_reference_tickers_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_reference_tickers_get_with_http_info(self, **kwargs): # noqa: E501 + """Tickers # noqa: E501 + + Query all ticker symbols which are supported by Polygon.io. This API includes Indices, Crypto, FX, and Stocks/Equities. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_tickers_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str sort: Which field to sort by. For desc place a `-` in front of the field name. **Example:** - `?sort=-ticker` to sort symbols Z-A - `?sort=type` to sort symbols by type + :param str type: If you want the results to only container a certain type. **Example:** - `?type=etp` to get all ETFs - `?type=cs` to get all Common Stock's + :param str market: Get tickers for a specific market **Example:** - `?market=stocks` to get all stock tickers - `?market=indices` to get all index tickers + :param str locale: Get tickers for a specific region/locale **Example:** - `?locale=us` to get all US tickers - `?locale=g` to get all Global tickers + :param str search: Search the name of tickers **Example:** - `?search=microsoft` Search tickers for microsoft + :param float perpage: How many items to be on each page during pagination. Max 50 + :param float page: Which page of results to return + :param bool active: Filter for only active or inactive symbols + :return: list[Symbol] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['sort', 'type', 'market', 'locale', 'search', 'perpage', 'page', 'active'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_tickers_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'market' in params: + query_params.append(('market', params['market'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 + if 'perpage' in params: + query_params.append(('perpage', params['perpage'])) # noqa: E501 + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'active' in params: + query_params.append(('active', params['active'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Symbol]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_reference_types_get(self, **kwargs): # noqa: E501 + """Ticker Types # noqa: E501 + + Get the mapping of ticker types to descriptions / long names # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_types_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_reference_types_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_reference_types_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_reference_types_get_with_http_info(self, **kwargs): # noqa: E501 + """Ticker Types # noqa: E501 + + Get the mapping of ticker types to descriptions / long names # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_reference_types_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_reference_types_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/reference/types', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/polygon/rest/api/stocks__equities_api.py b/polygon/rest/api/stocks__equities_api.py new file mode 100644 index 00000000..15a1a49c --- /dev/null +++ b/polygon/rest/api/stocks__equities_api.py @@ -0,0 +1,1590 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class StocksEquitiesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def v1_historic_quotes_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 + """Historic Quotes # noqa: E501 + + Get historic quotes for a symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_quotes_symbol_date_get(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the company to retrieve (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + return data + + def v1_historic_quotes_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 + """Historic Quotes # noqa: E501 + + Get historic quotes for a symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the company to retrieve (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol', '_date', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_historic_quotes_symbol_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_historic_quotes_symbol_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_historic_quotes_symbol_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/historic/quotes/{symbol}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_historic_trades_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 + """Historic Trades # noqa: E501 + + Get historic trades for a symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_trades_symbol_date_get(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the company to retrieve (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + return data + + def v1_historic_trades_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 + """Historic Trades # noqa: E501 + + Get historic trades for a symbol. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the company to retrieve (required) + :param date _date: Date/Day of the historic ticks to retreive (required) + :param int offset: 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. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol', '_date', 'offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_historic_trades_symbol_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_historic_trades_symbol_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_historic_trades_symbol_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/historic/trades/{symbol}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_last_quote_stocks_symbol_get(self, symbol, **kwargs): # noqa: E501 + """Last Quote for a Symbol # noqa: E501 + + Get the last quote tick for a given stock. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_quote_stocks_symbol_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the quote to get (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_last_quote_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v1_last_quote_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v1_last_quote_stocks_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Last Quote for a Symbol # noqa: E501 + + Get the last quote tick for a given stock. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_quote_stocks_symbol_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the quote to get (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_last_quote_stocks_symbol_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_last_quote_stocks_symbol_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/last_quote/stocks/{symbol}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_last_stocks_symbol_get(self, symbol, **kwargs): # noqa: E501 + """Last Trade for a Symbol # noqa: E501 + + Get the last trade for a given stock. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_stocks_symbol_get(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the stock to get (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_last_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + else: + (data) = self.v1_last_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 + return data + + def v1_last_stocks_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Last Trade for a Symbol # noqa: E501 + + Get the last trade for a given stock. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_last_stocks_symbol_get_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the stock to get (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_last_stocks_symbol_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_last_stocks_symbol_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/last/stocks/{symbol}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_meta_conditions_ticktype_get(self, ticktype, **kwargs): # noqa: E501 + """Condition Mappings # noqa: E501 + + The mappings for conditions on trades and quotes. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_conditions_ticktype_get(ticktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticktype: Ticker type we want mappings for (required) + :return: ConditionTypeMap + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_meta_conditions_ticktype_get_with_http_info(ticktype, **kwargs) # noqa: E501 + else: + (data) = self.v1_meta_conditions_ticktype_get_with_http_info(ticktype, **kwargs) # noqa: E501 + return data + + def v1_meta_conditions_ticktype_get_with_http_info(self, ticktype, **kwargs): # noqa: E501 + """Condition Mappings # noqa: E501 + + The mappings for conditions on trades and quotes. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_conditions_ticktype_get_with_http_info(ticktype, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticktype: Ticker type we want mappings for (required) + :return: ConditionTypeMap + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticktype'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_meta_conditions_ticktype_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticktype' is set + if ('ticktype' not in params or + params['ticktype'] is None): + raise ValueError("Missing the required parameter `ticktype` when calling `v1_meta_conditions_ticktype_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticktype' in params: + path_params['ticktype'] = params['ticktype'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/meta/conditions/{ticktype}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConditionTypeMap', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_meta_exchanges_get(self, **kwargs): # noqa: E501 + """Exchanges # noqa: E501 + + List of stock exchanges which are supported by Polygon.io # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_exchanges_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Exchange] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_meta_exchanges_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v1_meta_exchanges_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v1_meta_exchanges_get_with_http_info(self, **kwargs): # noqa: E501 + """Exchanges # noqa: E501 + + List of stock exchanges which are supported by Polygon.io # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_meta_exchanges_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Exchange] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_meta_exchanges_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/meta/exchanges', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Exchange]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v1_open_close_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 + """Daily Open / Close # noqa: E501 + + Get the open, close and afterhours prices of a symbol on a certain date. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_open_close_symbol_date_get(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the stock to get (required) + :param date _date: Date of the requested open/close (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v1_open_close_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + else: + (data) = self.v1_open_close_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 + return data + + def v1_open_close_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 + """Daily Open / Close # noqa: E501 + + Get the open, close and afterhours prices of a symbol on a certain date. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v1_open_close_symbol_date_get_with_http_info(symbol, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str symbol: Symbol of the stock to get (required) + :param date _date: Date of the requested open/close (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['symbol', '_date'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v1_open_close_symbol_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'symbol' is set + if ('symbol' not in params or + params['symbol'] is None): + raise ValueError("Missing the required parameter `symbol` when calling `v1_open_close_symbol_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v1_open_close_symbol_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in params: + path_params['symbol'] = params['symbol'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v1/open-close/{symbol}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 + return data + + def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 + """Grouped Daily # noqa: E501 + + Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) + :param str market: Market of the aggregates ( See 'Markets' API ) (required) + :param str _date: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'locale' is set + if ('locale' not in params or + params['locale'] is None): + raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter 'market' is set + if ('market' not in params or + params['market'] is None): + raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'locale' in params: + path_params['locale'] = params['locale'] # noqa: E501 + if 'market' in params: + path_params['market'] = params['market'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Previous Close # noqa: E501 + + Get the previous day close for the specified ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_prev_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/prev', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + else: + (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 + return data + + def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 + """Aggregates # noqa: E501 + + Get aggregates for a date range, in custom time window sizes # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol of the request (required) + :param float multiplier: Size of the timespan multiplier (required) + :param str timespan: Size of the time window (required) + :param str _from: From date (required) + :param str to: To date (required) + :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. + :return: AggResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'multiplier' is set + if ('multiplier' not in params or + params['multiplier'] is None): + raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'timespan' is set + if ('timespan' not in params or + params['timespan'] is None): + raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter '_from' is set + if ('_from' not in params or + params['_from'] is None): + raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + # verify the required parameter 'to' is set + if ('to' not in params or + params['to'] is None): + raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + if 'multiplier' in params: + path_params['multiplier'] = params['multiplier'] # noqa: E501 + if 'timespan' in params: + path_params['timespan'] = params['timespan'] # noqa: E501 + if '_from' in params: + path_params['from'] = params['_from'] # noqa: E501 + if 'to' in params: + path_params['to'] = params['to'] # noqa: E501 + + query_params = [] + if 'unadjusted' in params: + query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AggResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_us_markets_stocks_direction_get(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_direction_get(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 + """Snapshot - Gainers / Losers # noqa: E501 + + See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str direction: Direction we want (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['direction'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_us_markets_stocks_direction_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'direction' is set + if ('direction' not in params or + params['direction'] is None): + raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_us_markets_stocks_direction_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'direction' in params: + path_params['direction'] = params['direction'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/us/markets/stocks/{direction}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_us_markets_stocks_tickers_get(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(**kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(self, **kwargs): # noqa: E501 + """Snapshot - All Tickers # noqa: E501 + + Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_us_markets_stocks_tickers_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/us/markets/stocks/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_snapshot_locale_us_markets_stocks_tickers_ticker_get(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker # noqa: E501 + + See the current snapshot of a single ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 + else: + (data) = self.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 + return data + + def v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(self, ticker, **kwargs): # noqa: E501 + """Snapshot - Single Ticker # noqa: E501 + + See the current snapshot of a single ticker # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker of the snapshot (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_snapshot_locale_us_markets_stocks_tickers_ticker_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_us_markets_stocks_tickers_ticker_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_ticks_stocks_nbbo_ticker_date_get(self, ticker, _date, **kwargs): # noqa: E501 + """( v2 ) Historic NBBO Quotes # noqa: E501 + + Get historic NBBO quotes for a ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_ticks_stocks_nbbo_ticker_date_get(ticker, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol we want ticks for (required) + :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) + :param int timestamp: 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. + :param int timestamp_limit: Maximum timestamp allowed in the results. + :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 + else: + (data) = self.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 + return data + + def v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(self, ticker, _date, **kwargs): # noqa: E501 + """( v2 ) Historic NBBO Quotes # noqa: E501 + + Get historic NBBO quotes for a ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol we want ticks for (required) + :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) + :param int timestamp: 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. + :param int timestamp_limit: Maximum timestamp allowed in the results. + :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', '_date', 'timestamp', 'timestamp_limit', 'reverse', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_ticks_stocks_nbbo_ticker_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_ticks_stocks_nbbo_ticker_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v2_ticks_stocks_nbbo_ticker_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'timestamp' in params: + query_params.append(('timestamp', params['timestamp'])) # noqa: E501 + if 'timestamp_limit' in params: + query_params.append(('timestampLimit', params['timestamp_limit'])) # noqa: E501 + if 'reverse' in params: + query_params.append(('reverse', params['reverse'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/ticks/stocks/nbbo/{ticker}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def v2_ticks_stocks_trades_ticker_date_get(self, ticker, _date, **kwargs): # noqa: E501 + """( v2 ) Historic Trades # noqa: E501 + + Get historic trades for a ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_ticks_stocks_trades_ticker_date_get(ticker, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol we want ticks for (required) + :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) + :param int timestamp: 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. + :param int timestamp_limit: Maximum timestamp allowed in the results. + :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 + else: + (data) = self.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 + return data + + def v2_ticks_stocks_trades_ticker_date_get_with_http_info(self, ticker, _date, **kwargs): # noqa: E501 + """( v2 ) Historic Trades # noqa: E501 + + Get historic trades for a ticker. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str ticker: Ticker symbol we want ticks for (required) + :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) + :param int timestamp: 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. + :param int timestamp_limit: Maximum timestamp allowed in the results. + :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. + :param int limit: Limit the size of response, Max 50000 + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ticker', '_date', 'timestamp', 'timestamp_limit', 'reverse', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method v2_ticks_stocks_trades_ticker_date_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ticker' is set + if ('ticker' not in params or + params['ticker'] is None): + raise ValueError("Missing the required parameter `ticker` when calling `v2_ticks_stocks_trades_ticker_date_get`") # noqa: E501 + # verify the required parameter '_date' is set + if ('_date' not in params or + params['_date'] is None): + raise ValueError("Missing the required parameter `_date` when calling `v2_ticks_stocks_trades_ticker_date_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'ticker' in params: + path_params['ticker'] = params['ticker'] # noqa: E501 + if '_date' in params: + path_params['date'] = params['_date'] # noqa: E501 + + query_params = [] + if 'timestamp' in params: + query_params.append(('timestamp', params['timestamp'])) # noqa: E501 + if 'timestamp_limit' in params: + query_params.append(('timestampLimit', params['timestamp_limit'])) # noqa: E501 + if 'reverse' in params: + query_params.append(('reverse', params['reverse'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKey'] # noqa: E501 + + return self.api_client.call_api( + '/v2/ticks/stocks/trades/{ticker}/{date}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py new file mode 100644 index 00000000..56506ca9 --- /dev/null +++ b/polygon/rest/models/__init__.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +# flake8: noqa +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from swagger_client.models.agg_response import AggResponse +from swagger_client.models.aggregate import Aggregate +from swagger_client.models.aggv2 import Aggv2 +from swagger_client.models.analyst_ratings import AnalystRatings +from swagger_client.models.company import Company +from swagger_client.models.condition_type_map import ConditionTypeMap +from swagger_client.models.conflict import Conflict +from swagger_client.models.crypto_exchange import CryptoExchange +from swagger_client.models.crypto_snapshot_agg import CryptoSnapshotAgg +from swagger_client.models.crypto_snapshot_book_item import CryptoSnapshotBookItem +from swagger_client.models.crypto_snapshot_ticker import CryptoSnapshotTicker +from swagger_client.models.crypto_snapshot_ticker_book import CryptoSnapshotTickerBook +from swagger_client.models.crypto_tick import CryptoTick +from swagger_client.models.crypto_tick_json import CryptoTickJson +from swagger_client.models.dividend import Dividend +from swagger_client.models.earning import Earning +from swagger_client.models.error import Error +from swagger_client.models.exchange import Exchange +from swagger_client.models.financial import Financial +from swagger_client.models.financials import Financials +from swagger_client.models.forex import Forex +from swagger_client.models.forex_aggregate import ForexAggregate +from swagger_client.models.forex_snapshot_agg import ForexSnapshotAgg +from swagger_client.models.forex_snapshot_ticker import ForexSnapshotTicker +from swagger_client.models.hist_trade import HistTrade +from swagger_client.models.last_forex_quote import LastForexQuote +from swagger_client.models.last_forex_trade import LastForexTrade +from swagger_client.models.last_quote import LastQuote +from swagger_client.models.last_trade import LastTrade +from swagger_client.models.market_holiday import MarketHoliday +from swagger_client.models.market_status import MarketStatus +from swagger_client.models.news import News +from swagger_client.models.not_found import NotFound +from swagger_client.models.quote import Quote +from swagger_client.models.rating_section import RatingSection +from swagger_client.models.split import Split +from swagger_client.models.stock_symbol import StockSymbol +from swagger_client.models.stocks_snapshot_agg import StocksSnapshotAgg +from swagger_client.models.stocks_snapshot_book_item import StocksSnapshotBookItem +from swagger_client.models.stocks_snapshot_quote import StocksSnapshotQuote +from swagger_client.models.stocks_snapshot_ticker import StocksSnapshotTicker +from swagger_client.models.stocks_snapshot_ticker_book import StocksSnapshotTickerBook +from swagger_client.models.stocks_v2_nbbo import StocksV2NBBO +from swagger_client.models.stocks_v2_trade import StocksV2Trade +from swagger_client.models.symbol import Symbol +from swagger_client.models.symbol_type_map import SymbolTypeMap +from swagger_client.models.ticker import Ticker +from swagger_client.models.ticker_symbol import TickerSymbol +from swagger_client.models.trade import Trade +from swagger_client.models.unauthorized import Unauthorized diff --git a/polygon/rest/models/agg_response.py b/polygon/rest/models/agg_response.py new file mode 100644 index 00000000..efb2dfe2 --- /dev/null +++ b/polygon/rest/models/agg_response.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class AggResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'status': 'str', + 'adjusted': 'bool', + 'query_count': 'float', + 'results_count': 'float', + 'results': 'list[Aggv2]' + } + + attribute_map = { + 'ticker': 'ticker', + 'status': 'status', + 'adjusted': 'adjusted', + 'query_count': 'queryCount', + 'results_count': 'resultsCount', + 'results': 'results' + } + + def __init__(self, ticker=None, status=None, adjusted=None, query_count=None, results_count=None, results=None): # noqa: E501 + """AggResponse - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._status = None + self._adjusted = None + self._query_count = None + self._results_count = None + self._results = None + self.discriminator = None + self.ticker = ticker + self.status = status + self.adjusted = adjusted + if query_count is not None: + self.query_count = query_count + if results_count is not None: + self.results_count = results_count + self.results = results + + @property + def ticker(self): + """Gets the ticker of this AggResponse. # noqa: E501 + + Ticker symbol requested # noqa: E501 + + :return: The ticker of this AggResponse. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this AggResponse. + + Ticker symbol requested # noqa: E501 + + :param ticker: The ticker of this AggResponse. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def status(self): + """Gets the status of this AggResponse. # noqa: E501 + + Status of the response # noqa: E501 + + :return: The status of this AggResponse. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AggResponse. + + Status of the response # noqa: E501 + + :param status: The status of this AggResponse. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def adjusted(self): + """Gets the adjusted of this AggResponse. # noqa: E501 + + If this response was adjusted for splits # noqa: E501 + + :return: The adjusted of this AggResponse. # noqa: E501 + :rtype: bool + """ + return self._adjusted + + @adjusted.setter + def adjusted(self, adjusted): + """Sets the adjusted of this AggResponse. + + If this response was adjusted for splits # noqa: E501 + + :param adjusted: The adjusted of this AggResponse. # noqa: E501 + :type: bool + """ + if adjusted is None: + raise ValueError("Invalid value for `adjusted`, must not be `None`") # noqa: E501 + + self._adjusted = adjusted + + @property + def query_count(self): + """Gets the query_count of this AggResponse. # noqa: E501 + + Number of aggregate ( min or day ) used to generate the response # noqa: E501 + + :return: The query_count of this AggResponse. # noqa: E501 + :rtype: float + """ + return self._query_count + + @query_count.setter + def query_count(self, query_count): + """Sets the query_count of this AggResponse. + + Number of aggregate ( min or day ) used to generate the response # noqa: E501 + + :param query_count: The query_count of this AggResponse. # noqa: E501 + :type: float + """ + + self._query_count = query_count + + @property + def results_count(self): + """Gets the results_count of this AggResponse. # noqa: E501 + + Total number of results generated # noqa: E501 + + :return: The results_count of this AggResponse. # noqa: E501 + :rtype: float + """ + return self._results_count + + @results_count.setter + def results_count(self, results_count): + """Sets the results_count of this AggResponse. + + Total number of results generated # noqa: E501 + + :param results_count: The results_count of this AggResponse. # noqa: E501 + :type: float + """ + + self._results_count = results_count + + @property + def results(self): + """Gets the results of this AggResponse. # noqa: E501 + + + :return: The results of this AggResponse. # noqa: E501 + :rtype: list[Aggv2] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this AggResponse. + + + :param results: The results of this AggResponse. # noqa: E501 + :type: list[Aggv2] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AggResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AggResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/aggregate.py b/polygon/rest/models/aggregate.py new file mode 100644 index 00000000..404de86a --- /dev/null +++ b/polygon/rest/models/aggregate.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Aggregate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'o': 'int', + 'c': 'int', + 'l': 'int', + 'h': 'int', + 'v': 'int', + 'k': 'int', + 't': 'int' + } + + attribute_map = { + 'o': 'o', + 'c': 'c', + 'l': 'l', + 'h': 'h', + 'v': 'v', + 'k': 'k', + 't': 't' + } + + def __init__(self, o=None, c=None, l=None, h=None, v=None, k=None, t=None): # noqa: E501 + """Aggregate - a model defined in Swagger""" # noqa: E501 + self._o = None + self._c = None + self._l = None + self._h = None + self._v = None + self._k = None + self._t = None + self.discriminator = None + self.o = o + self.c = c + self.l = l + self.h = h + self.v = v + self.k = k + self.t = t + + @property + def o(self): + """Gets the o of this Aggregate. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this Aggregate. + + Open price # noqa: E501 + + :param o: The o of this Aggregate. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def c(self): + """Gets the c of this Aggregate. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this Aggregate. + + Close price # noqa: E501 + + :param c: The c of this Aggregate. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def l(self): + """Gets the l of this Aggregate. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this Aggregate. + + Low price # noqa: E501 + + :param l: The l of this Aggregate. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def h(self): + """Gets the h of this Aggregate. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this Aggregate. + + High price # noqa: E501 + + :param h: The h of this Aggregate. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def v(self): + """Gets the v of this Aggregate. # noqa: E501 + + Total Volume of all trades ( total shares exchanged ) # noqa: E501 + + :return: The v of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this Aggregate. + + Total Volume of all trades ( total shares exchanged ) # noqa: E501 + + :param v: The v of this Aggregate. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + @property + def k(self): + """Gets the k of this Aggregate. # noqa: E501 + + Transactions ( 1 transaction contains X shares exchanged ) # noqa: E501 + + :return: The k of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._k + + @k.setter + def k(self, k): + """Sets the k of this Aggregate. + + Transactions ( 1 transaction contains X shares exchanged ) # noqa: E501 + + :param k: The k of this Aggregate. # noqa: E501 + :type: int + """ + if k is None: + raise ValueError("Invalid value for `k`, must not be `None`") # noqa: E501 + + self._k = k + + @property + def t(self): + """Gets the t of this Aggregate. # noqa: E501 + + Timestamp of this aggregation # noqa: E501 + + :return: The t of this Aggregate. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Aggregate. + + Timestamp of this aggregation # noqa: E501 + + :param t: The t of this Aggregate. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Aggregate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Aggregate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/aggv2.py b/polygon/rest/models/aggv2.py new file mode 100644 index 00000000..05e46c2c --- /dev/null +++ b/polygon/rest/models/aggv2.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Aggv2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 't': 'str', + 'v': 'int', + 'o': 'int', + 'c': 'int', + 'h': 'int', + 'l': 'int', + 't': 'float', + 'n': 'float' + } + + attribute_map = { + 't': 'T', + 'v': 'v', + 'o': 'o', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 't': 't', + 'n': 'n' + } + + def __init__(self, t=None, v=None, o=None, c=None, h=None, l=None, t=None, n=None): # noqa: E501 + """Aggv2 - a model defined in Swagger""" # noqa: E501 + self._t = None + self._v = None + self._o = None + self._c = None + self._h = None + self._l = None + self._t = None + self._n = None + self.discriminator = None + if t is not None: + self.t = t + self.v = v + self.o = o + self.c = c + self.h = h + self.l = l + if t is not None: + self.t = t + if n is not None: + self.n = n + + @property + def t(self): + """Gets the t of this Aggv2. # noqa: E501 + + Ticker symbol # noqa: E501 + + :return: The t of this Aggv2. # noqa: E501 + :rtype: str + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Aggv2. + + Ticker symbol # noqa: E501 + + :param t: The t of this Aggv2. # noqa: E501 + :type: str + """ + + self._t = t + + @property + def v(self): + """Gets the v of this Aggv2. # noqa: E501 + + Volume # noqa: E501 + + :return: The v of this Aggv2. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this Aggv2. + + Volume # noqa: E501 + + :param v: The v of this Aggv2. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + @property + def o(self): + """Gets the o of this Aggv2. # noqa: E501 + + Open # noqa: E501 + + :return: The o of this Aggv2. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this Aggv2. + + Open # noqa: E501 + + :param o: The o of this Aggv2. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def c(self): + """Gets the c of this Aggv2. # noqa: E501 + + Close # noqa: E501 + + :return: The c of this Aggv2. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this Aggv2. + + Close # noqa: E501 + + :param c: The c of this Aggv2. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def h(self): + """Gets the h of this Aggv2. # noqa: E501 + + High # noqa: E501 + + :return: The h of this Aggv2. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this Aggv2. + + High # noqa: E501 + + :param h: The h of this Aggv2. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def l(self): + """Gets the l of this Aggv2. # noqa: E501 + + Low # noqa: E501 + + :return: The l of this Aggv2. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this Aggv2. + + Low # noqa: E501 + + :param l: The l of this Aggv2. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def t(self): + """Gets the t of this Aggv2. # noqa: E501 + + Unix Msec Timestamp ( Start of Aggregate window ) # noqa: E501 + + :return: The t of this Aggv2. # noqa: E501 + :rtype: float + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Aggv2. + + Unix Msec Timestamp ( Start of Aggregate window ) # noqa: E501 + + :param t: The t of this Aggv2. # noqa: E501 + :type: float + """ + + self._t = t + + @property + def n(self): + """Gets the n of this Aggv2. # noqa: E501 + + Number of items in aggregate window # noqa: E501 + + :return: The n of this Aggv2. # noqa: E501 + :rtype: float + """ + return self._n + + @n.setter + def n(self, n): + """Sets the n of this Aggv2. + + Number of items in aggregate window # noqa: E501 + + :param n: The n of this Aggv2. # noqa: E501 + :type: float + """ + + self._n = n + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Aggv2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Aggv2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/analyst_ratings.py b/polygon/rest/models/analyst_ratings.py new file mode 100644 index 00000000..9d9347e9 --- /dev/null +++ b/polygon/rest/models/analyst_ratings.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class AnalystRatings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbol': 'str', + 'analysts': 'float', + 'change': 'float', + 'strong_buy': 'object', + 'buy': 'object', + 'hold': 'object', + 'sell': 'object', + 'strong_sell': 'object', + 'updated': 'datetime' + } + + attribute_map = { + 'symbol': 'symbol', + 'analysts': 'analysts', + 'change': 'change', + 'strong_buy': 'strongBuy', + 'buy': 'buy', + 'hold': 'hold', + 'sell': 'sell', + 'strong_sell': 'strongSell', + 'updated': 'updated' + } + + def __init__(self, symbol=None, analysts=None, change=None, strong_buy=None, buy=None, hold=None, sell=None, strong_sell=None, updated=None): # noqa: E501 + """AnalystRatings - a model defined in Swagger""" # noqa: E501 + self._symbol = None + self._analysts = None + self._change = None + self._strong_buy = None + self._buy = None + self._hold = None + self._sell = None + self._strong_sell = None + self._updated = None + self.discriminator = None + self.symbol = symbol + self.analysts = analysts + self.change = change + self.strong_buy = strong_buy + self.buy = buy + self.hold = hold + self.sell = sell + self.strong_sell = strong_sell + self.updated = updated + + @property + def symbol(self): + """Gets the symbol of this AnalystRatings. # noqa: E501 + + Symbol which we are requesting ratings # noqa: E501 + + :return: The symbol of this AnalystRatings. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this AnalystRatings. + + Symbol which we are requesting ratings # noqa: E501 + + :param symbol: The symbol of this AnalystRatings. # noqa: E501 + :type: str + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def analysts(self): + """Gets the analysts of this AnalystRatings. # noqa: E501 + + Number of analysts reporting # noqa: E501 + + :return: The analysts of this AnalystRatings. # noqa: E501 + :rtype: float + """ + return self._analysts + + @analysts.setter + def analysts(self, analysts): + """Sets the analysts of this AnalystRatings. + + Number of analysts reporting # noqa: E501 + + :param analysts: The analysts of this AnalystRatings. # noqa: E501 + :type: float + """ + if analysts is None: + raise ValueError("Invalid value for `analysts`, must not be `None`") # noqa: E501 + + self._analysts = analysts + + @property + def change(self): + """Gets the change of this AnalystRatings. # noqa: E501 + + Change from last month to current # noqa: E501 + + :return: The change of this AnalystRatings. # noqa: E501 + :rtype: float + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this AnalystRatings. + + Change from last month to current # noqa: E501 + + :param change: The change of this AnalystRatings. # noqa: E501 + :type: float + """ + if change is None: + raise ValueError("Invalid value for `change`, must not be `None`") # noqa: E501 + + self._change = change + + @property + def strong_buy(self): + """Gets the strong_buy of this AnalystRatings. # noqa: E501 + + Strong buy ratings # noqa: E501 + + :return: The strong_buy of this AnalystRatings. # noqa: E501 + :rtype: object + """ + return self._strong_buy + + @strong_buy.setter + def strong_buy(self, strong_buy): + """Sets the strong_buy of this AnalystRatings. + + Strong buy ratings # noqa: E501 + + :param strong_buy: The strong_buy of this AnalystRatings. # noqa: E501 + :type: object + """ + if strong_buy is None: + raise ValueError("Invalid value for `strong_buy`, must not be `None`") # noqa: E501 + + self._strong_buy = strong_buy + + @property + def buy(self): + """Gets the buy of this AnalystRatings. # noqa: E501 + + Moderate buy ratings # noqa: E501 + + :return: The buy of this AnalystRatings. # noqa: E501 + :rtype: object + """ + return self._buy + + @buy.setter + def buy(self, buy): + """Sets the buy of this AnalystRatings. + + Moderate buy ratings # noqa: E501 + + :param buy: The buy of this AnalystRatings. # noqa: E501 + :type: object + """ + if buy is None: + raise ValueError("Invalid value for `buy`, must not be `None`") # noqa: E501 + + self._buy = buy + + @property + def hold(self): + """Gets the hold of this AnalystRatings. # noqa: E501 + + Hold ratings # noqa: E501 + + :return: The hold of this AnalystRatings. # noqa: E501 + :rtype: object + """ + return self._hold + + @hold.setter + def hold(self, hold): + """Sets the hold of this AnalystRatings. + + Hold ratings # noqa: E501 + + :param hold: The hold of this AnalystRatings. # noqa: E501 + :type: object + """ + if hold is None: + raise ValueError("Invalid value for `hold`, must not be `None`") # noqa: E501 + + self._hold = hold + + @property + def sell(self): + """Gets the sell of this AnalystRatings. # noqa: E501 + + Moderate Sell ratings # noqa: E501 + + :return: The sell of this AnalystRatings. # noqa: E501 + :rtype: object + """ + return self._sell + + @sell.setter + def sell(self, sell): + """Sets the sell of this AnalystRatings. + + Moderate Sell ratings # noqa: E501 + + :param sell: The sell of this AnalystRatings. # noqa: E501 + :type: object + """ + if sell is None: + raise ValueError("Invalid value for `sell`, must not be `None`") # noqa: E501 + + self._sell = sell + + @property + def strong_sell(self): + """Gets the strong_sell of this AnalystRatings. # noqa: E501 + + Strong Sell ratings # noqa: E501 + + :return: The strong_sell of this AnalystRatings. # noqa: E501 + :rtype: object + """ + return self._strong_sell + + @strong_sell.setter + def strong_sell(self, strong_sell): + """Sets the strong_sell of this AnalystRatings. + + Strong Sell ratings # noqa: E501 + + :param strong_sell: The strong_sell of this AnalystRatings. # noqa: E501 + :type: object + """ + if strong_sell is None: + raise ValueError("Invalid value for `strong_sell`, must not be `None`") # noqa: E501 + + self._strong_sell = strong_sell + + @property + def updated(self): + """Gets the updated of this AnalystRatings. # noqa: E501 + + Last time the ratings for this symbol were updated. # noqa: E501 + + :return: The updated of this AnalystRatings. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this AnalystRatings. + + Last time the ratings for this symbol were updated. # noqa: E501 + + :param updated: The updated of this AnalystRatings. # noqa: E501 + :type: datetime + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AnalystRatings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AnalystRatings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/company.py b/polygon/rest/models/company.py new file mode 100644 index 00000000..866ec502 --- /dev/null +++ b/polygon/rest/models/company.py @@ -0,0 +1,700 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Company(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'logo': 'str', + 'exchange': 'str', + 'name': 'str', + 'symbol': 'StockSymbol', + 'listdate': 'date', + 'cik': 'str', + 'bloomberg': 'str', + 'figi': 'str', + 'lei': 'str', + 'sic': 'float', + 'country': 'str', + 'industry': 'str', + 'sector': 'str', + 'marketcap': 'float', + 'employees': 'float', + 'phone': 'str', + 'ceo': 'str', + 'url': 'str', + 'description': 'str', + 'similar': 'list[StockSymbol]', + 'tags': 'list[str]', + 'updated': 'datetime' + } + + attribute_map = { + 'logo': 'logo', + 'exchange': 'exchange', + 'name': 'name', + 'symbol': 'symbol', + 'listdate': 'listdate', + 'cik': 'cik', + 'bloomberg': 'bloomberg', + 'figi': 'figi', + 'lei': 'lei', + 'sic': 'sic', + 'country': 'country', + 'industry': 'industry', + 'sector': 'sector', + 'marketcap': 'marketcap', + 'employees': 'employees', + 'phone': 'phone', + 'ceo': 'ceo', + 'url': 'url', + 'description': 'description', + 'similar': 'similar', + 'tags': 'tags', + 'updated': 'updated' + } + + def __init__(self, logo=None, exchange=None, name=None, symbol=None, listdate=None, cik=None, bloomberg=None, figi=None, lei=None, sic=None, country=None, industry=None, sector=None, marketcap=None, employees=None, phone=None, ceo=None, url=None, description=None, similar=None, tags=None, updated=None): # noqa: E501 + """Company - a model defined in Swagger""" # noqa: E501 + self._logo = None + self._exchange = None + self._name = None + self._symbol = None + self._listdate = None + self._cik = None + self._bloomberg = None + self._figi = None + self._lei = None + self._sic = None + self._country = None + self._industry = None + self._sector = None + self._marketcap = None + self._employees = None + self._phone = None + self._ceo = None + self._url = None + self._description = None + self._similar = None + self._tags = None + self._updated = None + self.discriminator = None + if logo is not None: + self.logo = logo + self.exchange = exchange + self.name = name + self.symbol = symbol + if listdate is not None: + self.listdate = listdate + if cik is not None: + self.cik = cik + if bloomberg is not None: + self.bloomberg = bloomberg + if figi is not None: + self.figi = figi + if lei is not None: + self.lei = lei + if sic is not None: + self.sic = sic + if country is not None: + self.country = country + if industry is not None: + self.industry = industry + if sector is not None: + self.sector = sector + if marketcap is not None: + self.marketcap = marketcap + if employees is not None: + self.employees = employees + if phone is not None: + self.phone = phone + if ceo is not None: + self.ceo = ceo + if url is not None: + self.url = url + self.description = description + if similar is not None: + self.similar = similar + if tags is not None: + self.tags = tags + self.updated = updated + + @property + def logo(self): + """Gets the logo of this Company. # noqa: E501 + + URL of the entities logo. # noqa: E501 + + :return: The logo of this Company. # noqa: E501 + :rtype: str + """ + return self._logo + + @logo.setter + def logo(self, logo): + """Sets the logo of this Company. + + URL of the entities logo. # noqa: E501 + + :param logo: The logo of this Company. # noqa: E501 + :type: str + """ + + self._logo = logo + + @property + def exchange(self): + """Gets the exchange of this Company. # noqa: E501 + + Symbols primary exchange # noqa: E501 + + :return: The exchange of this Company. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this Company. + + Symbols primary exchange # noqa: E501 + + :param exchange: The exchange of this Company. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def name(self): + """Gets the name of this Company. # noqa: E501 + + Name of the company/entity # noqa: E501 + + :return: The name of this Company. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Company. + + Name of the company/entity # noqa: E501 + + :param name: The name of this Company. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def symbol(self): + """Gets the symbol of this Company. # noqa: E501 + + + :return: The symbol of this Company. # noqa: E501 + :rtype: StockSymbol + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Company. + + + :param symbol: The symbol of this Company. # noqa: E501 + :type: StockSymbol + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def listdate(self): + """Gets the listdate of this Company. # noqa: E501 + + Date this symbol was listed on the exchange. # noqa: E501 + + :return: The listdate of this Company. # noqa: E501 + :rtype: date + """ + return self._listdate + + @listdate.setter + def listdate(self, listdate): + """Sets the listdate of this Company. + + Date this symbol was listed on the exchange. # noqa: E501 + + :param listdate: The listdate of this Company. # noqa: E501 + :type: date + """ + + self._listdate = listdate + + @property + def cik(self): + """Gets the cik of this Company. # noqa: E501 + + Official CIK guid used for SEC database / filings. # noqa: E501 + + :return: The cik of this Company. # noqa: E501 + :rtype: str + """ + return self._cik + + @cik.setter + def cik(self, cik): + """Sets the cik of this Company. + + Official CIK guid used for SEC database / filings. # noqa: E501 + + :param cik: The cik of this Company. # noqa: E501 + :type: str + """ + + self._cik = cik + + @property + def bloomberg(self): + """Gets the bloomberg of this Company. # noqa: E501 + + Bloomberg guid for this symbol # noqa: E501 + + :return: The bloomberg of this Company. # noqa: E501 + :rtype: str + """ + return self._bloomberg + + @bloomberg.setter + def bloomberg(self, bloomberg): + """Sets the bloomberg of this Company. + + Bloomberg guid for this symbol # noqa: E501 + + :param bloomberg: The bloomberg of this Company. # noqa: E501 + :type: str + """ + + self._bloomberg = bloomberg + + @property + def figi(self): + """Gets the figi of this Company. # noqa: E501 + + guid for the OpenFigi project ( https://openfigi.com/ ) # noqa: E501 + + :return: The figi of this Company. # noqa: E501 + :rtype: str + """ + return self._figi + + @figi.setter + def figi(self, figi): + """Sets the figi of this Company. + + guid for the OpenFigi project ( https://openfigi.com/ ) # noqa: E501 + + :param figi: The figi of this Company. # noqa: E501 + :type: str + """ + + self._figi = figi + + @property + def lei(self): + """Gets the lei of this Company. # noqa: E501 + + Legal Entity Identifier (LEI) guid for symbol ( https://en.wikipedia.org/wiki/Legal_Entity_Identifier ) # noqa: E501 + + :return: The lei of this Company. # noqa: E501 + :rtype: str + """ + return self._lei + + @lei.setter + def lei(self, lei): + """Sets the lei of this Company. + + Legal Entity Identifier (LEI) guid for symbol ( https://en.wikipedia.org/wiki/Legal_Entity_Identifier ) # noqa: E501 + + :param lei: The lei of this Company. # noqa: E501 + :type: str + """ + + self._lei = lei + + @property + def sic(self): + """Gets the sic of this Company. # noqa: E501 + + Standard Industrial Classification (SIC) id for symbol ( https://en.wikipedia.org/wiki/Standard_Industrial_Classification ) # noqa: E501 + + :return: The sic of this Company. # noqa: E501 + :rtype: float + """ + return self._sic + + @sic.setter + def sic(self, sic): + """Sets the sic of this Company. + + Standard Industrial Classification (SIC) id for symbol ( https://en.wikipedia.org/wiki/Standard_Industrial_Classification ) # noqa: E501 + + :param sic: The sic of this Company. # noqa: E501 + :type: float + """ + + self._sic = sic + + @property + def country(self): + """Gets the country of this Company. # noqa: E501 + + Country in which this company is registered # noqa: E501 + + :return: The country of this Company. # noqa: E501 + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """Sets the country of this Company. + + Country in which this company is registered # noqa: E501 + + :param country: The country of this Company. # noqa: E501 + :type: str + """ + + self._country = country + + @property + def industry(self): + """Gets the industry of this Company. # noqa: E501 + + Industry this company operates in # noqa: E501 + + :return: The industry of this Company. # noqa: E501 + :rtype: str + """ + return self._industry + + @industry.setter + def industry(self, industry): + """Sets the industry of this Company. + + Industry this company operates in # noqa: E501 + + :param industry: The industry of this Company. # noqa: E501 + :type: str + """ + + self._industry = industry + + @property + def sector(self): + """Gets the sector of this Company. # noqa: E501 + + Sector of the indsutry in which this symbol operates in # noqa: E501 + + :return: The sector of this Company. # noqa: E501 + :rtype: str + """ + return self._sector + + @sector.setter + def sector(self, sector): + """Sets the sector of this Company. + + Sector of the indsutry in which this symbol operates in # noqa: E501 + + :param sector: The sector of this Company. # noqa: E501 + :type: str + """ + + self._sector = sector + + @property + def marketcap(self): + """Gets the marketcap of this Company. # noqa: E501 + + Current market cap for this company # noqa: E501 + + :return: The marketcap of this Company. # noqa: E501 + :rtype: float + """ + return self._marketcap + + @marketcap.setter + def marketcap(self, marketcap): + """Sets the marketcap of this Company. + + Current market cap for this company # noqa: E501 + + :param marketcap: The marketcap of this Company. # noqa: E501 + :type: float + """ + + self._marketcap = marketcap + + @property + def employees(self): + """Gets the employees of this Company. # noqa: E501 + + Approximate number of employees # noqa: E501 + + :return: The employees of this Company. # noqa: E501 + :rtype: float + """ + return self._employees + + @employees.setter + def employees(self, employees): + """Sets the employees of this Company. + + Approximate number of employees # noqa: E501 + + :param employees: The employees of this Company. # noqa: E501 + :type: float + """ + + self._employees = employees + + @property + def phone(self): + """Gets the phone of this Company. # noqa: E501 + + Phone number for this company. Usually corporate contact number. # noqa: E501 + + :return: The phone of this Company. # noqa: E501 + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """Sets the phone of this Company. + + Phone number for this company. Usually corporate contact number. # noqa: E501 + + :param phone: The phone of this Company. # noqa: E501 + :type: str + """ + + self._phone = phone + + @property + def ceo(self): + """Gets the ceo of this Company. # noqa: E501 + + Name of the companies current CEO # noqa: E501 + + :return: The ceo of this Company. # noqa: E501 + :rtype: str + """ + return self._ceo + + @ceo.setter + def ceo(self, ceo): + """Sets the ceo of this Company. + + Name of the companies current CEO # noqa: E501 + + :param ceo: The ceo of this Company. # noqa: E501 + :type: str + """ + + self._ceo = ceo + + @property + def url(self): + """Gets the url of this Company. # noqa: E501 + + URL of the companies website # noqa: E501 + + :return: The url of this Company. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this Company. + + URL of the companies website # noqa: E501 + + :param url: The url of this Company. # noqa: E501 + :type: str + """ + + self._url = url + + @property + def description(self): + """Gets the description of this Company. # noqa: E501 + + A description of the company and what they do/offer # noqa: E501 + + :return: The description of this Company. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Company. + + A description of the company and what they do/offer # noqa: E501 + + :param description: The description of this Company. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + + @property + def similar(self): + """Gets the similar of this Company. # noqa: E501 + + + :return: The similar of this Company. # noqa: E501 + :rtype: list[StockSymbol] + """ + return self._similar + + @similar.setter + def similar(self, similar): + """Sets the similar of this Company. + + + :param similar: The similar of this Company. # noqa: E501 + :type: list[StockSymbol] + """ + + self._similar = similar + + @property + def tags(self): + """Gets the tags of this Company. # noqa: E501 + + + :return: The tags of this Company. # noqa: E501 + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this Company. + + + :param tags: The tags of this Company. # noqa: E501 + :type: list[str] + """ + + self._tags = tags + + @property + def updated(self): + """Gets the updated of this Company. # noqa: E501 + + Last time this company record was updated. # noqa: E501 + + :return: The updated of this Company. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Company. + + Last time this company record was updated. # noqa: E501 + + :param updated: The updated of this Company. # noqa: E501 + :type: datetime + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Company, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Company): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/condition_type_map.py b/polygon/rest/models/condition_type_map.py new file mode 100644 index 00000000..52a0a86c --- /dev/null +++ b/polygon/rest/models/condition_type_map.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ConditionTypeMap(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ConditionTypeMap - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConditionTypeMap, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConditionTypeMap): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/conflict.py b/polygon/rest/models/conflict.py new file mode 100644 index 00000000..2b2a1c96 --- /dev/null +++ b/polygon/rest/models/conflict.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Conflict(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'message': 'str' + } + + attribute_map = { + 'message': 'message' + } + + def __init__(self, message=None): # noqa: E501 + """Conflict - a model defined in Swagger""" # noqa: E501 + self._message = None + self.discriminator = None + if message is not None: + self.message = message + + @property + def message(self): + """Gets the message of this Conflict. # noqa: E501 + + + :return: The message of this Conflict. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Conflict. + + + :param message: The message of this Conflict. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Conflict, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Conflict): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_exchange.py b/polygon/rest/models/crypto_exchange.py new file mode 100644 index 00000000..0e600db3 --- /dev/null +++ b/polygon/rest/models/crypto_exchange.py @@ -0,0 +1,242 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoExchange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'float', + 'type': 'str', + 'market': 'str', + 'name': 'str', + 'url': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'market': 'market', + 'name': 'name', + 'url': 'url' + } + + def __init__(self, id=None, type=None, market=None, name=None, url=None): # noqa: E501 + """CryptoExchange - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self._market = None + self._name = None + self._url = None + self.discriminator = None + self.id = id + self.type = type + self.market = market + self.name = name + self.url = url + + @property + def id(self): + """Gets the id of this CryptoExchange. # noqa: E501 + + ID of the exchange # noqa: E501 + + :return: The id of this CryptoExchange. # noqa: E501 + :rtype: float + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CryptoExchange. + + ID of the exchange # noqa: E501 + + :param id: The id of this CryptoExchange. # noqa: E501 + :type: float + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type(self): + """Gets the type of this CryptoExchange. # noqa: E501 + + Type of exchange feed # noqa: E501 + + :return: The type of this CryptoExchange. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CryptoExchange. + + Type of exchange feed # noqa: E501 + + :param type: The type of this CryptoExchange. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["exchange"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def market(self): + """Gets the market of this CryptoExchange. # noqa: E501 + + Market data type this exchange contains ( crypto only currently ) # noqa: E501 + + :return: The market of this CryptoExchange. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this CryptoExchange. + + Market data type this exchange contains ( crypto only currently ) # noqa: E501 + + :param market: The market of this CryptoExchange. # noqa: E501 + :type: str + """ + if market is None: + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + allowed_values = ["crypto"] # noqa: E501 + if market not in allowed_values: + raise ValueError( + "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 + .format(market, allowed_values) + ) + + self._market = market + + @property + def name(self): + """Gets the name of this CryptoExchange. # noqa: E501 + + Name of the exchange # noqa: E501 + + :return: The name of this CryptoExchange. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CryptoExchange. + + Name of the exchange # noqa: E501 + + :param name: The name of this CryptoExchange. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def url(self): + """Gets the url of this CryptoExchange. # noqa: E501 + + URL of this exchange # noqa: E501 + + :return: The url of this CryptoExchange. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this CryptoExchange. + + URL of this exchange # noqa: E501 + + :param url: The url of this CryptoExchange. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoExchange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoExchange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_snapshot_agg.py b/polygon/rest/models/crypto_snapshot_agg.py new file mode 100644 index 00000000..b3dd669d --- /dev/null +++ b/polygon/rest/models/crypto_snapshot_agg.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoSnapshotAgg(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'c': 'int', + 'h': 'int', + 'l': 'int', + 'o': 'int', + 'v': 'int' + } + + attribute_map = { + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o', + 'v': 'v' + } + + def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 + """CryptoSnapshotAgg - a model defined in Swagger""" # noqa: E501 + self._c = None + self._h = None + self._l = None + self._o = None + self._v = None + self.discriminator = None + self.c = c + self.h = h + self.l = l + self.o = o + self.v = v + + @property + def c(self): + """Gets the c of this CryptoSnapshotAgg. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this CryptoSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this CryptoSnapshotAgg. + + Close price # noqa: E501 + + :param c: The c of this CryptoSnapshotAgg. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def h(self): + """Gets the h of this CryptoSnapshotAgg. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this CryptoSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this CryptoSnapshotAgg. + + High price # noqa: E501 + + :param h: The h of this CryptoSnapshotAgg. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def l(self): + """Gets the l of this CryptoSnapshotAgg. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this CryptoSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this CryptoSnapshotAgg. + + Low price # noqa: E501 + + :param l: The l of this CryptoSnapshotAgg. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def o(self): + """Gets the o of this CryptoSnapshotAgg. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this CryptoSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this CryptoSnapshotAgg. + + Open price # noqa: E501 + + :param o: The o of this CryptoSnapshotAgg. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def v(self): + """Gets the v of this CryptoSnapshotAgg. # noqa: E501 + + Volume # noqa: E501 + + :return: The v of this CryptoSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this CryptoSnapshotAgg. + + Volume # noqa: E501 + + :param v: The v of this CryptoSnapshotAgg. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoSnapshotAgg, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoSnapshotAgg): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_snapshot_book_item.py b/polygon/rest/models/crypto_snapshot_book_item.py new file mode 100644 index 00000000..10820430 --- /dev/null +++ b/polygon/rest/models/crypto_snapshot_book_item.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoSnapshotBookItem(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'p': 'int', + 'x': 'object' + } + + attribute_map = { + 'p': 'p', + 'x': 'x' + } + + def __init__(self, p=None, x=None): # noqa: E501 + """CryptoSnapshotBookItem - a model defined in Swagger""" # noqa: E501 + self._p = None + self._x = None + self.discriminator = None + self.p = p + self.x = x + + @property + def p(self): + """Gets the p of this CryptoSnapshotBookItem. # noqa: E501 + + Price of this book level # noqa: E501 + + :return: The p of this CryptoSnapshotBookItem. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this CryptoSnapshotBookItem. + + Price of this book level # noqa: E501 + + :param p: The p of this CryptoSnapshotBookItem. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def x(self): + """Gets the x of this CryptoSnapshotBookItem. # noqa: E501 + + Exchange to Size of this price level # noqa: E501 + + :return: The x of this CryptoSnapshotBookItem. # noqa: E501 + :rtype: object + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this CryptoSnapshotBookItem. + + Exchange to Size of this price level # noqa: E501 + + :param x: The x of this CryptoSnapshotBookItem. # noqa: E501 + :type: object + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoSnapshotBookItem, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoSnapshotBookItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_snapshot_ticker.py b/polygon/rest/models/crypto_snapshot_ticker.py new file mode 100644 index 00000000..44a4f982 --- /dev/null +++ b/polygon/rest/models/crypto_snapshot_ticker.py @@ -0,0 +1,309 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoSnapshotTicker(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'day': 'CryptoSnapshotAgg', + 'last_trade': 'CryptoTickJson', + 'min': 'CryptoSnapshotAgg', + 'prev_day': 'CryptoSnapshotAgg', + 'todays_change': 'int', + 'todays_change_perc': 'int', + 'updated': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'day': 'day', + 'last_trade': 'lastTrade', + 'min': 'min', + 'prev_day': 'prevDay', + 'todays_change': 'todaysChange', + 'todays_change_perc': 'todaysChangePerc', + 'updated': 'updated' + } + + def __init__(self, ticker=None, day=None, last_trade=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 + """CryptoSnapshotTicker - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._day = None + self._last_trade = None + self._min = None + self._prev_day = None + self._todays_change = None + self._todays_change_perc = None + self._updated = None + self.discriminator = None + self.ticker = ticker + self.day = day + self.last_trade = last_trade + self.min = min + self.prev_day = prev_day + self.todays_change = todays_change + self.todays_change_perc = todays_change_perc + self.updated = updated + + @property + def ticker(self): + """Gets the ticker of this CryptoSnapshotTicker. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The ticker of this CryptoSnapshotTicker. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this CryptoSnapshotTicker. + + Ticker of the object # noqa: E501 + + :param ticker: The ticker of this CryptoSnapshotTicker. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def day(self): + """Gets the day of this CryptoSnapshotTicker. # noqa: E501 + + + :return: The day of this CryptoSnapshotTicker. # noqa: E501 + :rtype: CryptoSnapshotAgg + """ + return self._day + + @day.setter + def day(self, day): + """Sets the day of this CryptoSnapshotTicker. + + + :param day: The day of this CryptoSnapshotTicker. # noqa: E501 + :type: CryptoSnapshotAgg + """ + if day is None: + raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 + + self._day = day + + @property + def last_trade(self): + """Gets the last_trade of this CryptoSnapshotTicker. # noqa: E501 + + + :return: The last_trade of this CryptoSnapshotTicker. # noqa: E501 + :rtype: CryptoTickJson + """ + return self._last_trade + + @last_trade.setter + def last_trade(self, last_trade): + """Sets the last_trade of this CryptoSnapshotTicker. + + + :param last_trade: The last_trade of this CryptoSnapshotTicker. # noqa: E501 + :type: CryptoTickJson + """ + if last_trade is None: + raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 + + self._last_trade = last_trade + + @property + def min(self): + """Gets the min of this CryptoSnapshotTicker. # noqa: E501 + + + :return: The min of this CryptoSnapshotTicker. # noqa: E501 + :rtype: CryptoSnapshotAgg + """ + return self._min + + @min.setter + def min(self, min): + """Sets the min of this CryptoSnapshotTicker. + + + :param min: The min of this CryptoSnapshotTicker. # noqa: E501 + :type: CryptoSnapshotAgg + """ + if min is None: + raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 + + self._min = min + + @property + def prev_day(self): + """Gets the prev_day of this CryptoSnapshotTicker. # noqa: E501 + + + :return: The prev_day of this CryptoSnapshotTicker. # noqa: E501 + :rtype: CryptoSnapshotAgg + """ + return self._prev_day + + @prev_day.setter + def prev_day(self, prev_day): + """Sets the prev_day of this CryptoSnapshotTicker. + + + :param prev_day: The prev_day of this CryptoSnapshotTicker. # noqa: E501 + :type: CryptoSnapshotAgg + """ + if prev_day is None: + raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 + + self._prev_day = prev_day + + @property + def todays_change(self): + """Gets the todays_change of this CryptoSnapshotTicker. # noqa: E501 + + Value of the change from previous day # noqa: E501 + + :return: The todays_change of this CryptoSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change + + @todays_change.setter + def todays_change(self, todays_change): + """Sets the todays_change of this CryptoSnapshotTicker. + + Value of the change from previous day # noqa: E501 + + :param todays_change: The todays_change of this CryptoSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change is None: + raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 + + self._todays_change = todays_change + + @property + def todays_change_perc(self): + """Gets the todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 + + Percentage change since previous day # noqa: E501 + + :return: The todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change_perc + + @todays_change_perc.setter + def todays_change_perc(self, todays_change_perc): + """Sets the todays_change_perc of this CryptoSnapshotTicker. + + Percentage change since previous day # noqa: E501 + + :param todays_change_perc: The todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change_perc is None: + raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 + + self._todays_change_perc = todays_change_perc + + @property + def updated(self): + """Gets the updated of this CryptoSnapshotTicker. # noqa: E501 + + Last Updated timestamp # noqa: E501 + + :return: The updated of this CryptoSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this CryptoSnapshotTicker. + + Last Updated timestamp # noqa: E501 + + :param updated: The updated of this CryptoSnapshotTicker. # noqa: E501 + :type: int + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoSnapshotTicker, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoSnapshotTicker): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_snapshot_ticker_book.py b/polygon/rest/models/crypto_snapshot_ticker_book.py new file mode 100644 index 00000000..73327541 --- /dev/null +++ b/polygon/rest/models/crypto_snapshot_ticker_book.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoSnapshotTickerBook(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'bids': 'list[CryptoSnapshotBookItem]', + 'asks': 'list[CryptoSnapshotBookItem]', + 'bid_count': 'int', + 'ask_count': 'int', + 'spread': 'int', + 'updated': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'bids': 'bids', + 'asks': 'asks', + 'bid_count': 'bidCount', + 'ask_count': 'askCount', + 'spread': 'spread', + 'updated': 'updated' + } + + def __init__(self, ticker=None, bids=None, asks=None, bid_count=None, ask_count=None, spread=None, updated=None): # noqa: E501 + """CryptoSnapshotTickerBook - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._bids = None + self._asks = None + self._bid_count = None + self._ask_count = None + self._spread = None + self._updated = None + self.discriminator = None + self.ticker = ticker + if bids is not None: + self.bids = bids + if asks is not None: + self.asks = asks + if bid_count is not None: + self.bid_count = bid_count + if ask_count is not None: + self.ask_count = ask_count + if spread is not None: + self.spread = spread + self.updated = updated + + @property + def ticker(self): + """Gets the ticker of this CryptoSnapshotTickerBook. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The ticker of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this CryptoSnapshotTickerBook. + + Ticker of the object # noqa: E501 + + :param ticker: The ticker of this CryptoSnapshotTickerBook. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def bids(self): + """Gets the bids of this CryptoSnapshotTickerBook. # noqa: E501 + + Bids # noqa: E501 + + :return: The bids of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: list[CryptoSnapshotBookItem] + """ + return self._bids + + @bids.setter + def bids(self, bids): + """Sets the bids of this CryptoSnapshotTickerBook. + + Bids # noqa: E501 + + :param bids: The bids of this CryptoSnapshotTickerBook. # noqa: E501 + :type: list[CryptoSnapshotBookItem] + """ + + self._bids = bids + + @property + def asks(self): + """Gets the asks of this CryptoSnapshotTickerBook. # noqa: E501 + + Asks # noqa: E501 + + :return: The asks of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: list[CryptoSnapshotBookItem] + """ + return self._asks + + @asks.setter + def asks(self, asks): + """Sets the asks of this CryptoSnapshotTickerBook. + + Asks # noqa: E501 + + :param asks: The asks of this CryptoSnapshotTickerBook. # noqa: E501 + :type: list[CryptoSnapshotBookItem] + """ + + self._asks = asks + + @property + def bid_count(self): + """Gets the bid_count of this CryptoSnapshotTickerBook. # noqa: E501 + + Combined total number of bids in the book # noqa: E501 + + :return: The bid_count of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._bid_count + + @bid_count.setter + def bid_count(self, bid_count): + """Sets the bid_count of this CryptoSnapshotTickerBook. + + Combined total number of bids in the book # noqa: E501 + + :param bid_count: The bid_count of this CryptoSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._bid_count = bid_count + + @property + def ask_count(self): + """Gets the ask_count of this CryptoSnapshotTickerBook. # noqa: E501 + + Combined total number of asks in the book # noqa: E501 + + :return: The ask_count of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._ask_count + + @ask_count.setter + def ask_count(self, ask_count): + """Sets the ask_count of this CryptoSnapshotTickerBook. + + Combined total number of asks in the book # noqa: E501 + + :param ask_count: The ask_count of this CryptoSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._ask_count = ask_count + + @property + def spread(self): + """Gets the spread of this CryptoSnapshotTickerBook. # noqa: E501 + + Difference between the best bid and the best ask price accross exchanges # noqa: E501 + + :return: The spread of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._spread + + @spread.setter + def spread(self, spread): + """Sets the spread of this CryptoSnapshotTickerBook. + + Difference between the best bid and the best ask price accross exchanges # noqa: E501 + + :param spread: The spread of this CryptoSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._spread = spread + + @property + def updated(self): + """Gets the updated of this CryptoSnapshotTickerBook. # noqa: E501 + + Last Updated timestamp # noqa: E501 + + :return: The updated of this CryptoSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this CryptoSnapshotTickerBook. + + Last Updated timestamp # noqa: E501 + + :param updated: The updated of this CryptoSnapshotTickerBook. # noqa: E501 + :type: int + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoSnapshotTickerBook, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoSnapshotTickerBook): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_tick.py b/polygon/rest/models/crypto_tick.py new file mode 100644 index 00000000..a08982dc --- /dev/null +++ b/polygon/rest/models/crypto_tick.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoTick(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'price': 'int', + 'size': 'int', + 'exchange': 'int', + 'conditions': 'list[int]', + 'timestamp': 'int' + } + + attribute_map = { + 'price': 'price', + 'size': 'size', + 'exchange': 'exchange', + 'conditions': 'conditions', + 'timestamp': 'timestamp' + } + + def __init__(self, price=None, size=None, exchange=None, conditions=None, timestamp=None): # noqa: E501 + """CryptoTick - a model defined in Swagger""" # noqa: E501 + self._price = None + self._size = None + self._exchange = None + self._conditions = None + self._timestamp = None + self.discriminator = None + self.price = price + self.size = size + self.exchange = exchange + self.conditions = conditions + self.timestamp = timestamp + + @property + def price(self): + """Gets the price of this CryptoTick. # noqa: E501 + + Trade Price # noqa: E501 + + :return: The price of this CryptoTick. # noqa: E501 + :rtype: int + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CryptoTick. + + Trade Price # noqa: E501 + + :param price: The price of this CryptoTick. # noqa: E501 + :type: int + """ + if price is None: + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def size(self): + """Gets the size of this CryptoTick. # noqa: E501 + + Size of the trade # noqa: E501 + + :return: The size of this CryptoTick. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this CryptoTick. + + Size of the trade # noqa: E501 + + :param size: The size of this CryptoTick. # noqa: E501 + :type: int + """ + if size is None: + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 + + self._size = size + + @property + def exchange(self): + """Gets the exchange of this CryptoTick. # noqa: E501 + + Exchange the trade occured on # noqa: E501 + + :return: The exchange of this CryptoTick. # noqa: E501 + :rtype: int + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this CryptoTick. + + Exchange the trade occured on # noqa: E501 + + :param exchange: The exchange of this CryptoTick. # noqa: E501 + :type: int + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def conditions(self): + """Gets the conditions of this CryptoTick. # noqa: E501 + + Conditions of this trade # noqa: E501 + + :return: The conditions of this CryptoTick. # noqa: E501 + :rtype: list[int] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this CryptoTick. + + Conditions of this trade # noqa: E501 + + :param conditions: The conditions of this CryptoTick. # noqa: E501 + :type: list[int] + """ + if conditions is None: + raise ValueError("Invalid value for `conditions`, must not be `None`") # noqa: E501 + + self._conditions = conditions + + @property + def timestamp(self): + """Gets the timestamp of this CryptoTick. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this CryptoTick. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CryptoTick. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this CryptoTick. # noqa: E501 + :type: int + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoTick, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoTick): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/crypto_tick_json.py b/polygon/rest/models/crypto_tick_json.py new file mode 100644 index 00000000..7988cbb1 --- /dev/null +++ b/polygon/rest/models/crypto_tick_json.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class CryptoTickJson(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'p': 'int', + 's': 'int', + 'x': 'int', + 'c': 'list[int]', + 't': 'int' + } + + attribute_map = { + 'p': 'p', + 's': 's', + 'x': 'x', + 'c': 'c', + 't': 't' + } + + def __init__(self, p=None, s=None, x=None, c=None, t=None): # noqa: E501 + """CryptoTickJson - a model defined in Swagger""" # noqa: E501 + self._p = None + self._s = None + self._x = None + self._c = None + self._t = None + self.discriminator = None + self.p = p + self.s = s + self.x = x + self.c = c + self.t = t + + @property + def p(self): + """Gets the p of this CryptoTickJson. # noqa: E501 + + Trade Price # noqa: E501 + + :return: The p of this CryptoTickJson. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this CryptoTickJson. + + Trade Price # noqa: E501 + + :param p: The p of this CryptoTickJson. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def s(self): + """Gets the s of this CryptoTickJson. # noqa: E501 + + Size of the trade # noqa: E501 + + :return: The s of this CryptoTickJson. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this CryptoTickJson. + + Size of the trade # noqa: E501 + + :param s: The s of this CryptoTickJson. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def x(self): + """Gets the x of this CryptoTickJson. # noqa: E501 + + Exchange the trade occured on # noqa: E501 + + :return: The x of this CryptoTickJson. # noqa: E501 + :rtype: int + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this CryptoTickJson. + + Exchange the trade occured on # noqa: E501 + + :param x: The x of this CryptoTickJson. # noqa: E501 + :type: int + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + @property + def c(self): + """Gets the c of this CryptoTickJson. # noqa: E501 + + Conditions of this trade # noqa: E501 + + :return: The c of this CryptoTickJson. # noqa: E501 + :rtype: list[int] + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this CryptoTickJson. + + Conditions of this trade # noqa: E501 + + :param c: The c of this CryptoTickJson. # noqa: E501 + :type: list[int] + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def t(self): + """Gets the t of this CryptoTickJson. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The t of this CryptoTickJson. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this CryptoTickJson. + + Timestamp of this trade # noqa: E501 + + :param t: The t of this CryptoTickJson. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CryptoTickJson, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CryptoTickJson): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/dividend.py b/polygon/rest/models/dividend.py new file mode 100644 index 00000000..335d3e17 --- /dev/null +++ b/polygon/rest/models/dividend.py @@ -0,0 +1,345 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Dividend(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbol': 'StockSymbol', + 'type': 'str', + 'ex_date': 'datetime', + 'payment_date': 'datetime', + 'record_date': 'datetime', + 'declared_date': 'datetime', + 'amount': 'float', + 'qualified': 'str', + 'flag': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'type': 'type', + 'ex_date': 'exDate', + 'payment_date': 'paymentDate', + 'record_date': 'recordDate', + 'declared_date': 'declaredDate', + 'amount': 'amount', + 'qualified': 'qualified', + 'flag': 'flag' + } + + def __init__(self, symbol=None, type=None, ex_date=None, payment_date=None, record_date=None, declared_date=None, amount=None, qualified=None, flag=None): # noqa: E501 + """Dividend - a model defined in Swagger""" # noqa: E501 + self._symbol = None + self._type = None + self._ex_date = None + self._payment_date = None + self._record_date = None + self._declared_date = None + self._amount = None + self._qualified = None + self._flag = None + self.discriminator = None + self.symbol = symbol + self.type = type + self.ex_date = ex_date + if payment_date is not None: + self.payment_date = payment_date + if record_date is not None: + self.record_date = record_date + if declared_date is not None: + self.declared_date = declared_date + self.amount = amount + if qualified is not None: + self.qualified = qualified + if flag is not None: + self.flag = flag + + @property + def symbol(self): + """Gets the symbol of this Dividend. # noqa: E501 + + + :return: The symbol of this Dividend. # noqa: E501 + :rtype: StockSymbol + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Dividend. + + + :param symbol: The symbol of this Dividend. # noqa: E501 + :type: StockSymbol + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def type(self): + """Gets the type of this Dividend. # noqa: E501 + + Refers to the dividend payment type
- Dividend income
- Interest income
- Stock dividend
- Short term capital gain
- Medium term capital gain
- Long term capital gain
- Unspecified term capital gain
# noqa: E501 + + :return: The type of this Dividend. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Dividend. + + Refers to the dividend payment type
- Dividend income
- Interest income
- Stock dividend
- Short term capital gain
- Medium term capital gain
- Long term capital gain
- Unspecified term capital gain
# noqa: E501 + + :param type: The type of this Dividend. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def ex_date(self): + """Gets the ex_date of this Dividend. # noqa: E501 + + Execution date of the trade # noqa: E501 + + :return: The ex_date of this Dividend. # noqa: E501 + :rtype: datetime + """ + return self._ex_date + + @ex_date.setter + def ex_date(self, ex_date): + """Sets the ex_date of this Dividend. + + Execution date of the trade # noqa: E501 + + :param ex_date: The ex_date of this Dividend. # noqa: E501 + :type: datetime + """ + if ex_date is None: + raise ValueError("Invalid value for `ex_date`, must not be `None`") # noqa: E501 + + self._ex_date = ex_date + + @property + def payment_date(self): + """Gets the payment_date of this Dividend. # noqa: E501 + + Payment date of the trade # noqa: E501 + + :return: The payment_date of this Dividend. # noqa: E501 + :rtype: datetime + """ + return self._payment_date + + @payment_date.setter + def payment_date(self, payment_date): + """Sets the payment_date of this Dividend. + + Payment date of the trade # noqa: E501 + + :param payment_date: The payment_date of this Dividend. # noqa: E501 + :type: datetime + """ + + self._payment_date = payment_date + + @property + def record_date(self): + """Gets the record_date of this Dividend. # noqa: E501 + + Record date of the trade # noqa: E501 + + :return: The record_date of this Dividend. # noqa: E501 + :rtype: datetime + """ + return self._record_date + + @record_date.setter + def record_date(self, record_date): + """Sets the record_date of this Dividend. + + Record date of the trade # noqa: E501 + + :param record_date: The record_date of this Dividend. # noqa: E501 + :type: datetime + """ + + self._record_date = record_date + + @property + def declared_date(self): + """Gets the declared_date of this Dividend. # noqa: E501 + + Declared date of the trade # noqa: E501 + + :return: The declared_date of this Dividend. # noqa: E501 + :rtype: datetime + """ + return self._declared_date + + @declared_date.setter + def declared_date(self, declared_date): + """Sets the declared_date of this Dividend. + + Declared date of the trade # noqa: E501 + + :param declared_date: The declared_date of this Dividend. # noqa: E501 + :type: datetime + """ + + self._declared_date = declared_date + + @property + def amount(self): + """Gets the amount of this Dividend. # noqa: E501 + + Amount of the dividend # noqa: E501 + + :return: The amount of this Dividend. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this Dividend. + + Amount of the dividend # noqa: E501 + + :param amount: The amount of this Dividend. # noqa: E501 + :type: float + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def qualified(self): + """Gets the qualified of this Dividend. # noqa: E501 + + Refers to the dividend income type
- P = Partially qualified income
- Q = Qualified income
- N = Unqualified income
- null = N/A or unknown # noqa: E501 + + :return: The qualified of this Dividend. # noqa: E501 + :rtype: str + """ + return self._qualified + + @qualified.setter + def qualified(self, qualified): + """Sets the qualified of this Dividend. + + Refers to the dividend income type
- P = Partially qualified income
- Q = Qualified income
- N = Unqualified income
- null = N/A or unknown # noqa: E501 + + :param qualified: The qualified of this Dividend. # noqa: E501 + :type: str + """ + allowed_values = ["P", "Q", "N", "null"] # noqa: E501 + if qualified not in allowed_values: + raise ValueError( + "Invalid value for `qualified` ({0}), must be one of {1}" # noqa: E501 + .format(qualified, allowed_values) + ) + + self._qualified = qualified + + @property + def flag(self): + """Gets the flag of this Dividend. # noqa: E501 + + Refers to the dividend flag, if set
FI = Final dividend, div ends or instrument ends
LI = Liquidation, instrument liquidates
PR = Proceeds of a sale of rights or shares
RE = Redemption of rights
AC = Accrued dividend
AR = Payment in arrears
AD = Additional payment
EX = Extra payment
SP = Special dividend
YE = Year end
UR = Unknown rate
SU = Regular dividend is suspended # noqa: E501 + + :return: The flag of this Dividend. # noqa: E501 + :rtype: str + """ + return self._flag + + @flag.setter + def flag(self, flag): + """Sets the flag of this Dividend. + + Refers to the dividend flag, if set
FI = Final dividend, div ends or instrument ends
LI = Liquidation, instrument liquidates
PR = Proceeds of a sale of rights or shares
RE = Redemption of rights
AC = Accrued dividend
AR = Payment in arrears
AD = Additional payment
EX = Extra payment
SP = Special dividend
YE = Year end
UR = Unknown rate
SU = Regular dividend is suspended # noqa: E501 + + :param flag: The flag of this Dividend. # noqa: E501 + :type: str + """ + + self._flag = flag + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Dividend, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Dividend): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/earning.py b/polygon/rest/models/earning.py new file mode 100644 index 00000000..553a6406 --- /dev/null +++ b/polygon/rest/models/earning.py @@ -0,0 +1,458 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Earning(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbol': 'str', + 'eps_report_date': 'datetime', + 'eps_report_date_str': 'str', + 'fiscal_period': 'str', + 'fiscal_end_date': 'datetime', + 'actual_eps': 'float', + 'consensus_eps': 'float', + 'estimated_eps': 'float', + 'announce_time': 'str', + 'number_of_estimates': 'float', + 'eps_surprise_dollar': 'float', + 'year_ago': 'float', + 'year_ago_change_percent': 'float', + 'estimated_change_percent': 'float' + } + + attribute_map = { + 'symbol': 'symbol', + 'eps_report_date': 'EPSReportDate', + 'eps_report_date_str': 'EPSReportDateStr', + 'fiscal_period': 'fiscalPeriod', + 'fiscal_end_date': 'fiscalEndDate', + 'actual_eps': 'actualEPS', + 'consensus_eps': 'consensusEPS', + 'estimated_eps': 'estimatedEPS', + 'announce_time': 'announceTime', + 'number_of_estimates': 'numberOfEstimates', + 'eps_surprise_dollar': 'EPSSurpriseDollar', + 'year_ago': 'yearAgo', + 'year_ago_change_percent': 'yearAgoChangePercent', + 'estimated_change_percent': 'estimatedChangePercent' + } + + def __init__(self, symbol=None, eps_report_date=None, eps_report_date_str=None, fiscal_period=None, fiscal_end_date=None, actual_eps=None, consensus_eps=None, estimated_eps=None, announce_time=None, number_of_estimates=None, eps_surprise_dollar=None, year_ago=None, year_ago_change_percent=None, estimated_change_percent=None): # noqa: E501 + """Earning - a model defined in Swagger""" # noqa: E501 + self._symbol = None + self._eps_report_date = None + self._eps_report_date_str = None + self._fiscal_period = None + self._fiscal_end_date = None + self._actual_eps = None + self._consensus_eps = None + self._estimated_eps = None + self._announce_time = None + self._number_of_estimates = None + self._eps_surprise_dollar = None + self._year_ago = None + self._year_ago_change_percent = None + self._estimated_change_percent = None + self.discriminator = None + self.symbol = symbol + self.eps_report_date = eps_report_date + self.eps_report_date_str = eps_report_date_str + if fiscal_period is not None: + self.fiscal_period = fiscal_period + if fiscal_end_date is not None: + self.fiscal_end_date = fiscal_end_date + if actual_eps is not None: + self.actual_eps = actual_eps + if consensus_eps is not None: + self.consensus_eps = consensus_eps + if estimated_eps is not None: + self.estimated_eps = estimated_eps + if announce_time is not None: + self.announce_time = announce_time + if number_of_estimates is not None: + self.number_of_estimates = number_of_estimates + if eps_surprise_dollar is not None: + self.eps_surprise_dollar = eps_surprise_dollar + if year_ago is not None: + self.year_ago = year_ago + if year_ago_change_percent is not None: + self.year_ago_change_percent = year_ago_change_percent + if estimated_change_percent is not None: + self.estimated_change_percent = estimated_change_percent + + @property + def symbol(self): + """Gets the symbol of this Earning. # noqa: E501 + + Stock Symbol # noqa: E501 + + :return: The symbol of this Earning. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Earning. + + Stock Symbol # noqa: E501 + + :param symbol: The symbol of this Earning. # noqa: E501 + :type: str + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def eps_report_date(self): + """Gets the eps_report_date of this Earning. # noqa: E501 + + Report Date # noqa: E501 + + :return: The eps_report_date of this Earning. # noqa: E501 + :rtype: datetime + """ + return self._eps_report_date + + @eps_report_date.setter + def eps_report_date(self, eps_report_date): + """Sets the eps_report_date of this Earning. + + Report Date # noqa: E501 + + :param eps_report_date: The eps_report_date of this Earning. # noqa: E501 + :type: datetime + """ + if eps_report_date is None: + raise ValueError("Invalid value for `eps_report_date`, must not be `None`") # noqa: E501 + + self._eps_report_date = eps_report_date + + @property + def eps_report_date_str(self): + """Gets the eps_report_date_str of this Earning. # noqa: E501 + + Report date as non date format # noqa: E501 + + :return: The eps_report_date_str of this Earning. # noqa: E501 + :rtype: str + """ + return self._eps_report_date_str + + @eps_report_date_str.setter + def eps_report_date_str(self, eps_report_date_str): + """Sets the eps_report_date_str of this Earning. + + Report date as non date format # noqa: E501 + + :param eps_report_date_str: The eps_report_date_str of this Earning. # noqa: E501 + :type: str + """ + if eps_report_date_str is None: + raise ValueError("Invalid value for `eps_report_date_str`, must not be `None`") # noqa: E501 + + self._eps_report_date_str = eps_report_date_str + + @property + def fiscal_period(self): + """Gets the fiscal_period of this Earning. # noqa: E501 + + + :return: The fiscal_period of this Earning. # noqa: E501 + :rtype: str + """ + return self._fiscal_period + + @fiscal_period.setter + def fiscal_period(self, fiscal_period): + """Sets the fiscal_period of this Earning. + + + :param fiscal_period: The fiscal_period of this Earning. # noqa: E501 + :type: str + """ + + self._fiscal_period = fiscal_period + + @property + def fiscal_end_date(self): + """Gets the fiscal_end_date of this Earning. # noqa: E501 + + + :return: The fiscal_end_date of this Earning. # noqa: E501 + :rtype: datetime + """ + return self._fiscal_end_date + + @fiscal_end_date.setter + def fiscal_end_date(self, fiscal_end_date): + """Sets the fiscal_end_date of this Earning. + + + :param fiscal_end_date: The fiscal_end_date of this Earning. # noqa: E501 + :type: datetime + """ + + self._fiscal_end_date = fiscal_end_date + + @property + def actual_eps(self): + """Gets the actual_eps of this Earning. # noqa: E501 + + + :return: The actual_eps of this Earning. # noqa: E501 + :rtype: float + """ + return self._actual_eps + + @actual_eps.setter + def actual_eps(self, actual_eps): + """Sets the actual_eps of this Earning. + + + :param actual_eps: The actual_eps of this Earning. # noqa: E501 + :type: float + """ + + self._actual_eps = actual_eps + + @property + def consensus_eps(self): + """Gets the consensus_eps of this Earning. # noqa: E501 + + + :return: The consensus_eps of this Earning. # noqa: E501 + :rtype: float + """ + return self._consensus_eps + + @consensus_eps.setter + def consensus_eps(self, consensus_eps): + """Sets the consensus_eps of this Earning. + + + :param consensus_eps: The consensus_eps of this Earning. # noqa: E501 + :type: float + """ + + self._consensus_eps = consensus_eps + + @property + def estimated_eps(self): + """Gets the estimated_eps of this Earning. # noqa: E501 + + + :return: The estimated_eps of this Earning. # noqa: E501 + :rtype: float + """ + return self._estimated_eps + + @estimated_eps.setter + def estimated_eps(self, estimated_eps): + """Sets the estimated_eps of this Earning. + + + :param estimated_eps: The estimated_eps of this Earning. # noqa: E501 + :type: float + """ + + self._estimated_eps = estimated_eps + + @property + def announce_time(self): + """Gets the announce_time of this Earning. # noqa: E501 + + + :return: The announce_time of this Earning. # noqa: E501 + :rtype: str + """ + return self._announce_time + + @announce_time.setter + def announce_time(self, announce_time): + """Sets the announce_time of this Earning. + + + :param announce_time: The announce_time of this Earning. # noqa: E501 + :type: str + """ + + self._announce_time = announce_time + + @property + def number_of_estimates(self): + """Gets the number_of_estimates of this Earning. # noqa: E501 + + + :return: The number_of_estimates of this Earning. # noqa: E501 + :rtype: float + """ + return self._number_of_estimates + + @number_of_estimates.setter + def number_of_estimates(self, number_of_estimates): + """Sets the number_of_estimates of this Earning. + + + :param number_of_estimates: The number_of_estimates of this Earning. # noqa: E501 + :type: float + """ + + self._number_of_estimates = number_of_estimates + + @property + def eps_surprise_dollar(self): + """Gets the eps_surprise_dollar of this Earning. # noqa: E501 + + + :return: The eps_surprise_dollar of this Earning. # noqa: E501 + :rtype: float + """ + return self._eps_surprise_dollar + + @eps_surprise_dollar.setter + def eps_surprise_dollar(self, eps_surprise_dollar): + """Sets the eps_surprise_dollar of this Earning. + + + :param eps_surprise_dollar: The eps_surprise_dollar of this Earning. # noqa: E501 + :type: float + """ + + self._eps_surprise_dollar = eps_surprise_dollar + + @property + def year_ago(self): + """Gets the year_ago of this Earning. # noqa: E501 + + + :return: The year_ago of this Earning. # noqa: E501 + :rtype: float + """ + return self._year_ago + + @year_ago.setter + def year_ago(self, year_ago): + """Sets the year_ago of this Earning. + + + :param year_ago: The year_ago of this Earning. # noqa: E501 + :type: float + """ + + self._year_ago = year_ago + + @property + def year_ago_change_percent(self): + """Gets the year_ago_change_percent of this Earning. # noqa: E501 + + + :return: The year_ago_change_percent of this Earning. # noqa: E501 + :rtype: float + """ + return self._year_ago_change_percent + + @year_ago_change_percent.setter + def year_ago_change_percent(self, year_ago_change_percent): + """Sets the year_ago_change_percent of this Earning. + + + :param year_ago_change_percent: The year_ago_change_percent of this Earning. # noqa: E501 + :type: float + """ + + self._year_ago_change_percent = year_ago_change_percent + + @property + def estimated_change_percent(self): + """Gets the estimated_change_percent of this Earning. # noqa: E501 + + + :return: The estimated_change_percent of this Earning. # noqa: E501 + :rtype: float + """ + return self._estimated_change_percent + + @estimated_change_percent.setter + def estimated_change_percent(self, estimated_change_percent): + """Sets the estimated_change_percent of this Earning. + + + :param estimated_change_percent: The estimated_change_percent of this Earning. # noqa: E501 + :type: float + """ + + self._estimated_change_percent = estimated_change_percent + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Earning, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Earning): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/error.py b/polygon/rest/models/error.py new file mode 100644 index 00000000..40df1c64 --- /dev/null +++ b/polygon/rest/models/error.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Error(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'message': 'str', + 'fields': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'fields': 'fields' + } + + def __init__(self, code=None, message=None, fields=None): # noqa: E501 + """Error - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self._fields = None + self.discriminator = None + if code is not None: + self.code = code + if message is not None: + self.message = message + if fields is not None: + self.fields = fields + + @property + def code(self): + """Gets the code of this Error. # noqa: E501 + + + :return: The code of this Error. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Error. + + + :param code: The code of this Error. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this Error. # noqa: E501 + + + :return: The message of this Error. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Error. + + + :param message: The message of this Error. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def fields(self): + """Gets the fields of this Error. # noqa: E501 + + + :return: The fields of this Error. # noqa: E501 + :rtype: str + """ + return self._fields + + @fields.setter + def fields(self, fields): + """Sets the fields of this Error. + + + :param fields: The fields of this Error. # noqa: E501 + :type: str + """ + + self._fields = fields + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Error, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Error): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/exchange.py b/polygon/rest/models/exchange.py new file mode 100644 index 00000000..fec7500d --- /dev/null +++ b/polygon/rest/models/exchange.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Exchange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'float', + 'type': 'str', + 'market': 'str', + 'mic': 'str', + 'name': 'str', + 'tape': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'market': 'market', + 'mic': 'mic', + 'name': 'name', + 'tape': 'tape' + } + + def __init__(self, id=None, type=None, market=None, mic=None, name=None, tape=None): # noqa: E501 + """Exchange - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self._market = None + self._mic = None + self._name = None + self._tape = None + self.discriminator = None + self.id = id + self.type = type + self.market = market + self.mic = mic + self.name = name + self.tape = tape + + @property + def id(self): + """Gets the id of this Exchange. # noqa: E501 + + ID of the exchange # noqa: E501 + + :return: The id of this Exchange. # noqa: E501 + :rtype: float + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Exchange. + + ID of the exchange # noqa: E501 + + :param id: The id of this Exchange. # noqa: E501 + :type: float + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type(self): + """Gets the type of this Exchange. # noqa: E501 + + The type of exchange this is.
- TRF = Trade Reporting Facility
- exchange = Reporting exchange on the tape # noqa: E501 + + :return: The type of this Exchange. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Exchange. + + The type of exchange this is.
- TRF = Trade Reporting Facility
- exchange = Reporting exchange on the tape # noqa: E501 + + :param type: The type of this Exchange. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["TRF", "exchange"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def market(self): + """Gets the market of this Exchange. # noqa: E501 + + Market data type this exchange contains # noqa: E501 + + :return: The market of this Exchange. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this Exchange. + + Market data type this exchange contains # noqa: E501 + + :param market: The market of this Exchange. # noqa: E501 + :type: str + """ + if market is None: + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + allowed_values = ["equities", "indecies"] # noqa: E501 + if market not in allowed_values: + raise ValueError( + "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 + .format(market, allowed_values) + ) + + self._market = market + + @property + def mic(self): + """Gets the mic of this Exchange. # noqa: E501 + + Market Identification Code # noqa: E501 + + :return: The mic of this Exchange. # noqa: E501 + :rtype: str + """ + return self._mic + + @mic.setter + def mic(self, mic): + """Sets the mic of this Exchange. + + Market Identification Code # noqa: E501 + + :param mic: The mic of this Exchange. # noqa: E501 + :type: str + """ + if mic is None: + raise ValueError("Invalid value for `mic`, must not be `None`") # noqa: E501 + + self._mic = mic + + @property + def name(self): + """Gets the name of this Exchange. # noqa: E501 + + Name of the exchange # noqa: E501 + + :return: The name of this Exchange. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Exchange. + + Name of the exchange # noqa: E501 + + :param name: The name of this Exchange. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def tape(self): + """Gets the tape of this Exchange. # noqa: E501 + + Tape id of the exchange # noqa: E501 + + :return: The tape of this Exchange. # noqa: E501 + :rtype: str + """ + return self._tape + + @tape.setter + def tape(self, tape): + """Sets the tape of this Exchange. + + Tape id of the exchange # noqa: E501 + + :param tape: The tape of this Exchange. # noqa: E501 + :type: str + """ + if tape is None: + raise ValueError("Invalid value for `tape`, must not be `None`") # noqa: E501 + + self._tape = tape + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Exchange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Exchange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/financial.py b/polygon/rest/models/financial.py new file mode 100644 index 00000000..b16279b2 --- /dev/null +++ b/polygon/rest/models/financial.py @@ -0,0 +1,666 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Financial(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbol': 'str', + 'report_date': 'datetime', + 'report_date_str': 'str', + 'gross_profit': 'float', + 'cost_of_revenue': 'float', + 'operating_revenue': 'float', + 'total_revenue': 'float', + 'operating_income': 'float', + 'net_income': 'float', + 'research_and_development': 'float', + 'operating_expense': 'float', + 'current_assets': 'float', + 'total_assets': 'float', + 'total_liabilities': 'float', + 'current_cash': 'float', + 'current_debt': 'float', + 'total_cash': 'float', + 'total_debt': 'float', + 'shareholder_equity': 'float', + 'cash_change': 'float', + 'cash_flow': 'float', + 'operating_gains_losses': 'float' + } + + attribute_map = { + 'symbol': 'symbol', + 'report_date': 'reportDate', + 'report_date_str': 'reportDateStr', + 'gross_profit': 'grossProfit', + 'cost_of_revenue': 'costOfRevenue', + 'operating_revenue': 'operatingRevenue', + 'total_revenue': 'totalRevenue', + 'operating_income': 'operatingIncome', + 'net_income': 'netIncome', + 'research_and_development': 'researchAndDevelopment', + 'operating_expense': 'operatingExpense', + 'current_assets': 'currentAssets', + 'total_assets': 'totalAssets', + 'total_liabilities': 'totalLiabilities', + 'current_cash': 'currentCash', + 'current_debt': 'currentDebt', + 'total_cash': 'totalCash', + 'total_debt': 'totalDebt', + 'shareholder_equity': 'shareholderEquity', + 'cash_change': 'cashChange', + 'cash_flow': 'cashFlow', + 'operating_gains_losses': 'operatingGainsLosses' + } + + def __init__(self, symbol=None, report_date=None, report_date_str=None, gross_profit=None, cost_of_revenue=None, operating_revenue=None, total_revenue=None, operating_income=None, net_income=None, research_and_development=None, operating_expense=None, current_assets=None, total_assets=None, total_liabilities=None, current_cash=None, current_debt=None, total_cash=None, total_debt=None, shareholder_equity=None, cash_change=None, cash_flow=None, operating_gains_losses=None): # noqa: E501 + """Financial - a model defined in Swagger""" # noqa: E501 + self._symbol = None + self._report_date = None + self._report_date_str = None + self._gross_profit = None + self._cost_of_revenue = None + self._operating_revenue = None + self._total_revenue = None + self._operating_income = None + self._net_income = None + self._research_and_development = None + self._operating_expense = None + self._current_assets = None + self._total_assets = None + self._total_liabilities = None + self._current_cash = None + self._current_debt = None + self._total_cash = None + self._total_debt = None + self._shareholder_equity = None + self._cash_change = None + self._cash_flow = None + self._operating_gains_losses = None + self.discriminator = None + self.symbol = symbol + self.report_date = report_date + self.report_date_str = report_date_str + if gross_profit is not None: + self.gross_profit = gross_profit + if cost_of_revenue is not None: + self.cost_of_revenue = cost_of_revenue + if operating_revenue is not None: + self.operating_revenue = operating_revenue + if total_revenue is not None: + self.total_revenue = total_revenue + if operating_income is not None: + self.operating_income = operating_income + if net_income is not None: + self.net_income = net_income + if research_and_development is not None: + self.research_and_development = research_and_development + if operating_expense is not None: + self.operating_expense = operating_expense + if current_assets is not None: + self.current_assets = current_assets + if total_assets is not None: + self.total_assets = total_assets + if total_liabilities is not None: + self.total_liabilities = total_liabilities + if current_cash is not None: + self.current_cash = current_cash + if current_debt is not None: + self.current_debt = current_debt + if total_cash is not None: + self.total_cash = total_cash + if total_debt is not None: + self.total_debt = total_debt + if shareholder_equity is not None: + self.shareholder_equity = shareholder_equity + if cash_change is not None: + self.cash_change = cash_change + if cash_flow is not None: + self.cash_flow = cash_flow + if operating_gains_losses is not None: + self.operating_gains_losses = operating_gains_losses + + @property + def symbol(self): + """Gets the symbol of this Financial. # noqa: E501 + + Stock Symbol # noqa: E501 + + :return: The symbol of this Financial. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Financial. + + Stock Symbol # noqa: E501 + + :param symbol: The symbol of this Financial. # noqa: E501 + :type: str + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def report_date(self): + """Gets the report_date of this Financial. # noqa: E501 + + Report Date # noqa: E501 + + :return: The report_date of this Financial. # noqa: E501 + :rtype: datetime + """ + return self._report_date + + @report_date.setter + def report_date(self, report_date): + """Sets the report_date of this Financial. + + Report Date # noqa: E501 + + :param report_date: The report_date of this Financial. # noqa: E501 + :type: datetime + """ + if report_date is None: + raise ValueError("Invalid value for `report_date`, must not be `None`") # noqa: E501 + + self._report_date = report_date + + @property + def report_date_str(self): + """Gets the report_date_str of this Financial. # noqa: E501 + + Report date as non date format # noqa: E501 + + :return: The report_date_str of this Financial. # noqa: E501 + :rtype: str + """ + return self._report_date_str + + @report_date_str.setter + def report_date_str(self, report_date_str): + """Sets the report_date_str of this Financial. + + Report date as non date format # noqa: E501 + + :param report_date_str: The report_date_str of this Financial. # noqa: E501 + :type: str + """ + if report_date_str is None: + raise ValueError("Invalid value for `report_date_str`, must not be `None`") # noqa: E501 + + self._report_date_str = report_date_str + + @property + def gross_profit(self): + """Gets the gross_profit of this Financial. # noqa: E501 + + + :return: The gross_profit of this Financial. # noqa: E501 + :rtype: float + """ + return self._gross_profit + + @gross_profit.setter + def gross_profit(self, gross_profit): + """Sets the gross_profit of this Financial. + + + :param gross_profit: The gross_profit of this Financial. # noqa: E501 + :type: float + """ + + self._gross_profit = gross_profit + + @property + def cost_of_revenue(self): + """Gets the cost_of_revenue of this Financial. # noqa: E501 + + + :return: The cost_of_revenue of this Financial. # noqa: E501 + :rtype: float + """ + return self._cost_of_revenue + + @cost_of_revenue.setter + def cost_of_revenue(self, cost_of_revenue): + """Sets the cost_of_revenue of this Financial. + + + :param cost_of_revenue: The cost_of_revenue of this Financial. # noqa: E501 + :type: float + """ + + self._cost_of_revenue = cost_of_revenue + + @property + def operating_revenue(self): + """Gets the operating_revenue of this Financial. # noqa: E501 + + + :return: The operating_revenue of this Financial. # noqa: E501 + :rtype: float + """ + return self._operating_revenue + + @operating_revenue.setter + def operating_revenue(self, operating_revenue): + """Sets the operating_revenue of this Financial. + + + :param operating_revenue: The operating_revenue of this Financial. # noqa: E501 + :type: float + """ + + self._operating_revenue = operating_revenue + + @property + def total_revenue(self): + """Gets the total_revenue of this Financial. # noqa: E501 + + + :return: The total_revenue of this Financial. # noqa: E501 + :rtype: float + """ + return self._total_revenue + + @total_revenue.setter + def total_revenue(self, total_revenue): + """Sets the total_revenue of this Financial. + + + :param total_revenue: The total_revenue of this Financial. # noqa: E501 + :type: float + """ + + self._total_revenue = total_revenue + + @property + def operating_income(self): + """Gets the operating_income of this Financial. # noqa: E501 + + + :return: The operating_income of this Financial. # noqa: E501 + :rtype: float + """ + return self._operating_income + + @operating_income.setter + def operating_income(self, operating_income): + """Sets the operating_income of this Financial. + + + :param operating_income: The operating_income of this Financial. # noqa: E501 + :type: float + """ + + self._operating_income = operating_income + + @property + def net_income(self): + """Gets the net_income of this Financial. # noqa: E501 + + + :return: The net_income of this Financial. # noqa: E501 + :rtype: float + """ + return self._net_income + + @net_income.setter + def net_income(self, net_income): + """Sets the net_income of this Financial. + + + :param net_income: The net_income of this Financial. # noqa: E501 + :type: float + """ + + self._net_income = net_income + + @property + def research_and_development(self): + """Gets the research_and_development of this Financial. # noqa: E501 + + + :return: The research_and_development of this Financial. # noqa: E501 + :rtype: float + """ + return self._research_and_development + + @research_and_development.setter + def research_and_development(self, research_and_development): + """Sets the research_and_development of this Financial. + + + :param research_and_development: The research_and_development of this Financial. # noqa: E501 + :type: float + """ + + self._research_and_development = research_and_development + + @property + def operating_expense(self): + """Gets the operating_expense of this Financial. # noqa: E501 + + + :return: The operating_expense of this Financial. # noqa: E501 + :rtype: float + """ + return self._operating_expense + + @operating_expense.setter + def operating_expense(self, operating_expense): + """Sets the operating_expense of this Financial. + + + :param operating_expense: The operating_expense of this Financial. # noqa: E501 + :type: float + """ + + self._operating_expense = operating_expense + + @property + def current_assets(self): + """Gets the current_assets of this Financial. # noqa: E501 + + + :return: The current_assets of this Financial. # noqa: E501 + :rtype: float + """ + return self._current_assets + + @current_assets.setter + def current_assets(self, current_assets): + """Sets the current_assets of this Financial. + + + :param current_assets: The current_assets of this Financial. # noqa: E501 + :type: float + """ + + self._current_assets = current_assets + + @property + def total_assets(self): + """Gets the total_assets of this Financial. # noqa: E501 + + + :return: The total_assets of this Financial. # noqa: E501 + :rtype: float + """ + return self._total_assets + + @total_assets.setter + def total_assets(self, total_assets): + """Sets the total_assets of this Financial. + + + :param total_assets: The total_assets of this Financial. # noqa: E501 + :type: float + """ + + self._total_assets = total_assets + + @property + def total_liabilities(self): + """Gets the total_liabilities of this Financial. # noqa: E501 + + + :return: The total_liabilities of this Financial. # noqa: E501 + :rtype: float + """ + return self._total_liabilities + + @total_liabilities.setter + def total_liabilities(self, total_liabilities): + """Sets the total_liabilities of this Financial. + + + :param total_liabilities: The total_liabilities of this Financial. # noqa: E501 + :type: float + """ + + self._total_liabilities = total_liabilities + + @property + def current_cash(self): + """Gets the current_cash of this Financial. # noqa: E501 + + + :return: The current_cash of this Financial. # noqa: E501 + :rtype: float + """ + return self._current_cash + + @current_cash.setter + def current_cash(self, current_cash): + """Sets the current_cash of this Financial. + + + :param current_cash: The current_cash of this Financial. # noqa: E501 + :type: float + """ + + self._current_cash = current_cash + + @property + def current_debt(self): + """Gets the current_debt of this Financial. # noqa: E501 + + + :return: The current_debt of this Financial. # noqa: E501 + :rtype: float + """ + return self._current_debt + + @current_debt.setter + def current_debt(self, current_debt): + """Sets the current_debt of this Financial. + + + :param current_debt: The current_debt of this Financial. # noqa: E501 + :type: float + """ + + self._current_debt = current_debt + + @property + def total_cash(self): + """Gets the total_cash of this Financial. # noqa: E501 + + + :return: The total_cash of this Financial. # noqa: E501 + :rtype: float + """ + return self._total_cash + + @total_cash.setter + def total_cash(self, total_cash): + """Sets the total_cash of this Financial. + + + :param total_cash: The total_cash of this Financial. # noqa: E501 + :type: float + """ + + self._total_cash = total_cash + + @property + def total_debt(self): + """Gets the total_debt of this Financial. # noqa: E501 + + + :return: The total_debt of this Financial. # noqa: E501 + :rtype: float + """ + return self._total_debt + + @total_debt.setter + def total_debt(self, total_debt): + """Sets the total_debt of this Financial. + + + :param total_debt: The total_debt of this Financial. # noqa: E501 + :type: float + """ + + self._total_debt = total_debt + + @property + def shareholder_equity(self): + """Gets the shareholder_equity of this Financial. # noqa: E501 + + + :return: The shareholder_equity of this Financial. # noqa: E501 + :rtype: float + """ + return self._shareholder_equity + + @shareholder_equity.setter + def shareholder_equity(self, shareholder_equity): + """Sets the shareholder_equity of this Financial. + + + :param shareholder_equity: The shareholder_equity of this Financial. # noqa: E501 + :type: float + """ + + self._shareholder_equity = shareholder_equity + + @property + def cash_change(self): + """Gets the cash_change of this Financial. # noqa: E501 + + + :return: The cash_change of this Financial. # noqa: E501 + :rtype: float + """ + return self._cash_change + + @cash_change.setter + def cash_change(self, cash_change): + """Sets the cash_change of this Financial. + + + :param cash_change: The cash_change of this Financial. # noqa: E501 + :type: float + """ + + self._cash_change = cash_change + + @property + def cash_flow(self): + """Gets the cash_flow of this Financial. # noqa: E501 + + + :return: The cash_flow of this Financial. # noqa: E501 + :rtype: float + """ + return self._cash_flow + + @cash_flow.setter + def cash_flow(self, cash_flow): + """Sets the cash_flow of this Financial. + + + :param cash_flow: The cash_flow of this Financial. # noqa: E501 + :type: float + """ + + self._cash_flow = cash_flow + + @property + def operating_gains_losses(self): + """Gets the operating_gains_losses of this Financial. # noqa: E501 + + + :return: The operating_gains_losses of this Financial. # noqa: E501 + :rtype: float + """ + return self._operating_gains_losses + + @operating_gains_losses.setter + def operating_gains_losses(self, operating_gains_losses): + """Sets the operating_gains_losses of this Financial. + + + :param operating_gains_losses: The operating_gains_losses of this Financial. # noqa: E501 + :type: float + """ + + self._operating_gains_losses = operating_gains_losses + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Financial, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Financial): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/financials.py b/polygon/rest/models/financials.py new file mode 100644 index 00000000..be7c53c1 --- /dev/null +++ b/polygon/rest/models/financials.py @@ -0,0 +1,2954 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Financials(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'TickerSymbol', + 'period': 'str', + 'calendar_date': 'datetime', + 'report_period': 'datetime', + 'updated': 'datetime', + 'accumulated_other_comprehensive_income': 'int', + 'assets': 'int', + 'assets_average': 'int', + 'assets_current': 'int', + 'asset_turnover': 'int', + 'assets_non_current': 'int', + 'book_value_per_share': 'int', + 'capital_expenditure': 'int', + 'cash_and_equivalents': 'int', + 'cash_and_equivalents_usd': 'int', + 'cost_of_revenue': 'int', + 'consolidated_income': 'int', + 'current_ratio': 'int', + 'debt_to_equity_ratio': 'int', + 'debt': 'int', + 'debt_current': 'int', + 'debt_non_current': 'int', + 'debt_usd': 'int', + 'deferred_revenue': 'int', + 'depreciation_amortization_and_accretion': 'int', + 'deposits': 'int', + 'dividend_yield': 'int', + 'dividends_per_basic_common_share': 'int', + 'earning_before_interest_taxes': 'int', + 'earnings_before_interest_taxes_depreciation_amortization': 'int', + 'ebitda_margin': 'int', + 'earnings_before_interest_taxes_depreciation_amortization_usd': 'int', + 'earning_before_interest_taxes_usd': 'int', + 'earnings_before_tax': 'int', + 'earnings_per_basic_share': 'int', + 'earnings_per_diluted_share': 'int', + 'earnings_per_basic_share_usd': 'int', + 'shareholders_equity': 'int', + 'average_equity': 'int', + 'shareholders_equity_usd': 'int', + 'enterprise_value': 'int', + 'enterprise_value_over_ebit': 'int', + 'enterprise_value_over_ebitda': 'int', + 'free_cash_flow': 'int', + 'free_cash_flow_per_share': 'int', + 'foreign_currency_usd_exchange_rate': 'int', + 'gross_profit': 'int', + 'gross_margin': 'int', + 'goodwill_and_intangible_assets': 'int', + 'interest_expense': 'int', + 'invested_capital': 'int', + 'invested_capital_average': 'int', + 'inventory': 'int', + 'investments': 'int', + 'investments_current': 'int', + 'investments_non_current': 'int', + 'total_liabilities': 'int', + 'current_liabilities': 'int', + 'liabilities_non_current': 'int', + 'market_capitalization': 'int', + 'net_cash_flow': 'int', + 'net_cash_flow_business_acquisitions_disposals': 'int', + 'issuance_equity_shares': 'int', + 'issuance_debt_securities': 'int', + 'payment_dividends_other_cash_distributions': 'int', + 'net_cash_flow_from_financing': 'int', + 'net_cash_flow_from_investing': 'int', + 'net_cash_flow_investment_acquisitions_disposals': 'int', + 'net_cash_flow_from_operations': 'int', + 'effect_of_exchange_rate_changes_on_cash': 'int', + 'net_income': 'int', + 'net_income_common_stock': 'int', + 'net_income_common_stock_usd': 'int', + 'net_loss_income_from_discontinued_operations': 'int', + 'net_income_to_non_controlling_interests': 'int', + 'profit_margin': 'int', + 'operating_expenses': 'int', + 'operating_income': 'int', + 'trade_and_non_trade_payables': 'int', + 'payout_ratio': 'int', + 'price_to_book_value': 'int', + 'price_earnings': 'int', + 'price_to_earnings_ratio': 'int', + 'property_plant_equipment_net': 'int', + 'preferred_dividends_income_statement_impact': 'int', + 'share_price_adjusted_close': 'int', + 'price_sales': 'int', + 'price_to_sales_ratio': 'int', + 'trade_and_non_trade_receivables': 'int', + 'accumulated_retained_earnings_deficit': 'int', + 'revenues': 'int', + 'revenues_usd': 'int', + 'research_and_development_expense': 'int', + 'return_on_average_assets': 'int', + 'return_on_average_equity': 'int', + 'return_on_invested_capital': 'int', + 'return_on_sales': 'int', + 'share_based_compensation': 'int', + 'selling_general_and_administrative_expense': 'int', + 'share_factor': 'int', + 'shares': 'int', + 'weighted_average_shares': 'int', + 'weighted_average_shares_diluted': 'int', + 'sales_per_share': 'int', + 'tangible_asset_value': 'int', + 'tax_assets': 'int', + 'income_tax_expense': 'int', + 'tax_liabilities': 'int', + 'tangible_assets_book_value_per_share': 'int', + 'working_capital': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'period': 'period', + 'calendar_date': 'calendarDate', + 'report_period': 'reportPeriod', + 'updated': 'updated', + 'accumulated_other_comprehensive_income': 'accumulatedOtherComprehensiveIncome', + 'assets': 'assets', + 'assets_average': 'assetsAverage', + 'assets_current': 'assetsCurrent', + 'asset_turnover': 'assetTurnover', + 'assets_non_current': 'assetsNonCurrent', + 'book_value_per_share': 'bookValuePerShare', + 'capital_expenditure': 'capitalExpenditure', + 'cash_and_equivalents': 'cashAndEquivalents', + 'cash_and_equivalents_usd': 'cashAndEquivalentsUSD', + 'cost_of_revenue': 'costOfRevenue', + 'consolidated_income': 'consolidatedIncome', + 'current_ratio': 'currentRatio', + 'debt_to_equity_ratio': 'debtToEquityRatio', + 'debt': 'debt', + 'debt_current': 'debtCurrent', + 'debt_non_current': 'debtNonCurrent', + 'debt_usd': 'debtUSD', + 'deferred_revenue': 'deferredRevenue', + 'depreciation_amortization_and_accretion': 'depreciationAmortizationAndAccretion', + 'deposits': 'deposits', + 'dividend_yield': 'dividendYield', + 'dividends_per_basic_common_share': 'dividendsPerBasicCommonShare', + 'earning_before_interest_taxes': 'earningBeforeInterestTaxes', + 'earnings_before_interest_taxes_depreciation_amortization': 'earningsBeforeInterestTaxesDepreciationAmortization', + 'ebitda_margin': 'EBITDAMargin', + 'earnings_before_interest_taxes_depreciation_amortization_usd': 'earningsBeforeInterestTaxesDepreciationAmortizationUSD', + 'earning_before_interest_taxes_usd': 'earningBeforeInterestTaxesUSD', + 'earnings_before_tax': 'earningsBeforeTax', + 'earnings_per_basic_share': 'earningsPerBasicShare', + 'earnings_per_diluted_share': 'earningsPerDilutedShare', + 'earnings_per_basic_share_usd': 'earningsPerBasicShareUSD', + 'shareholders_equity': 'shareholdersEquity', + 'average_equity': 'averageEquity', + 'shareholders_equity_usd': 'shareholdersEquityUSD', + 'enterprise_value': 'enterpriseValue', + 'enterprise_value_over_ebit': 'enterpriseValueOverEBIT', + 'enterprise_value_over_ebitda': 'enterpriseValueOverEBITDA', + 'free_cash_flow': 'freeCashFlow', + 'free_cash_flow_per_share': 'freeCashFlowPerShare', + 'foreign_currency_usd_exchange_rate': 'foreignCurrencyUSDExchangeRate', + 'gross_profit': 'grossProfit', + 'gross_margin': 'grossMargin', + 'goodwill_and_intangible_assets': 'goodwillAndIntangibleAssets', + 'interest_expense': 'interestExpense', + 'invested_capital': 'investedCapital', + 'invested_capital_average': 'investedCapitalAverage', + 'inventory': 'inventory', + 'investments': 'investments', + 'investments_current': 'investmentsCurrent', + 'investments_non_current': 'investmentsNonCurrent', + 'total_liabilities': 'totalLiabilities', + 'current_liabilities': 'currentLiabilities', + 'liabilities_non_current': 'liabilitiesNonCurrent', + 'market_capitalization': 'marketCapitalization', + 'net_cash_flow': 'netCashFlow', + 'net_cash_flow_business_acquisitions_disposals': 'netCashFlowBusinessAcquisitionsDisposals', + 'issuance_equity_shares': 'issuanceEquityShares', + 'issuance_debt_securities': 'issuanceDebtSecurities', + 'payment_dividends_other_cash_distributions': 'paymentDividendsOtherCashDistributions', + 'net_cash_flow_from_financing': 'netCashFlowFromFinancing', + 'net_cash_flow_from_investing': 'netCashFlowFromInvesting', + 'net_cash_flow_investment_acquisitions_disposals': 'netCashFlowInvestmentAcquisitionsDisposals', + 'net_cash_flow_from_operations': 'netCashFlowFromOperations', + 'effect_of_exchange_rate_changes_on_cash': 'effectOfExchangeRateChangesOnCash', + 'net_income': 'netIncome', + 'net_income_common_stock': 'netIncomeCommonStock', + 'net_income_common_stock_usd': 'netIncomeCommonStockUSD', + 'net_loss_income_from_discontinued_operations': 'netLossIncomeFromDiscontinuedOperations', + 'net_income_to_non_controlling_interests': 'netIncomeToNonControllingInterests', + 'profit_margin': 'profitMargin', + 'operating_expenses': 'operatingExpenses', + 'operating_income': 'operatingIncome', + 'trade_and_non_trade_payables': 'tradeAndNonTradePayables', + 'payout_ratio': 'payoutRatio', + 'price_to_book_value': 'priceToBookValue', + 'price_earnings': 'priceEarnings', + 'price_to_earnings_ratio': 'priceToEarningsRatio', + 'property_plant_equipment_net': 'propertyPlantEquipmentNet', + 'preferred_dividends_income_statement_impact': 'preferredDividendsIncomeStatementImpact', + 'share_price_adjusted_close': 'sharePriceAdjustedClose', + 'price_sales': 'priceSales', + 'price_to_sales_ratio': 'priceToSalesRatio', + 'trade_and_non_trade_receivables': 'tradeAndNonTradeReceivables', + 'accumulated_retained_earnings_deficit': 'accumulatedRetainedEarningsDeficit', + 'revenues': 'revenues', + 'revenues_usd': 'revenuesUSD', + 'research_and_development_expense': 'researchAndDevelopmentExpense', + 'return_on_average_assets': 'returnOnAverageAssets', + 'return_on_average_equity': 'returnOnAverageEquity', + 'return_on_invested_capital': 'returnOnInvestedCapital', + 'return_on_sales': 'returnOnSales', + 'share_based_compensation': 'shareBasedCompensation', + 'selling_general_and_administrative_expense': 'sellingGeneralAndAdministrativeExpense', + 'share_factor': 'shareFactor', + 'shares': 'shares', + 'weighted_average_shares': 'weightedAverageShares', + 'weighted_average_shares_diluted': 'weightedAverageSharesDiluted', + 'sales_per_share': 'salesPerShare', + 'tangible_asset_value': 'tangibleAssetValue', + 'tax_assets': 'taxAssets', + 'income_tax_expense': 'incomeTaxExpense', + 'tax_liabilities': 'taxLiabilities', + 'tangible_assets_book_value_per_share': 'tangibleAssetsBookValuePerShare', + 'working_capital': 'workingCapital' + } + + def __init__(self, ticker=None, period=None, calendar_date=None, report_period=None, updated=None, accumulated_other_comprehensive_income=None, assets=None, assets_average=None, assets_current=None, asset_turnover=None, assets_non_current=None, book_value_per_share=None, capital_expenditure=None, cash_and_equivalents=None, cash_and_equivalents_usd=None, cost_of_revenue=None, consolidated_income=None, current_ratio=None, debt_to_equity_ratio=None, debt=None, debt_current=None, debt_non_current=None, debt_usd=None, deferred_revenue=None, depreciation_amortization_and_accretion=None, deposits=None, dividend_yield=None, dividends_per_basic_common_share=None, earning_before_interest_taxes=None, earnings_before_interest_taxes_depreciation_amortization=None, ebitda_margin=None, earnings_before_interest_taxes_depreciation_amortization_usd=None, earning_before_interest_taxes_usd=None, earnings_before_tax=None, earnings_per_basic_share=None, earnings_per_diluted_share=None, earnings_per_basic_share_usd=None, shareholders_equity=None, average_equity=None, shareholders_equity_usd=None, enterprise_value=None, enterprise_value_over_ebit=None, enterprise_value_over_ebitda=None, free_cash_flow=None, free_cash_flow_per_share=None, foreign_currency_usd_exchange_rate=None, gross_profit=None, gross_margin=None, goodwill_and_intangible_assets=None, interest_expense=None, invested_capital=None, invested_capital_average=None, inventory=None, investments=None, investments_current=None, investments_non_current=None, total_liabilities=None, current_liabilities=None, liabilities_non_current=None, market_capitalization=None, net_cash_flow=None, net_cash_flow_business_acquisitions_disposals=None, issuance_equity_shares=None, issuance_debt_securities=None, payment_dividends_other_cash_distributions=None, net_cash_flow_from_financing=None, net_cash_flow_from_investing=None, net_cash_flow_investment_acquisitions_disposals=None, net_cash_flow_from_operations=None, effect_of_exchange_rate_changes_on_cash=None, net_income=None, net_income_common_stock=None, net_income_common_stock_usd=None, net_loss_income_from_discontinued_operations=None, net_income_to_non_controlling_interests=None, profit_margin=None, operating_expenses=None, operating_income=None, trade_and_non_trade_payables=None, payout_ratio=None, price_to_book_value=None, price_earnings=None, price_to_earnings_ratio=None, property_plant_equipment_net=None, preferred_dividends_income_statement_impact=None, share_price_adjusted_close=None, price_sales=None, price_to_sales_ratio=None, trade_and_non_trade_receivables=None, accumulated_retained_earnings_deficit=None, revenues=None, revenues_usd=None, research_and_development_expense=None, return_on_average_assets=None, return_on_average_equity=None, return_on_invested_capital=None, return_on_sales=None, share_based_compensation=None, selling_general_and_administrative_expense=None, share_factor=None, shares=None, weighted_average_shares=None, weighted_average_shares_diluted=None, sales_per_share=None, tangible_asset_value=None, tax_assets=None, income_tax_expense=None, tax_liabilities=None, tangible_assets_book_value_per_share=None, working_capital=None): # noqa: E501 + """Financials - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._period = None + self._calendar_date = None + self._report_period = None + self._updated = None + self._accumulated_other_comprehensive_income = None + self._assets = None + self._assets_average = None + self._assets_current = None + self._asset_turnover = None + self._assets_non_current = None + self._book_value_per_share = None + self._capital_expenditure = None + self._cash_and_equivalents = None + self._cash_and_equivalents_usd = None + self._cost_of_revenue = None + self._consolidated_income = None + self._current_ratio = None + self._debt_to_equity_ratio = None + self._debt = None + self._debt_current = None + self._debt_non_current = None + self._debt_usd = None + self._deferred_revenue = None + self._depreciation_amortization_and_accretion = None + self._deposits = None + self._dividend_yield = None + self._dividends_per_basic_common_share = None + self._earning_before_interest_taxes = None + self._earnings_before_interest_taxes_depreciation_amortization = None + self._ebitda_margin = None + self._earnings_before_interest_taxes_depreciation_amortization_usd = None + self._earning_before_interest_taxes_usd = None + self._earnings_before_tax = None + self._earnings_per_basic_share = None + self._earnings_per_diluted_share = None + self._earnings_per_basic_share_usd = None + self._shareholders_equity = None + self._average_equity = None + self._shareholders_equity_usd = None + self._enterprise_value = None + self._enterprise_value_over_ebit = None + self._enterprise_value_over_ebitda = None + self._free_cash_flow = None + self._free_cash_flow_per_share = None + self._foreign_currency_usd_exchange_rate = None + self._gross_profit = None + self._gross_margin = None + self._goodwill_and_intangible_assets = None + self._interest_expense = None + self._invested_capital = None + self._invested_capital_average = None + self._inventory = None + self._investments = None + self._investments_current = None + self._investments_non_current = None + self._total_liabilities = None + self._current_liabilities = None + self._liabilities_non_current = None + self._market_capitalization = None + self._net_cash_flow = None + self._net_cash_flow_business_acquisitions_disposals = None + self._issuance_equity_shares = None + self._issuance_debt_securities = None + self._payment_dividends_other_cash_distributions = None + self._net_cash_flow_from_financing = None + self._net_cash_flow_from_investing = None + self._net_cash_flow_investment_acquisitions_disposals = None + self._net_cash_flow_from_operations = None + self._effect_of_exchange_rate_changes_on_cash = None + self._net_income = None + self._net_income_common_stock = None + self._net_income_common_stock_usd = None + self._net_loss_income_from_discontinued_operations = None + self._net_income_to_non_controlling_interests = None + self._profit_margin = None + self._operating_expenses = None + self._operating_income = None + self._trade_and_non_trade_payables = None + self._payout_ratio = None + self._price_to_book_value = None + self._price_earnings = None + self._price_to_earnings_ratio = None + self._property_plant_equipment_net = None + self._preferred_dividends_income_statement_impact = None + self._share_price_adjusted_close = None + self._price_sales = None + self._price_to_sales_ratio = None + self._trade_and_non_trade_receivables = None + self._accumulated_retained_earnings_deficit = None + self._revenues = None + self._revenues_usd = None + self._research_and_development_expense = None + self._return_on_average_assets = None + self._return_on_average_equity = None + self._return_on_invested_capital = None + self._return_on_sales = None + self._share_based_compensation = None + self._selling_general_and_administrative_expense = None + self._share_factor = None + self._shares = None + self._weighted_average_shares = None + self._weighted_average_shares_diluted = None + self._sales_per_share = None + self._tangible_asset_value = None + self._tax_assets = None + self._income_tax_expense = None + self._tax_liabilities = None + self._tangible_assets_book_value_per_share = None + self._working_capital = None + self.discriminator = None + self.ticker = ticker + if period is not None: + self.period = period + if calendar_date is not None: + self.calendar_date = calendar_date + if report_period is not None: + self.report_period = report_period + if updated is not None: + self.updated = updated + if accumulated_other_comprehensive_income is not None: + self.accumulated_other_comprehensive_income = accumulated_other_comprehensive_income + if assets is not None: + self.assets = assets + if assets_average is not None: + self.assets_average = assets_average + if assets_current is not None: + self.assets_current = assets_current + if asset_turnover is not None: + self.asset_turnover = asset_turnover + if assets_non_current is not None: + self.assets_non_current = assets_non_current + if book_value_per_share is not None: + self.book_value_per_share = book_value_per_share + if capital_expenditure is not None: + self.capital_expenditure = capital_expenditure + if cash_and_equivalents is not None: + self.cash_and_equivalents = cash_and_equivalents + if cash_and_equivalents_usd is not None: + self.cash_and_equivalents_usd = cash_and_equivalents_usd + if cost_of_revenue is not None: + self.cost_of_revenue = cost_of_revenue + if consolidated_income is not None: + self.consolidated_income = consolidated_income + if current_ratio is not None: + self.current_ratio = current_ratio + if debt_to_equity_ratio is not None: + self.debt_to_equity_ratio = debt_to_equity_ratio + if debt is not None: + self.debt = debt + if debt_current is not None: + self.debt_current = debt_current + if debt_non_current is not None: + self.debt_non_current = debt_non_current + if debt_usd is not None: + self.debt_usd = debt_usd + if deferred_revenue is not None: + self.deferred_revenue = deferred_revenue + if depreciation_amortization_and_accretion is not None: + self.depreciation_amortization_and_accretion = depreciation_amortization_and_accretion + if deposits is not None: + self.deposits = deposits + if dividend_yield is not None: + self.dividend_yield = dividend_yield + if dividends_per_basic_common_share is not None: + self.dividends_per_basic_common_share = dividends_per_basic_common_share + if earning_before_interest_taxes is not None: + self.earning_before_interest_taxes = earning_before_interest_taxes + if earnings_before_interest_taxes_depreciation_amortization is not None: + self.earnings_before_interest_taxes_depreciation_amortization = earnings_before_interest_taxes_depreciation_amortization + if ebitda_margin is not None: + self.ebitda_margin = ebitda_margin + if earnings_before_interest_taxes_depreciation_amortization_usd is not None: + self.earnings_before_interest_taxes_depreciation_amortization_usd = earnings_before_interest_taxes_depreciation_amortization_usd + if earning_before_interest_taxes_usd is not None: + self.earning_before_interest_taxes_usd = earning_before_interest_taxes_usd + if earnings_before_tax is not None: + self.earnings_before_tax = earnings_before_tax + if earnings_per_basic_share is not None: + self.earnings_per_basic_share = earnings_per_basic_share + if earnings_per_diluted_share is not None: + self.earnings_per_diluted_share = earnings_per_diluted_share + if earnings_per_basic_share_usd is not None: + self.earnings_per_basic_share_usd = earnings_per_basic_share_usd + if shareholders_equity is not None: + self.shareholders_equity = shareholders_equity + if average_equity is not None: + self.average_equity = average_equity + if shareholders_equity_usd is not None: + self.shareholders_equity_usd = shareholders_equity_usd + if enterprise_value is not None: + self.enterprise_value = enterprise_value + if enterprise_value_over_ebit is not None: + self.enterprise_value_over_ebit = enterprise_value_over_ebit + if enterprise_value_over_ebitda is not None: + self.enterprise_value_over_ebitda = enterprise_value_over_ebitda + if free_cash_flow is not None: + self.free_cash_flow = free_cash_flow + if free_cash_flow_per_share is not None: + self.free_cash_flow_per_share = free_cash_flow_per_share + if foreign_currency_usd_exchange_rate is not None: + self.foreign_currency_usd_exchange_rate = foreign_currency_usd_exchange_rate + if gross_profit is not None: + self.gross_profit = gross_profit + if gross_margin is not None: + self.gross_margin = gross_margin + if goodwill_and_intangible_assets is not None: + self.goodwill_and_intangible_assets = goodwill_and_intangible_assets + if interest_expense is not None: + self.interest_expense = interest_expense + if invested_capital is not None: + self.invested_capital = invested_capital + if invested_capital_average is not None: + self.invested_capital_average = invested_capital_average + if inventory is not None: + self.inventory = inventory + if investments is not None: + self.investments = investments + if investments_current is not None: + self.investments_current = investments_current + if investments_non_current is not None: + self.investments_non_current = investments_non_current + if total_liabilities is not None: + self.total_liabilities = total_liabilities + if current_liabilities is not None: + self.current_liabilities = current_liabilities + if liabilities_non_current is not None: + self.liabilities_non_current = liabilities_non_current + if market_capitalization is not None: + self.market_capitalization = market_capitalization + if net_cash_flow is not None: + self.net_cash_flow = net_cash_flow + if net_cash_flow_business_acquisitions_disposals is not None: + self.net_cash_flow_business_acquisitions_disposals = net_cash_flow_business_acquisitions_disposals + if issuance_equity_shares is not None: + self.issuance_equity_shares = issuance_equity_shares + if issuance_debt_securities is not None: + self.issuance_debt_securities = issuance_debt_securities + if payment_dividends_other_cash_distributions is not None: + self.payment_dividends_other_cash_distributions = payment_dividends_other_cash_distributions + if net_cash_flow_from_financing is not None: + self.net_cash_flow_from_financing = net_cash_flow_from_financing + if net_cash_flow_from_investing is not None: + self.net_cash_flow_from_investing = net_cash_flow_from_investing + if net_cash_flow_investment_acquisitions_disposals is not None: + self.net_cash_flow_investment_acquisitions_disposals = net_cash_flow_investment_acquisitions_disposals + if net_cash_flow_from_operations is not None: + self.net_cash_flow_from_operations = net_cash_flow_from_operations + if effect_of_exchange_rate_changes_on_cash is not None: + self.effect_of_exchange_rate_changes_on_cash = effect_of_exchange_rate_changes_on_cash + if net_income is not None: + self.net_income = net_income + if net_income_common_stock is not None: + self.net_income_common_stock = net_income_common_stock + if net_income_common_stock_usd is not None: + self.net_income_common_stock_usd = net_income_common_stock_usd + if net_loss_income_from_discontinued_operations is not None: + self.net_loss_income_from_discontinued_operations = net_loss_income_from_discontinued_operations + if net_income_to_non_controlling_interests is not None: + self.net_income_to_non_controlling_interests = net_income_to_non_controlling_interests + if profit_margin is not None: + self.profit_margin = profit_margin + if operating_expenses is not None: + self.operating_expenses = operating_expenses + if operating_income is not None: + self.operating_income = operating_income + if trade_and_non_trade_payables is not None: + self.trade_and_non_trade_payables = trade_and_non_trade_payables + if payout_ratio is not None: + self.payout_ratio = payout_ratio + if price_to_book_value is not None: + self.price_to_book_value = price_to_book_value + if price_earnings is not None: + self.price_earnings = price_earnings + if price_to_earnings_ratio is not None: + self.price_to_earnings_ratio = price_to_earnings_ratio + if property_plant_equipment_net is not None: + self.property_plant_equipment_net = property_plant_equipment_net + if preferred_dividends_income_statement_impact is not None: + self.preferred_dividends_income_statement_impact = preferred_dividends_income_statement_impact + if share_price_adjusted_close is not None: + self.share_price_adjusted_close = share_price_adjusted_close + if price_sales is not None: + self.price_sales = price_sales + if price_to_sales_ratio is not None: + self.price_to_sales_ratio = price_to_sales_ratio + if trade_and_non_trade_receivables is not None: + self.trade_and_non_trade_receivables = trade_and_non_trade_receivables + if accumulated_retained_earnings_deficit is not None: + self.accumulated_retained_earnings_deficit = accumulated_retained_earnings_deficit + if revenues is not None: + self.revenues = revenues + if revenues_usd is not None: + self.revenues_usd = revenues_usd + if research_and_development_expense is not None: + self.research_and_development_expense = research_and_development_expense + if return_on_average_assets is not None: + self.return_on_average_assets = return_on_average_assets + if return_on_average_equity is not None: + self.return_on_average_equity = return_on_average_equity + if return_on_invested_capital is not None: + self.return_on_invested_capital = return_on_invested_capital + if return_on_sales is not None: + self.return_on_sales = return_on_sales + if share_based_compensation is not None: + self.share_based_compensation = share_based_compensation + if selling_general_and_administrative_expense is not None: + self.selling_general_and_administrative_expense = selling_general_and_administrative_expense + if share_factor is not None: + self.share_factor = share_factor + if shares is not None: + self.shares = shares + if weighted_average_shares is not None: + self.weighted_average_shares = weighted_average_shares + if weighted_average_shares_diluted is not None: + self.weighted_average_shares_diluted = weighted_average_shares_diluted + if sales_per_share is not None: + self.sales_per_share = sales_per_share + if tangible_asset_value is not None: + self.tangible_asset_value = tangible_asset_value + if tax_assets is not None: + self.tax_assets = tax_assets + if income_tax_expense is not None: + self.income_tax_expense = income_tax_expense + if tax_liabilities is not None: + self.tax_liabilities = tax_liabilities + if tangible_assets_book_value_per_share is not None: + self.tangible_assets_book_value_per_share = tangible_assets_book_value_per_share + if working_capital is not None: + self.working_capital = working_capital + + @property + def ticker(self): + """Gets the ticker of this Financials. # noqa: E501 + + + :return: The ticker of this Financials. # noqa: E501 + :rtype: TickerSymbol + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this Financials. + + + :param ticker: The ticker of this Financials. # noqa: E501 + :type: TickerSymbol + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def period(self): + """Gets the period of this Financials. # noqa: E501 + + Reporting period. # noqa: E501 + + :return: The period of this Financials. # noqa: E501 + :rtype: str + """ + return self._period + + @period.setter + def period(self, period): + """Sets the period of this Financials. + + Reporting period. # noqa: E501 + + :param period: The period of this Financials. # noqa: E501 + :type: str + """ + allowed_values = ["Q", "T", "QA", "TA", "Y", "YA"] # noqa: E501 + if period not in allowed_values: + raise ValueError( + "Invalid value for `period` ({0}), must be one of {1}" # noqa: E501 + .format(period, allowed_values) + ) + + self._period = period + + @property + def calendar_date(self): + """Gets the calendar_date of this Financials. # noqa: E501 + + + :return: The calendar_date of this Financials. # noqa: E501 + :rtype: datetime + """ + return self._calendar_date + + @calendar_date.setter + def calendar_date(self, calendar_date): + """Sets the calendar_date of this Financials. + + + :param calendar_date: The calendar_date of this Financials. # noqa: E501 + :type: datetime + """ + + self._calendar_date = calendar_date + + @property + def report_period(self): + """Gets the report_period of this Financials. # noqa: E501 + + + :return: The report_period of this Financials. # noqa: E501 + :rtype: datetime + """ + return self._report_period + + @report_period.setter + def report_period(self, report_period): + """Sets the report_period of this Financials. + + + :param report_period: The report_period of this Financials. # noqa: E501 + :type: datetime + """ + + self._report_period = report_period + + @property + def updated(self): + """Gets the updated of this Financials. # noqa: E501 + + + :return: The updated of this Financials. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Financials. + + + :param updated: The updated of this Financials. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def accumulated_other_comprehensive_income(self): + """Gets the accumulated_other_comprehensive_income of this Financials. # noqa: E501 + + + :return: The accumulated_other_comprehensive_income of this Financials. # noqa: E501 + :rtype: int + """ + return self._accumulated_other_comprehensive_income + + @accumulated_other_comprehensive_income.setter + def accumulated_other_comprehensive_income(self, accumulated_other_comprehensive_income): + """Sets the accumulated_other_comprehensive_income of this Financials. + + + :param accumulated_other_comprehensive_income: The accumulated_other_comprehensive_income of this Financials. # noqa: E501 + :type: int + """ + + self._accumulated_other_comprehensive_income = accumulated_other_comprehensive_income + + @property + def assets(self): + """Gets the assets of this Financials. # noqa: E501 + + + :return: The assets of this Financials. # noqa: E501 + :rtype: int + """ + return self._assets + + @assets.setter + def assets(self, assets): + """Sets the assets of this Financials. + + + :param assets: The assets of this Financials. # noqa: E501 + :type: int + """ + + self._assets = assets + + @property + def assets_average(self): + """Gets the assets_average of this Financials. # noqa: E501 + + + :return: The assets_average of this Financials. # noqa: E501 + :rtype: int + """ + return self._assets_average + + @assets_average.setter + def assets_average(self, assets_average): + """Sets the assets_average of this Financials. + + + :param assets_average: The assets_average of this Financials. # noqa: E501 + :type: int + """ + + self._assets_average = assets_average + + @property + def assets_current(self): + """Gets the assets_current of this Financials. # noqa: E501 + + + :return: The assets_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._assets_current + + @assets_current.setter + def assets_current(self, assets_current): + """Sets the assets_current of this Financials. + + + :param assets_current: The assets_current of this Financials. # noqa: E501 + :type: int + """ + + self._assets_current = assets_current + + @property + def asset_turnover(self): + """Gets the asset_turnover of this Financials. # noqa: E501 + + + :return: The asset_turnover of this Financials. # noqa: E501 + :rtype: int + """ + return self._asset_turnover + + @asset_turnover.setter + def asset_turnover(self, asset_turnover): + """Sets the asset_turnover of this Financials. + + + :param asset_turnover: The asset_turnover of this Financials. # noqa: E501 + :type: int + """ + + self._asset_turnover = asset_turnover + + @property + def assets_non_current(self): + """Gets the assets_non_current of this Financials. # noqa: E501 + + + :return: The assets_non_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._assets_non_current + + @assets_non_current.setter + def assets_non_current(self, assets_non_current): + """Sets the assets_non_current of this Financials. + + + :param assets_non_current: The assets_non_current of this Financials. # noqa: E501 + :type: int + """ + + self._assets_non_current = assets_non_current + + @property + def book_value_per_share(self): + """Gets the book_value_per_share of this Financials. # noqa: E501 + + + :return: The book_value_per_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._book_value_per_share + + @book_value_per_share.setter + def book_value_per_share(self, book_value_per_share): + """Sets the book_value_per_share of this Financials. + + + :param book_value_per_share: The book_value_per_share of this Financials. # noqa: E501 + :type: int + """ + + self._book_value_per_share = book_value_per_share + + @property + def capital_expenditure(self): + """Gets the capital_expenditure of this Financials. # noqa: E501 + + + :return: The capital_expenditure of this Financials. # noqa: E501 + :rtype: int + """ + return self._capital_expenditure + + @capital_expenditure.setter + def capital_expenditure(self, capital_expenditure): + """Sets the capital_expenditure of this Financials. + + + :param capital_expenditure: The capital_expenditure of this Financials. # noqa: E501 + :type: int + """ + + self._capital_expenditure = capital_expenditure + + @property + def cash_and_equivalents(self): + """Gets the cash_and_equivalents of this Financials. # noqa: E501 + + + :return: The cash_and_equivalents of this Financials. # noqa: E501 + :rtype: int + """ + return self._cash_and_equivalents + + @cash_and_equivalents.setter + def cash_and_equivalents(self, cash_and_equivalents): + """Sets the cash_and_equivalents of this Financials. + + + :param cash_and_equivalents: The cash_and_equivalents of this Financials. # noqa: E501 + :type: int + """ + + self._cash_and_equivalents = cash_and_equivalents + + @property + def cash_and_equivalents_usd(self): + """Gets the cash_and_equivalents_usd of this Financials. # noqa: E501 + + + :return: The cash_and_equivalents_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._cash_and_equivalents_usd + + @cash_and_equivalents_usd.setter + def cash_and_equivalents_usd(self, cash_and_equivalents_usd): + """Sets the cash_and_equivalents_usd of this Financials. + + + :param cash_and_equivalents_usd: The cash_and_equivalents_usd of this Financials. # noqa: E501 + :type: int + """ + + self._cash_and_equivalents_usd = cash_and_equivalents_usd + + @property + def cost_of_revenue(self): + """Gets the cost_of_revenue of this Financials. # noqa: E501 + + + :return: The cost_of_revenue of this Financials. # noqa: E501 + :rtype: int + """ + return self._cost_of_revenue + + @cost_of_revenue.setter + def cost_of_revenue(self, cost_of_revenue): + """Sets the cost_of_revenue of this Financials. + + + :param cost_of_revenue: The cost_of_revenue of this Financials. # noqa: E501 + :type: int + """ + + self._cost_of_revenue = cost_of_revenue + + @property + def consolidated_income(self): + """Gets the consolidated_income of this Financials. # noqa: E501 + + + :return: The consolidated_income of this Financials. # noqa: E501 + :rtype: int + """ + return self._consolidated_income + + @consolidated_income.setter + def consolidated_income(self, consolidated_income): + """Sets the consolidated_income of this Financials. + + + :param consolidated_income: The consolidated_income of this Financials. # noqa: E501 + :type: int + """ + + self._consolidated_income = consolidated_income + + @property + def current_ratio(self): + """Gets the current_ratio of this Financials. # noqa: E501 + + + :return: The current_ratio of this Financials. # noqa: E501 + :rtype: int + """ + return self._current_ratio + + @current_ratio.setter + def current_ratio(self, current_ratio): + """Sets the current_ratio of this Financials. + + + :param current_ratio: The current_ratio of this Financials. # noqa: E501 + :type: int + """ + + self._current_ratio = current_ratio + + @property + def debt_to_equity_ratio(self): + """Gets the debt_to_equity_ratio of this Financials. # noqa: E501 + + + :return: The debt_to_equity_ratio of this Financials. # noqa: E501 + :rtype: int + """ + return self._debt_to_equity_ratio + + @debt_to_equity_ratio.setter + def debt_to_equity_ratio(self, debt_to_equity_ratio): + """Sets the debt_to_equity_ratio of this Financials. + + + :param debt_to_equity_ratio: The debt_to_equity_ratio of this Financials. # noqa: E501 + :type: int + """ + + self._debt_to_equity_ratio = debt_to_equity_ratio + + @property + def debt(self): + """Gets the debt of this Financials. # noqa: E501 + + + :return: The debt of this Financials. # noqa: E501 + :rtype: int + """ + return self._debt + + @debt.setter + def debt(self, debt): + """Sets the debt of this Financials. + + + :param debt: The debt of this Financials. # noqa: E501 + :type: int + """ + + self._debt = debt + + @property + def debt_current(self): + """Gets the debt_current of this Financials. # noqa: E501 + + + :return: The debt_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._debt_current + + @debt_current.setter + def debt_current(self, debt_current): + """Sets the debt_current of this Financials. + + + :param debt_current: The debt_current of this Financials. # noqa: E501 + :type: int + """ + + self._debt_current = debt_current + + @property + def debt_non_current(self): + """Gets the debt_non_current of this Financials. # noqa: E501 + + + :return: The debt_non_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._debt_non_current + + @debt_non_current.setter + def debt_non_current(self, debt_non_current): + """Sets the debt_non_current of this Financials. + + + :param debt_non_current: The debt_non_current of this Financials. # noqa: E501 + :type: int + """ + + self._debt_non_current = debt_non_current + + @property + def debt_usd(self): + """Gets the debt_usd of this Financials. # noqa: E501 + + + :return: The debt_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._debt_usd + + @debt_usd.setter + def debt_usd(self, debt_usd): + """Sets the debt_usd of this Financials. + + + :param debt_usd: The debt_usd of this Financials. # noqa: E501 + :type: int + """ + + self._debt_usd = debt_usd + + @property + def deferred_revenue(self): + """Gets the deferred_revenue of this Financials. # noqa: E501 + + + :return: The deferred_revenue of this Financials. # noqa: E501 + :rtype: int + """ + return self._deferred_revenue + + @deferred_revenue.setter + def deferred_revenue(self, deferred_revenue): + """Sets the deferred_revenue of this Financials. + + + :param deferred_revenue: The deferred_revenue of this Financials. # noqa: E501 + :type: int + """ + + self._deferred_revenue = deferred_revenue + + @property + def depreciation_amortization_and_accretion(self): + """Gets the depreciation_amortization_and_accretion of this Financials. # noqa: E501 + + + :return: The depreciation_amortization_and_accretion of this Financials. # noqa: E501 + :rtype: int + """ + return self._depreciation_amortization_and_accretion + + @depreciation_amortization_and_accretion.setter + def depreciation_amortization_and_accretion(self, depreciation_amortization_and_accretion): + """Sets the depreciation_amortization_and_accretion of this Financials. + + + :param depreciation_amortization_and_accretion: The depreciation_amortization_and_accretion of this Financials. # noqa: E501 + :type: int + """ + + self._depreciation_amortization_and_accretion = depreciation_amortization_and_accretion + + @property + def deposits(self): + """Gets the deposits of this Financials. # noqa: E501 + + + :return: The deposits of this Financials. # noqa: E501 + :rtype: int + """ + return self._deposits + + @deposits.setter + def deposits(self, deposits): + """Sets the deposits of this Financials. + + + :param deposits: The deposits of this Financials. # noqa: E501 + :type: int + """ + + self._deposits = deposits + + @property + def dividend_yield(self): + """Gets the dividend_yield of this Financials. # noqa: E501 + + + :return: The dividend_yield of this Financials. # noqa: E501 + :rtype: int + """ + return self._dividend_yield + + @dividend_yield.setter + def dividend_yield(self, dividend_yield): + """Sets the dividend_yield of this Financials. + + + :param dividend_yield: The dividend_yield of this Financials. # noqa: E501 + :type: int + """ + + self._dividend_yield = dividend_yield + + @property + def dividends_per_basic_common_share(self): + """Gets the dividends_per_basic_common_share of this Financials. # noqa: E501 + + + :return: The dividends_per_basic_common_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._dividends_per_basic_common_share + + @dividends_per_basic_common_share.setter + def dividends_per_basic_common_share(self, dividends_per_basic_common_share): + """Sets the dividends_per_basic_common_share of this Financials. + + + :param dividends_per_basic_common_share: The dividends_per_basic_common_share of this Financials. # noqa: E501 + :type: int + """ + + self._dividends_per_basic_common_share = dividends_per_basic_common_share + + @property + def earning_before_interest_taxes(self): + """Gets the earning_before_interest_taxes of this Financials. # noqa: E501 + + + :return: The earning_before_interest_taxes of this Financials. # noqa: E501 + :rtype: int + """ + return self._earning_before_interest_taxes + + @earning_before_interest_taxes.setter + def earning_before_interest_taxes(self, earning_before_interest_taxes): + """Sets the earning_before_interest_taxes of this Financials. + + + :param earning_before_interest_taxes: The earning_before_interest_taxes of this Financials. # noqa: E501 + :type: int + """ + + self._earning_before_interest_taxes = earning_before_interest_taxes + + @property + def earnings_before_interest_taxes_depreciation_amortization(self): + """Gets the earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 + + + :return: The earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_before_interest_taxes_depreciation_amortization + + @earnings_before_interest_taxes_depreciation_amortization.setter + def earnings_before_interest_taxes_depreciation_amortization(self, earnings_before_interest_taxes_depreciation_amortization): + """Sets the earnings_before_interest_taxes_depreciation_amortization of this Financials. + + + :param earnings_before_interest_taxes_depreciation_amortization: The earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_before_interest_taxes_depreciation_amortization = earnings_before_interest_taxes_depreciation_amortization + + @property + def ebitda_margin(self): + """Gets the ebitda_margin of this Financials. # noqa: E501 + + + :return: The ebitda_margin of this Financials. # noqa: E501 + :rtype: int + """ + return self._ebitda_margin + + @ebitda_margin.setter + def ebitda_margin(self, ebitda_margin): + """Sets the ebitda_margin of this Financials. + + + :param ebitda_margin: The ebitda_margin of this Financials. # noqa: E501 + :type: int + """ + + self._ebitda_margin = ebitda_margin + + @property + def earnings_before_interest_taxes_depreciation_amortization_usd(self): + """Gets the earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 + + + :return: The earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_before_interest_taxes_depreciation_amortization_usd + + @earnings_before_interest_taxes_depreciation_amortization_usd.setter + def earnings_before_interest_taxes_depreciation_amortization_usd(self, earnings_before_interest_taxes_depreciation_amortization_usd): + """Sets the earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. + + + :param earnings_before_interest_taxes_depreciation_amortization_usd: The earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_before_interest_taxes_depreciation_amortization_usd = earnings_before_interest_taxes_depreciation_amortization_usd + + @property + def earning_before_interest_taxes_usd(self): + """Gets the earning_before_interest_taxes_usd of this Financials. # noqa: E501 + + + :return: The earning_before_interest_taxes_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._earning_before_interest_taxes_usd + + @earning_before_interest_taxes_usd.setter + def earning_before_interest_taxes_usd(self, earning_before_interest_taxes_usd): + """Sets the earning_before_interest_taxes_usd of this Financials. + + + :param earning_before_interest_taxes_usd: The earning_before_interest_taxes_usd of this Financials. # noqa: E501 + :type: int + """ + + self._earning_before_interest_taxes_usd = earning_before_interest_taxes_usd + + @property + def earnings_before_tax(self): + """Gets the earnings_before_tax of this Financials. # noqa: E501 + + + :return: The earnings_before_tax of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_before_tax + + @earnings_before_tax.setter + def earnings_before_tax(self, earnings_before_tax): + """Sets the earnings_before_tax of this Financials. + + + :param earnings_before_tax: The earnings_before_tax of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_before_tax = earnings_before_tax + + @property + def earnings_per_basic_share(self): + """Gets the earnings_per_basic_share of this Financials. # noqa: E501 + + + :return: The earnings_per_basic_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_per_basic_share + + @earnings_per_basic_share.setter + def earnings_per_basic_share(self, earnings_per_basic_share): + """Sets the earnings_per_basic_share of this Financials. + + + :param earnings_per_basic_share: The earnings_per_basic_share of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_per_basic_share = earnings_per_basic_share + + @property + def earnings_per_diluted_share(self): + """Gets the earnings_per_diluted_share of this Financials. # noqa: E501 + + + :return: The earnings_per_diluted_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_per_diluted_share + + @earnings_per_diluted_share.setter + def earnings_per_diluted_share(self, earnings_per_diluted_share): + """Sets the earnings_per_diluted_share of this Financials. + + + :param earnings_per_diluted_share: The earnings_per_diluted_share of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_per_diluted_share = earnings_per_diluted_share + + @property + def earnings_per_basic_share_usd(self): + """Gets the earnings_per_basic_share_usd of this Financials. # noqa: E501 + + + :return: The earnings_per_basic_share_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._earnings_per_basic_share_usd + + @earnings_per_basic_share_usd.setter + def earnings_per_basic_share_usd(self, earnings_per_basic_share_usd): + """Sets the earnings_per_basic_share_usd of this Financials. + + + :param earnings_per_basic_share_usd: The earnings_per_basic_share_usd of this Financials. # noqa: E501 + :type: int + """ + + self._earnings_per_basic_share_usd = earnings_per_basic_share_usd + + @property + def shareholders_equity(self): + """Gets the shareholders_equity of this Financials. # noqa: E501 + + + :return: The shareholders_equity of this Financials. # noqa: E501 + :rtype: int + """ + return self._shareholders_equity + + @shareholders_equity.setter + def shareholders_equity(self, shareholders_equity): + """Sets the shareholders_equity of this Financials. + + + :param shareholders_equity: The shareholders_equity of this Financials. # noqa: E501 + :type: int + """ + + self._shareholders_equity = shareholders_equity + + @property + def average_equity(self): + """Gets the average_equity of this Financials. # noqa: E501 + + + :return: The average_equity of this Financials. # noqa: E501 + :rtype: int + """ + return self._average_equity + + @average_equity.setter + def average_equity(self, average_equity): + """Sets the average_equity of this Financials. + + + :param average_equity: The average_equity of this Financials. # noqa: E501 + :type: int + """ + + self._average_equity = average_equity + + @property + def shareholders_equity_usd(self): + """Gets the shareholders_equity_usd of this Financials. # noqa: E501 + + + :return: The shareholders_equity_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._shareholders_equity_usd + + @shareholders_equity_usd.setter + def shareholders_equity_usd(self, shareholders_equity_usd): + """Sets the shareholders_equity_usd of this Financials. + + + :param shareholders_equity_usd: The shareholders_equity_usd of this Financials. # noqa: E501 + :type: int + """ + + self._shareholders_equity_usd = shareholders_equity_usd + + @property + def enterprise_value(self): + """Gets the enterprise_value of this Financials. # noqa: E501 + + + :return: The enterprise_value of this Financials. # noqa: E501 + :rtype: int + """ + return self._enterprise_value + + @enterprise_value.setter + def enterprise_value(self, enterprise_value): + """Sets the enterprise_value of this Financials. + + + :param enterprise_value: The enterprise_value of this Financials. # noqa: E501 + :type: int + """ + + self._enterprise_value = enterprise_value + + @property + def enterprise_value_over_ebit(self): + """Gets the enterprise_value_over_ebit of this Financials. # noqa: E501 + + + :return: The enterprise_value_over_ebit of this Financials. # noqa: E501 + :rtype: int + """ + return self._enterprise_value_over_ebit + + @enterprise_value_over_ebit.setter + def enterprise_value_over_ebit(self, enterprise_value_over_ebit): + """Sets the enterprise_value_over_ebit of this Financials. + + + :param enterprise_value_over_ebit: The enterprise_value_over_ebit of this Financials. # noqa: E501 + :type: int + """ + + self._enterprise_value_over_ebit = enterprise_value_over_ebit + + @property + def enterprise_value_over_ebitda(self): + """Gets the enterprise_value_over_ebitda of this Financials. # noqa: E501 + + + :return: The enterprise_value_over_ebitda of this Financials. # noqa: E501 + :rtype: int + """ + return self._enterprise_value_over_ebitda + + @enterprise_value_over_ebitda.setter + def enterprise_value_over_ebitda(self, enterprise_value_over_ebitda): + """Sets the enterprise_value_over_ebitda of this Financials. + + + :param enterprise_value_over_ebitda: The enterprise_value_over_ebitda of this Financials. # noqa: E501 + :type: int + """ + + self._enterprise_value_over_ebitda = enterprise_value_over_ebitda + + @property + def free_cash_flow(self): + """Gets the free_cash_flow of this Financials. # noqa: E501 + + + :return: The free_cash_flow of this Financials. # noqa: E501 + :rtype: int + """ + return self._free_cash_flow + + @free_cash_flow.setter + def free_cash_flow(self, free_cash_flow): + """Sets the free_cash_flow of this Financials. + + + :param free_cash_flow: The free_cash_flow of this Financials. # noqa: E501 + :type: int + """ + + self._free_cash_flow = free_cash_flow + + @property + def free_cash_flow_per_share(self): + """Gets the free_cash_flow_per_share of this Financials. # noqa: E501 + + + :return: The free_cash_flow_per_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._free_cash_flow_per_share + + @free_cash_flow_per_share.setter + def free_cash_flow_per_share(self, free_cash_flow_per_share): + """Sets the free_cash_flow_per_share of this Financials. + + + :param free_cash_flow_per_share: The free_cash_flow_per_share of this Financials. # noqa: E501 + :type: int + """ + + self._free_cash_flow_per_share = free_cash_flow_per_share + + @property + def foreign_currency_usd_exchange_rate(self): + """Gets the foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 + + + :return: The foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 + :rtype: int + """ + return self._foreign_currency_usd_exchange_rate + + @foreign_currency_usd_exchange_rate.setter + def foreign_currency_usd_exchange_rate(self, foreign_currency_usd_exchange_rate): + """Sets the foreign_currency_usd_exchange_rate of this Financials. + + + :param foreign_currency_usd_exchange_rate: The foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 + :type: int + """ + + self._foreign_currency_usd_exchange_rate = foreign_currency_usd_exchange_rate + + @property + def gross_profit(self): + """Gets the gross_profit of this Financials. # noqa: E501 + + + :return: The gross_profit of this Financials. # noqa: E501 + :rtype: int + """ + return self._gross_profit + + @gross_profit.setter + def gross_profit(self, gross_profit): + """Sets the gross_profit of this Financials. + + + :param gross_profit: The gross_profit of this Financials. # noqa: E501 + :type: int + """ + + self._gross_profit = gross_profit + + @property + def gross_margin(self): + """Gets the gross_margin of this Financials. # noqa: E501 + + + :return: The gross_margin of this Financials. # noqa: E501 + :rtype: int + """ + return self._gross_margin + + @gross_margin.setter + def gross_margin(self, gross_margin): + """Sets the gross_margin of this Financials. + + + :param gross_margin: The gross_margin of this Financials. # noqa: E501 + :type: int + """ + + self._gross_margin = gross_margin + + @property + def goodwill_and_intangible_assets(self): + """Gets the goodwill_and_intangible_assets of this Financials. # noqa: E501 + + + :return: The goodwill_and_intangible_assets of this Financials. # noqa: E501 + :rtype: int + """ + return self._goodwill_and_intangible_assets + + @goodwill_and_intangible_assets.setter + def goodwill_and_intangible_assets(self, goodwill_and_intangible_assets): + """Sets the goodwill_and_intangible_assets of this Financials. + + + :param goodwill_and_intangible_assets: The goodwill_and_intangible_assets of this Financials. # noqa: E501 + :type: int + """ + + self._goodwill_and_intangible_assets = goodwill_and_intangible_assets + + @property + def interest_expense(self): + """Gets the interest_expense of this Financials. # noqa: E501 + + + :return: The interest_expense of this Financials. # noqa: E501 + :rtype: int + """ + return self._interest_expense + + @interest_expense.setter + def interest_expense(self, interest_expense): + """Sets the interest_expense of this Financials. + + + :param interest_expense: The interest_expense of this Financials. # noqa: E501 + :type: int + """ + + self._interest_expense = interest_expense + + @property + def invested_capital(self): + """Gets the invested_capital of this Financials. # noqa: E501 + + + :return: The invested_capital of this Financials. # noqa: E501 + :rtype: int + """ + return self._invested_capital + + @invested_capital.setter + def invested_capital(self, invested_capital): + """Sets the invested_capital of this Financials. + + + :param invested_capital: The invested_capital of this Financials. # noqa: E501 + :type: int + """ + + self._invested_capital = invested_capital + + @property + def invested_capital_average(self): + """Gets the invested_capital_average of this Financials. # noqa: E501 + + + :return: The invested_capital_average of this Financials. # noqa: E501 + :rtype: int + """ + return self._invested_capital_average + + @invested_capital_average.setter + def invested_capital_average(self, invested_capital_average): + """Sets the invested_capital_average of this Financials. + + + :param invested_capital_average: The invested_capital_average of this Financials. # noqa: E501 + :type: int + """ + + self._invested_capital_average = invested_capital_average + + @property + def inventory(self): + """Gets the inventory of this Financials. # noqa: E501 + + + :return: The inventory of this Financials. # noqa: E501 + :rtype: int + """ + return self._inventory + + @inventory.setter + def inventory(self, inventory): + """Sets the inventory of this Financials. + + + :param inventory: The inventory of this Financials. # noqa: E501 + :type: int + """ + + self._inventory = inventory + + @property + def investments(self): + """Gets the investments of this Financials. # noqa: E501 + + + :return: The investments of this Financials. # noqa: E501 + :rtype: int + """ + return self._investments + + @investments.setter + def investments(self, investments): + """Sets the investments of this Financials. + + + :param investments: The investments of this Financials. # noqa: E501 + :type: int + """ + + self._investments = investments + + @property + def investments_current(self): + """Gets the investments_current of this Financials. # noqa: E501 + + + :return: The investments_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._investments_current + + @investments_current.setter + def investments_current(self, investments_current): + """Sets the investments_current of this Financials. + + + :param investments_current: The investments_current of this Financials. # noqa: E501 + :type: int + """ + + self._investments_current = investments_current + + @property + def investments_non_current(self): + """Gets the investments_non_current of this Financials. # noqa: E501 + + + :return: The investments_non_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._investments_non_current + + @investments_non_current.setter + def investments_non_current(self, investments_non_current): + """Sets the investments_non_current of this Financials. + + + :param investments_non_current: The investments_non_current of this Financials. # noqa: E501 + :type: int + """ + + self._investments_non_current = investments_non_current + + @property + def total_liabilities(self): + """Gets the total_liabilities of this Financials. # noqa: E501 + + + :return: The total_liabilities of this Financials. # noqa: E501 + :rtype: int + """ + return self._total_liabilities + + @total_liabilities.setter + def total_liabilities(self, total_liabilities): + """Sets the total_liabilities of this Financials. + + + :param total_liabilities: The total_liabilities of this Financials. # noqa: E501 + :type: int + """ + + self._total_liabilities = total_liabilities + + @property + def current_liabilities(self): + """Gets the current_liabilities of this Financials. # noqa: E501 + + + :return: The current_liabilities of this Financials. # noqa: E501 + :rtype: int + """ + return self._current_liabilities + + @current_liabilities.setter + def current_liabilities(self, current_liabilities): + """Sets the current_liabilities of this Financials. + + + :param current_liabilities: The current_liabilities of this Financials. # noqa: E501 + :type: int + """ + + self._current_liabilities = current_liabilities + + @property + def liabilities_non_current(self): + """Gets the liabilities_non_current of this Financials. # noqa: E501 + + + :return: The liabilities_non_current of this Financials. # noqa: E501 + :rtype: int + """ + return self._liabilities_non_current + + @liabilities_non_current.setter + def liabilities_non_current(self, liabilities_non_current): + """Sets the liabilities_non_current of this Financials. + + + :param liabilities_non_current: The liabilities_non_current of this Financials. # noqa: E501 + :type: int + """ + + self._liabilities_non_current = liabilities_non_current + + @property + def market_capitalization(self): + """Gets the market_capitalization of this Financials. # noqa: E501 + + + :return: The market_capitalization of this Financials. # noqa: E501 + :rtype: int + """ + return self._market_capitalization + + @market_capitalization.setter + def market_capitalization(self, market_capitalization): + """Sets the market_capitalization of this Financials. + + + :param market_capitalization: The market_capitalization of this Financials. # noqa: E501 + :type: int + """ + + self._market_capitalization = market_capitalization + + @property + def net_cash_flow(self): + """Gets the net_cash_flow of this Financials. # noqa: E501 + + + :return: The net_cash_flow of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow + + @net_cash_flow.setter + def net_cash_flow(self, net_cash_flow): + """Sets the net_cash_flow of this Financials. + + + :param net_cash_flow: The net_cash_flow of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow = net_cash_flow + + @property + def net_cash_flow_business_acquisitions_disposals(self): + """Gets the net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 + + + :return: The net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow_business_acquisitions_disposals + + @net_cash_flow_business_acquisitions_disposals.setter + def net_cash_flow_business_acquisitions_disposals(self, net_cash_flow_business_acquisitions_disposals): + """Sets the net_cash_flow_business_acquisitions_disposals of this Financials. + + + :param net_cash_flow_business_acquisitions_disposals: The net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow_business_acquisitions_disposals = net_cash_flow_business_acquisitions_disposals + + @property + def issuance_equity_shares(self): + """Gets the issuance_equity_shares of this Financials. # noqa: E501 + + + :return: The issuance_equity_shares of this Financials. # noqa: E501 + :rtype: int + """ + return self._issuance_equity_shares + + @issuance_equity_shares.setter + def issuance_equity_shares(self, issuance_equity_shares): + """Sets the issuance_equity_shares of this Financials. + + + :param issuance_equity_shares: The issuance_equity_shares of this Financials. # noqa: E501 + :type: int + """ + + self._issuance_equity_shares = issuance_equity_shares + + @property + def issuance_debt_securities(self): + """Gets the issuance_debt_securities of this Financials. # noqa: E501 + + + :return: The issuance_debt_securities of this Financials. # noqa: E501 + :rtype: int + """ + return self._issuance_debt_securities + + @issuance_debt_securities.setter + def issuance_debt_securities(self, issuance_debt_securities): + """Sets the issuance_debt_securities of this Financials. + + + :param issuance_debt_securities: The issuance_debt_securities of this Financials. # noqa: E501 + :type: int + """ + + self._issuance_debt_securities = issuance_debt_securities + + @property + def payment_dividends_other_cash_distributions(self): + """Gets the payment_dividends_other_cash_distributions of this Financials. # noqa: E501 + + + :return: The payment_dividends_other_cash_distributions of this Financials. # noqa: E501 + :rtype: int + """ + return self._payment_dividends_other_cash_distributions + + @payment_dividends_other_cash_distributions.setter + def payment_dividends_other_cash_distributions(self, payment_dividends_other_cash_distributions): + """Sets the payment_dividends_other_cash_distributions of this Financials. + + + :param payment_dividends_other_cash_distributions: The payment_dividends_other_cash_distributions of this Financials. # noqa: E501 + :type: int + """ + + self._payment_dividends_other_cash_distributions = payment_dividends_other_cash_distributions + + @property + def net_cash_flow_from_financing(self): + """Gets the net_cash_flow_from_financing of this Financials. # noqa: E501 + + + :return: The net_cash_flow_from_financing of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow_from_financing + + @net_cash_flow_from_financing.setter + def net_cash_flow_from_financing(self, net_cash_flow_from_financing): + """Sets the net_cash_flow_from_financing of this Financials. + + + :param net_cash_flow_from_financing: The net_cash_flow_from_financing of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow_from_financing = net_cash_flow_from_financing + + @property + def net_cash_flow_from_investing(self): + """Gets the net_cash_flow_from_investing of this Financials. # noqa: E501 + + + :return: The net_cash_flow_from_investing of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow_from_investing + + @net_cash_flow_from_investing.setter + def net_cash_flow_from_investing(self, net_cash_flow_from_investing): + """Sets the net_cash_flow_from_investing of this Financials. + + + :param net_cash_flow_from_investing: The net_cash_flow_from_investing of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow_from_investing = net_cash_flow_from_investing + + @property + def net_cash_flow_investment_acquisitions_disposals(self): + """Gets the net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 + + + :return: The net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow_investment_acquisitions_disposals + + @net_cash_flow_investment_acquisitions_disposals.setter + def net_cash_flow_investment_acquisitions_disposals(self, net_cash_flow_investment_acquisitions_disposals): + """Sets the net_cash_flow_investment_acquisitions_disposals of this Financials. + + + :param net_cash_flow_investment_acquisitions_disposals: The net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow_investment_acquisitions_disposals = net_cash_flow_investment_acquisitions_disposals + + @property + def net_cash_flow_from_operations(self): + """Gets the net_cash_flow_from_operations of this Financials. # noqa: E501 + + + :return: The net_cash_flow_from_operations of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_cash_flow_from_operations + + @net_cash_flow_from_operations.setter + def net_cash_flow_from_operations(self, net_cash_flow_from_operations): + """Sets the net_cash_flow_from_operations of this Financials. + + + :param net_cash_flow_from_operations: The net_cash_flow_from_operations of this Financials. # noqa: E501 + :type: int + """ + + self._net_cash_flow_from_operations = net_cash_flow_from_operations + + @property + def effect_of_exchange_rate_changes_on_cash(self): + """Gets the effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 + + + :return: The effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 + :rtype: int + """ + return self._effect_of_exchange_rate_changes_on_cash + + @effect_of_exchange_rate_changes_on_cash.setter + def effect_of_exchange_rate_changes_on_cash(self, effect_of_exchange_rate_changes_on_cash): + """Sets the effect_of_exchange_rate_changes_on_cash of this Financials. + + + :param effect_of_exchange_rate_changes_on_cash: The effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 + :type: int + """ + + self._effect_of_exchange_rate_changes_on_cash = effect_of_exchange_rate_changes_on_cash + + @property + def net_income(self): + """Gets the net_income of this Financials. # noqa: E501 + + + :return: The net_income of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_income + + @net_income.setter + def net_income(self, net_income): + """Sets the net_income of this Financials. + + + :param net_income: The net_income of this Financials. # noqa: E501 + :type: int + """ + + self._net_income = net_income + + @property + def net_income_common_stock(self): + """Gets the net_income_common_stock of this Financials. # noqa: E501 + + + :return: The net_income_common_stock of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_income_common_stock + + @net_income_common_stock.setter + def net_income_common_stock(self, net_income_common_stock): + """Sets the net_income_common_stock of this Financials. + + + :param net_income_common_stock: The net_income_common_stock of this Financials. # noqa: E501 + :type: int + """ + + self._net_income_common_stock = net_income_common_stock + + @property + def net_income_common_stock_usd(self): + """Gets the net_income_common_stock_usd of this Financials. # noqa: E501 + + + :return: The net_income_common_stock_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_income_common_stock_usd + + @net_income_common_stock_usd.setter + def net_income_common_stock_usd(self, net_income_common_stock_usd): + """Sets the net_income_common_stock_usd of this Financials. + + + :param net_income_common_stock_usd: The net_income_common_stock_usd of this Financials. # noqa: E501 + :type: int + """ + + self._net_income_common_stock_usd = net_income_common_stock_usd + + @property + def net_loss_income_from_discontinued_operations(self): + """Gets the net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 + + + :return: The net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_loss_income_from_discontinued_operations + + @net_loss_income_from_discontinued_operations.setter + def net_loss_income_from_discontinued_operations(self, net_loss_income_from_discontinued_operations): + """Sets the net_loss_income_from_discontinued_operations of this Financials. + + + :param net_loss_income_from_discontinued_operations: The net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 + :type: int + """ + + self._net_loss_income_from_discontinued_operations = net_loss_income_from_discontinued_operations + + @property + def net_income_to_non_controlling_interests(self): + """Gets the net_income_to_non_controlling_interests of this Financials. # noqa: E501 + + + :return: The net_income_to_non_controlling_interests of this Financials. # noqa: E501 + :rtype: int + """ + return self._net_income_to_non_controlling_interests + + @net_income_to_non_controlling_interests.setter + def net_income_to_non_controlling_interests(self, net_income_to_non_controlling_interests): + """Sets the net_income_to_non_controlling_interests of this Financials. + + + :param net_income_to_non_controlling_interests: The net_income_to_non_controlling_interests of this Financials. # noqa: E501 + :type: int + """ + + self._net_income_to_non_controlling_interests = net_income_to_non_controlling_interests + + @property + def profit_margin(self): + """Gets the profit_margin of this Financials. # noqa: E501 + + + :return: The profit_margin of this Financials. # noqa: E501 + :rtype: int + """ + return self._profit_margin + + @profit_margin.setter + def profit_margin(self, profit_margin): + """Sets the profit_margin of this Financials. + + + :param profit_margin: The profit_margin of this Financials. # noqa: E501 + :type: int + """ + + self._profit_margin = profit_margin + + @property + def operating_expenses(self): + """Gets the operating_expenses of this Financials. # noqa: E501 + + + :return: The operating_expenses of this Financials. # noqa: E501 + :rtype: int + """ + return self._operating_expenses + + @operating_expenses.setter + def operating_expenses(self, operating_expenses): + """Sets the operating_expenses of this Financials. + + + :param operating_expenses: The operating_expenses of this Financials. # noqa: E501 + :type: int + """ + + self._operating_expenses = operating_expenses + + @property + def operating_income(self): + """Gets the operating_income of this Financials. # noqa: E501 + + + :return: The operating_income of this Financials. # noqa: E501 + :rtype: int + """ + return self._operating_income + + @operating_income.setter + def operating_income(self, operating_income): + """Sets the operating_income of this Financials. + + + :param operating_income: The operating_income of this Financials. # noqa: E501 + :type: int + """ + + self._operating_income = operating_income + + @property + def trade_and_non_trade_payables(self): + """Gets the trade_and_non_trade_payables of this Financials. # noqa: E501 + + + :return: The trade_and_non_trade_payables of this Financials. # noqa: E501 + :rtype: int + """ + return self._trade_and_non_trade_payables + + @trade_and_non_trade_payables.setter + def trade_and_non_trade_payables(self, trade_and_non_trade_payables): + """Sets the trade_and_non_trade_payables of this Financials. + + + :param trade_and_non_trade_payables: The trade_and_non_trade_payables of this Financials. # noqa: E501 + :type: int + """ + + self._trade_and_non_trade_payables = trade_and_non_trade_payables + + @property + def payout_ratio(self): + """Gets the payout_ratio of this Financials. # noqa: E501 + + + :return: The payout_ratio of this Financials. # noqa: E501 + :rtype: int + """ + return self._payout_ratio + + @payout_ratio.setter + def payout_ratio(self, payout_ratio): + """Sets the payout_ratio of this Financials. + + + :param payout_ratio: The payout_ratio of this Financials. # noqa: E501 + :type: int + """ + + self._payout_ratio = payout_ratio + + @property + def price_to_book_value(self): + """Gets the price_to_book_value of this Financials. # noqa: E501 + + + :return: The price_to_book_value of this Financials. # noqa: E501 + :rtype: int + """ + return self._price_to_book_value + + @price_to_book_value.setter + def price_to_book_value(self, price_to_book_value): + """Sets the price_to_book_value of this Financials. + + + :param price_to_book_value: The price_to_book_value of this Financials. # noqa: E501 + :type: int + """ + + self._price_to_book_value = price_to_book_value + + @property + def price_earnings(self): + """Gets the price_earnings of this Financials. # noqa: E501 + + + :return: The price_earnings of this Financials. # noqa: E501 + :rtype: int + """ + return self._price_earnings + + @price_earnings.setter + def price_earnings(self, price_earnings): + """Sets the price_earnings of this Financials. + + + :param price_earnings: The price_earnings of this Financials. # noqa: E501 + :type: int + """ + + self._price_earnings = price_earnings + + @property + def price_to_earnings_ratio(self): + """Gets the price_to_earnings_ratio of this Financials. # noqa: E501 + + + :return: The price_to_earnings_ratio of this Financials. # noqa: E501 + :rtype: int + """ + return self._price_to_earnings_ratio + + @price_to_earnings_ratio.setter + def price_to_earnings_ratio(self, price_to_earnings_ratio): + """Sets the price_to_earnings_ratio of this Financials. + + + :param price_to_earnings_ratio: The price_to_earnings_ratio of this Financials. # noqa: E501 + :type: int + """ + + self._price_to_earnings_ratio = price_to_earnings_ratio + + @property + def property_plant_equipment_net(self): + """Gets the property_plant_equipment_net of this Financials. # noqa: E501 + + + :return: The property_plant_equipment_net of this Financials. # noqa: E501 + :rtype: int + """ + return self._property_plant_equipment_net + + @property_plant_equipment_net.setter + def property_plant_equipment_net(self, property_plant_equipment_net): + """Sets the property_plant_equipment_net of this Financials. + + + :param property_plant_equipment_net: The property_plant_equipment_net of this Financials. # noqa: E501 + :type: int + """ + + self._property_plant_equipment_net = property_plant_equipment_net + + @property + def preferred_dividends_income_statement_impact(self): + """Gets the preferred_dividends_income_statement_impact of this Financials. # noqa: E501 + + + :return: The preferred_dividends_income_statement_impact of this Financials. # noqa: E501 + :rtype: int + """ + return self._preferred_dividends_income_statement_impact + + @preferred_dividends_income_statement_impact.setter + def preferred_dividends_income_statement_impact(self, preferred_dividends_income_statement_impact): + """Sets the preferred_dividends_income_statement_impact of this Financials. + + + :param preferred_dividends_income_statement_impact: The preferred_dividends_income_statement_impact of this Financials. # noqa: E501 + :type: int + """ + + self._preferred_dividends_income_statement_impact = preferred_dividends_income_statement_impact + + @property + def share_price_adjusted_close(self): + """Gets the share_price_adjusted_close of this Financials. # noqa: E501 + + + :return: The share_price_adjusted_close of this Financials. # noqa: E501 + :rtype: int + """ + return self._share_price_adjusted_close + + @share_price_adjusted_close.setter + def share_price_adjusted_close(self, share_price_adjusted_close): + """Sets the share_price_adjusted_close of this Financials. + + + :param share_price_adjusted_close: The share_price_adjusted_close of this Financials. # noqa: E501 + :type: int + """ + + self._share_price_adjusted_close = share_price_adjusted_close + + @property + def price_sales(self): + """Gets the price_sales of this Financials. # noqa: E501 + + + :return: The price_sales of this Financials. # noqa: E501 + :rtype: int + """ + return self._price_sales + + @price_sales.setter + def price_sales(self, price_sales): + """Sets the price_sales of this Financials. + + + :param price_sales: The price_sales of this Financials. # noqa: E501 + :type: int + """ + + self._price_sales = price_sales + + @property + def price_to_sales_ratio(self): + """Gets the price_to_sales_ratio of this Financials. # noqa: E501 + + + :return: The price_to_sales_ratio of this Financials. # noqa: E501 + :rtype: int + """ + return self._price_to_sales_ratio + + @price_to_sales_ratio.setter + def price_to_sales_ratio(self, price_to_sales_ratio): + """Sets the price_to_sales_ratio of this Financials. + + + :param price_to_sales_ratio: The price_to_sales_ratio of this Financials. # noqa: E501 + :type: int + """ + + self._price_to_sales_ratio = price_to_sales_ratio + + @property + def trade_and_non_trade_receivables(self): + """Gets the trade_and_non_trade_receivables of this Financials. # noqa: E501 + + + :return: The trade_and_non_trade_receivables of this Financials. # noqa: E501 + :rtype: int + """ + return self._trade_and_non_trade_receivables + + @trade_and_non_trade_receivables.setter + def trade_and_non_trade_receivables(self, trade_and_non_trade_receivables): + """Sets the trade_and_non_trade_receivables of this Financials. + + + :param trade_and_non_trade_receivables: The trade_and_non_trade_receivables of this Financials. # noqa: E501 + :type: int + """ + + self._trade_and_non_trade_receivables = trade_and_non_trade_receivables + + @property + def accumulated_retained_earnings_deficit(self): + """Gets the accumulated_retained_earnings_deficit of this Financials. # noqa: E501 + + + :return: The accumulated_retained_earnings_deficit of this Financials. # noqa: E501 + :rtype: int + """ + return self._accumulated_retained_earnings_deficit + + @accumulated_retained_earnings_deficit.setter + def accumulated_retained_earnings_deficit(self, accumulated_retained_earnings_deficit): + """Sets the accumulated_retained_earnings_deficit of this Financials. + + + :param accumulated_retained_earnings_deficit: The accumulated_retained_earnings_deficit of this Financials. # noqa: E501 + :type: int + """ + + self._accumulated_retained_earnings_deficit = accumulated_retained_earnings_deficit + + @property + def revenues(self): + """Gets the revenues of this Financials. # noqa: E501 + + + :return: The revenues of this Financials. # noqa: E501 + :rtype: int + """ + return self._revenues + + @revenues.setter + def revenues(self, revenues): + """Sets the revenues of this Financials. + + + :param revenues: The revenues of this Financials. # noqa: E501 + :type: int + """ + + self._revenues = revenues + + @property + def revenues_usd(self): + """Gets the revenues_usd of this Financials. # noqa: E501 + + + :return: The revenues_usd of this Financials. # noqa: E501 + :rtype: int + """ + return self._revenues_usd + + @revenues_usd.setter + def revenues_usd(self, revenues_usd): + """Sets the revenues_usd of this Financials. + + + :param revenues_usd: The revenues_usd of this Financials. # noqa: E501 + :type: int + """ + + self._revenues_usd = revenues_usd + + @property + def research_and_development_expense(self): + """Gets the research_and_development_expense of this Financials. # noqa: E501 + + + :return: The research_and_development_expense of this Financials. # noqa: E501 + :rtype: int + """ + return self._research_and_development_expense + + @research_and_development_expense.setter + def research_and_development_expense(self, research_and_development_expense): + """Sets the research_and_development_expense of this Financials. + + + :param research_and_development_expense: The research_and_development_expense of this Financials. # noqa: E501 + :type: int + """ + + self._research_and_development_expense = research_and_development_expense + + @property + def return_on_average_assets(self): + """Gets the return_on_average_assets of this Financials. # noqa: E501 + + + :return: The return_on_average_assets of this Financials. # noqa: E501 + :rtype: int + """ + return self._return_on_average_assets + + @return_on_average_assets.setter + def return_on_average_assets(self, return_on_average_assets): + """Sets the return_on_average_assets of this Financials. + + + :param return_on_average_assets: The return_on_average_assets of this Financials. # noqa: E501 + :type: int + """ + + self._return_on_average_assets = return_on_average_assets + + @property + def return_on_average_equity(self): + """Gets the return_on_average_equity of this Financials. # noqa: E501 + + + :return: The return_on_average_equity of this Financials. # noqa: E501 + :rtype: int + """ + return self._return_on_average_equity + + @return_on_average_equity.setter + def return_on_average_equity(self, return_on_average_equity): + """Sets the return_on_average_equity of this Financials. + + + :param return_on_average_equity: The return_on_average_equity of this Financials. # noqa: E501 + :type: int + """ + + self._return_on_average_equity = return_on_average_equity + + @property + def return_on_invested_capital(self): + """Gets the return_on_invested_capital of this Financials. # noqa: E501 + + + :return: The return_on_invested_capital of this Financials. # noqa: E501 + :rtype: int + """ + return self._return_on_invested_capital + + @return_on_invested_capital.setter + def return_on_invested_capital(self, return_on_invested_capital): + """Sets the return_on_invested_capital of this Financials. + + + :param return_on_invested_capital: The return_on_invested_capital of this Financials. # noqa: E501 + :type: int + """ + + self._return_on_invested_capital = return_on_invested_capital + + @property + def return_on_sales(self): + """Gets the return_on_sales of this Financials. # noqa: E501 + + + :return: The return_on_sales of this Financials. # noqa: E501 + :rtype: int + """ + return self._return_on_sales + + @return_on_sales.setter + def return_on_sales(self, return_on_sales): + """Sets the return_on_sales of this Financials. + + + :param return_on_sales: The return_on_sales of this Financials. # noqa: E501 + :type: int + """ + + self._return_on_sales = return_on_sales + + @property + def share_based_compensation(self): + """Gets the share_based_compensation of this Financials. # noqa: E501 + + + :return: The share_based_compensation of this Financials. # noqa: E501 + :rtype: int + """ + return self._share_based_compensation + + @share_based_compensation.setter + def share_based_compensation(self, share_based_compensation): + """Sets the share_based_compensation of this Financials. + + + :param share_based_compensation: The share_based_compensation of this Financials. # noqa: E501 + :type: int + """ + + self._share_based_compensation = share_based_compensation + + @property + def selling_general_and_administrative_expense(self): + """Gets the selling_general_and_administrative_expense of this Financials. # noqa: E501 + + + :return: The selling_general_and_administrative_expense of this Financials. # noqa: E501 + :rtype: int + """ + return self._selling_general_and_administrative_expense + + @selling_general_and_administrative_expense.setter + def selling_general_and_administrative_expense(self, selling_general_and_administrative_expense): + """Sets the selling_general_and_administrative_expense of this Financials. + + + :param selling_general_and_administrative_expense: The selling_general_and_administrative_expense of this Financials. # noqa: E501 + :type: int + """ + + self._selling_general_and_administrative_expense = selling_general_and_administrative_expense + + @property + def share_factor(self): + """Gets the share_factor of this Financials. # noqa: E501 + + + :return: The share_factor of this Financials. # noqa: E501 + :rtype: int + """ + return self._share_factor + + @share_factor.setter + def share_factor(self, share_factor): + """Sets the share_factor of this Financials. + + + :param share_factor: The share_factor of this Financials. # noqa: E501 + :type: int + """ + + self._share_factor = share_factor + + @property + def shares(self): + """Gets the shares of this Financials. # noqa: E501 + + + :return: The shares of this Financials. # noqa: E501 + :rtype: int + """ + return self._shares + + @shares.setter + def shares(self, shares): + """Sets the shares of this Financials. + + + :param shares: The shares of this Financials. # noqa: E501 + :type: int + """ + + self._shares = shares + + @property + def weighted_average_shares(self): + """Gets the weighted_average_shares of this Financials. # noqa: E501 + + + :return: The weighted_average_shares of this Financials. # noqa: E501 + :rtype: int + """ + return self._weighted_average_shares + + @weighted_average_shares.setter + def weighted_average_shares(self, weighted_average_shares): + """Sets the weighted_average_shares of this Financials. + + + :param weighted_average_shares: The weighted_average_shares of this Financials. # noqa: E501 + :type: int + """ + + self._weighted_average_shares = weighted_average_shares + + @property + def weighted_average_shares_diluted(self): + """Gets the weighted_average_shares_diluted of this Financials. # noqa: E501 + + + :return: The weighted_average_shares_diluted of this Financials. # noqa: E501 + :rtype: int + """ + return self._weighted_average_shares_diluted + + @weighted_average_shares_diluted.setter + def weighted_average_shares_diluted(self, weighted_average_shares_diluted): + """Sets the weighted_average_shares_diluted of this Financials. + + + :param weighted_average_shares_diluted: The weighted_average_shares_diluted of this Financials. # noqa: E501 + :type: int + """ + + self._weighted_average_shares_diluted = weighted_average_shares_diluted + + @property + def sales_per_share(self): + """Gets the sales_per_share of this Financials. # noqa: E501 + + + :return: The sales_per_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._sales_per_share + + @sales_per_share.setter + def sales_per_share(self, sales_per_share): + """Sets the sales_per_share of this Financials. + + + :param sales_per_share: The sales_per_share of this Financials. # noqa: E501 + :type: int + """ + + self._sales_per_share = sales_per_share + + @property + def tangible_asset_value(self): + """Gets the tangible_asset_value of this Financials. # noqa: E501 + + + :return: The tangible_asset_value of this Financials. # noqa: E501 + :rtype: int + """ + return self._tangible_asset_value + + @tangible_asset_value.setter + def tangible_asset_value(self, tangible_asset_value): + """Sets the tangible_asset_value of this Financials. + + + :param tangible_asset_value: The tangible_asset_value of this Financials. # noqa: E501 + :type: int + """ + + self._tangible_asset_value = tangible_asset_value + + @property + def tax_assets(self): + """Gets the tax_assets of this Financials. # noqa: E501 + + + :return: The tax_assets of this Financials. # noqa: E501 + :rtype: int + """ + return self._tax_assets + + @tax_assets.setter + def tax_assets(self, tax_assets): + """Sets the tax_assets of this Financials. + + + :param tax_assets: The tax_assets of this Financials. # noqa: E501 + :type: int + """ + + self._tax_assets = tax_assets + + @property + def income_tax_expense(self): + """Gets the income_tax_expense of this Financials. # noqa: E501 + + + :return: The income_tax_expense of this Financials. # noqa: E501 + :rtype: int + """ + return self._income_tax_expense + + @income_tax_expense.setter + def income_tax_expense(self, income_tax_expense): + """Sets the income_tax_expense of this Financials. + + + :param income_tax_expense: The income_tax_expense of this Financials. # noqa: E501 + :type: int + """ + + self._income_tax_expense = income_tax_expense + + @property + def tax_liabilities(self): + """Gets the tax_liabilities of this Financials. # noqa: E501 + + + :return: The tax_liabilities of this Financials. # noqa: E501 + :rtype: int + """ + return self._tax_liabilities + + @tax_liabilities.setter + def tax_liabilities(self, tax_liabilities): + """Sets the tax_liabilities of this Financials. + + + :param tax_liabilities: The tax_liabilities of this Financials. # noqa: E501 + :type: int + """ + + self._tax_liabilities = tax_liabilities + + @property + def tangible_assets_book_value_per_share(self): + """Gets the tangible_assets_book_value_per_share of this Financials. # noqa: E501 + + + :return: The tangible_assets_book_value_per_share of this Financials. # noqa: E501 + :rtype: int + """ + return self._tangible_assets_book_value_per_share + + @tangible_assets_book_value_per_share.setter + def tangible_assets_book_value_per_share(self, tangible_assets_book_value_per_share): + """Sets the tangible_assets_book_value_per_share of this Financials. + + + :param tangible_assets_book_value_per_share: The tangible_assets_book_value_per_share of this Financials. # noqa: E501 + :type: int + """ + + self._tangible_assets_book_value_per_share = tangible_assets_book_value_per_share + + @property + def working_capital(self): + """Gets the working_capital of this Financials. # noqa: E501 + + + :return: The working_capital of this Financials. # noqa: E501 + :rtype: int + """ + return self._working_capital + + @working_capital.setter + def working_capital(self, working_capital): + """Sets the working_capital of this Financials. + + + :param working_capital: The working_capital of this Financials. # noqa: E501 + :type: int + """ + + self._working_capital = working_capital + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Financials, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Financials): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/forex.py b/polygon/rest/models/forex.py new file mode 100644 index 00000000..22972e3f --- /dev/null +++ b/polygon/rest/models/forex.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Forex(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'a': 'int', + 'b': 'int', + 't': 'int' + } + + attribute_map = { + 'a': 'a', + 'b': 'b', + 't': 't' + } + + def __init__(self, a=None, b=None, t=None): # noqa: E501 + """Forex - a model defined in Swagger""" # noqa: E501 + self._a = None + self._b = None + self._t = None + self.discriminator = None + self.a = a + self.b = b + self.t = t + + @property + def a(self): + """Gets the a of this Forex. # noqa: E501 + + Ask price # noqa: E501 + + :return: The a of this Forex. # noqa: E501 + :rtype: int + """ + return self._a + + @a.setter + def a(self, a): + """Sets the a of this Forex. + + Ask price # noqa: E501 + + :param a: The a of this Forex. # noqa: E501 + :type: int + """ + if a is None: + raise ValueError("Invalid value for `a`, must not be `None`") # noqa: E501 + + self._a = a + + @property + def b(self): + """Gets the b of this Forex. # noqa: E501 + + Bid price # noqa: E501 + + :return: The b of this Forex. # noqa: E501 + :rtype: int + """ + return self._b + + @b.setter + def b(self, b): + """Sets the b of this Forex. + + Bid price # noqa: E501 + + :param b: The b of this Forex. # noqa: E501 + :type: int + """ + if b is None: + raise ValueError("Invalid value for `b`, must not be `None`") # noqa: E501 + + self._b = b + + @property + def t(self): + """Gets the t of this Forex. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The t of this Forex. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Forex. + + Timestamp of this trade # noqa: E501 + + :param t: The t of this Forex. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Forex, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Forex): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/forex_aggregate.py b/polygon/rest/models/forex_aggregate.py new file mode 100644 index 00000000..76520d90 --- /dev/null +++ b/polygon/rest/models/forex_aggregate.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ForexAggregate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'o': 'int', + 'c': 'int', + 'l': 'int', + 'h': 'int', + 'v': 'int', + 't': 'int' + } + + attribute_map = { + 'o': 'o', + 'c': 'c', + 'l': 'l', + 'h': 'h', + 'v': 'v', + 't': 't' + } + + def __init__(self, o=None, c=None, l=None, h=None, v=None, t=None): # noqa: E501 + """ForexAggregate - a model defined in Swagger""" # noqa: E501 + self._o = None + self._c = None + self._l = None + self._h = None + self._v = None + self._t = None + self.discriminator = None + self.o = o + self.c = c + self.l = l + self.h = h + self.v = v + self.t = t + + @property + def o(self): + """Gets the o of this ForexAggregate. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this ForexAggregate. + + Open price # noqa: E501 + + :param o: The o of this ForexAggregate. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def c(self): + """Gets the c of this ForexAggregate. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this ForexAggregate. + + Close price # noqa: E501 + + :param c: The c of this ForexAggregate. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def l(self): + """Gets the l of this ForexAggregate. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this ForexAggregate. + + Low price # noqa: E501 + + :param l: The l of this ForexAggregate. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def h(self): + """Gets the h of this ForexAggregate. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this ForexAggregate. + + High price # noqa: E501 + + :param h: The h of this ForexAggregate. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def v(self): + """Gets the v of this ForexAggregate. # noqa: E501 + + Volume of all trades ( Number of bid/asks during this timespan ) # noqa: E501 + + :return: The v of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this ForexAggregate. + + Volume of all trades ( Number of bid/asks during this timespan ) # noqa: E501 + + :param v: The v of this ForexAggregate. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + @property + def t(self): + """Gets the t of this ForexAggregate. # noqa: E501 + + Timestamp of this aggregation # noqa: E501 + + :return: The t of this ForexAggregate. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this ForexAggregate. + + Timestamp of this aggregation # noqa: E501 + + :param t: The t of this ForexAggregate. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ForexAggregate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ForexAggregate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/forex_snapshot_agg.py b/polygon/rest/models/forex_snapshot_agg.py new file mode 100644 index 00000000..2ec988aa --- /dev/null +++ b/polygon/rest/models/forex_snapshot_agg.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ForexSnapshotAgg(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'c': 'int', + 'h': 'int', + 'l': 'int', + 'o': 'int', + 'v': 'int' + } + + attribute_map = { + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o', + 'v': 'v' + } + + def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 + """ForexSnapshotAgg - a model defined in Swagger""" # noqa: E501 + self._c = None + self._h = None + self._l = None + self._o = None + self._v = None + self.discriminator = None + self.c = c + self.h = h + self.l = l + self.o = o + self.v = v + + @property + def c(self): + """Gets the c of this ForexSnapshotAgg. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this ForexSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this ForexSnapshotAgg. + + Close price # noqa: E501 + + :param c: The c of this ForexSnapshotAgg. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def h(self): + """Gets the h of this ForexSnapshotAgg. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this ForexSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this ForexSnapshotAgg. + + High price # noqa: E501 + + :param h: The h of this ForexSnapshotAgg. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def l(self): + """Gets the l of this ForexSnapshotAgg. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this ForexSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this ForexSnapshotAgg. + + Low price # noqa: E501 + + :param l: The l of this ForexSnapshotAgg. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def o(self): + """Gets the o of this ForexSnapshotAgg. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this ForexSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this ForexSnapshotAgg. + + Open price # noqa: E501 + + :param o: The o of this ForexSnapshotAgg. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def v(self): + """Gets the v of this ForexSnapshotAgg. # noqa: E501 + + Volume # noqa: E501 + + :return: The v of this ForexSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this ForexSnapshotAgg. + + Volume # noqa: E501 + + :param v: The v of this ForexSnapshotAgg. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ForexSnapshotAgg, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ForexSnapshotAgg): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/forex_snapshot_ticker.py b/polygon/rest/models/forex_snapshot_ticker.py new file mode 100644 index 00000000..ff6589c5 --- /dev/null +++ b/polygon/rest/models/forex_snapshot_ticker.py @@ -0,0 +1,309 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ForexSnapshotTicker(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'day': 'ForexSnapshotAgg', + 'last_trade': 'Forex', + 'min': 'ForexSnapshotAgg', + 'prev_day': 'ForexSnapshotAgg', + 'todays_change': 'int', + 'todays_change_perc': 'int', + 'updated': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'day': 'day', + 'last_trade': 'lastTrade', + 'min': 'min', + 'prev_day': 'prevDay', + 'todays_change': 'todaysChange', + 'todays_change_perc': 'todaysChangePerc', + 'updated': 'updated' + } + + def __init__(self, ticker=None, day=None, last_trade=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 + """ForexSnapshotTicker - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._day = None + self._last_trade = None + self._min = None + self._prev_day = None + self._todays_change = None + self._todays_change_perc = None + self._updated = None + self.discriminator = None + self.ticker = ticker + self.day = day + self.last_trade = last_trade + self.min = min + self.prev_day = prev_day + self.todays_change = todays_change + self.todays_change_perc = todays_change_perc + self.updated = updated + + @property + def ticker(self): + """Gets the ticker of this ForexSnapshotTicker. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The ticker of this ForexSnapshotTicker. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this ForexSnapshotTicker. + + Ticker of the object # noqa: E501 + + :param ticker: The ticker of this ForexSnapshotTicker. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def day(self): + """Gets the day of this ForexSnapshotTicker. # noqa: E501 + + + :return: The day of this ForexSnapshotTicker. # noqa: E501 + :rtype: ForexSnapshotAgg + """ + return self._day + + @day.setter + def day(self, day): + """Sets the day of this ForexSnapshotTicker. + + + :param day: The day of this ForexSnapshotTicker. # noqa: E501 + :type: ForexSnapshotAgg + """ + if day is None: + raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 + + self._day = day + + @property + def last_trade(self): + """Gets the last_trade of this ForexSnapshotTicker. # noqa: E501 + + + :return: The last_trade of this ForexSnapshotTicker. # noqa: E501 + :rtype: Forex + """ + return self._last_trade + + @last_trade.setter + def last_trade(self, last_trade): + """Sets the last_trade of this ForexSnapshotTicker. + + + :param last_trade: The last_trade of this ForexSnapshotTicker. # noqa: E501 + :type: Forex + """ + if last_trade is None: + raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 + + self._last_trade = last_trade + + @property + def min(self): + """Gets the min of this ForexSnapshotTicker. # noqa: E501 + + + :return: The min of this ForexSnapshotTicker. # noqa: E501 + :rtype: ForexSnapshotAgg + """ + return self._min + + @min.setter + def min(self, min): + """Sets the min of this ForexSnapshotTicker. + + + :param min: The min of this ForexSnapshotTicker. # noqa: E501 + :type: ForexSnapshotAgg + """ + if min is None: + raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 + + self._min = min + + @property + def prev_day(self): + """Gets the prev_day of this ForexSnapshotTicker. # noqa: E501 + + + :return: The prev_day of this ForexSnapshotTicker. # noqa: E501 + :rtype: ForexSnapshotAgg + """ + return self._prev_day + + @prev_day.setter + def prev_day(self, prev_day): + """Sets the prev_day of this ForexSnapshotTicker. + + + :param prev_day: The prev_day of this ForexSnapshotTicker. # noqa: E501 + :type: ForexSnapshotAgg + """ + if prev_day is None: + raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 + + self._prev_day = prev_day + + @property + def todays_change(self): + """Gets the todays_change of this ForexSnapshotTicker. # noqa: E501 + + Value of the change from previous day # noqa: E501 + + :return: The todays_change of this ForexSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change + + @todays_change.setter + def todays_change(self, todays_change): + """Sets the todays_change of this ForexSnapshotTicker. + + Value of the change from previous day # noqa: E501 + + :param todays_change: The todays_change of this ForexSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change is None: + raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 + + self._todays_change = todays_change + + @property + def todays_change_perc(self): + """Gets the todays_change_perc of this ForexSnapshotTicker. # noqa: E501 + + Percentage change since previous day # noqa: E501 + + :return: The todays_change_perc of this ForexSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change_perc + + @todays_change_perc.setter + def todays_change_perc(self, todays_change_perc): + """Sets the todays_change_perc of this ForexSnapshotTicker. + + Percentage change since previous day # noqa: E501 + + :param todays_change_perc: The todays_change_perc of this ForexSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change_perc is None: + raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 + + self._todays_change_perc = todays_change_perc + + @property + def updated(self): + """Gets the updated of this ForexSnapshotTicker. # noqa: E501 + + Last Updated timestamp # noqa: E501 + + :return: The updated of this ForexSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this ForexSnapshotTicker. + + Last Updated timestamp # noqa: E501 + + :param updated: The updated of this ForexSnapshotTicker. # noqa: E501 + :type: int + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ForexSnapshotTicker, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ForexSnapshotTicker): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/hist_trade.py b/polygon/rest/models/hist_trade.py new file mode 100644 index 00000000..64be5402 --- /dev/null +++ b/polygon/rest/models/hist_trade.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class HistTrade(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'condition1': 'int', + 'condition2': 'int', + 'condition3': 'int', + 'condition4': 'int', + 'exchange': 'str', + 'price': 'int', + 'size': 'int', + 'timestamp': 'str' + } + + attribute_map = { + 'condition1': 'condition1', + 'condition2': 'condition2', + 'condition3': 'condition3', + 'condition4': 'condition4', + 'exchange': 'exchange', + 'price': 'price', + 'size': 'size', + 'timestamp': 'timestamp' + } + + def __init__(self, condition1=None, condition2=None, condition3=None, condition4=None, exchange=None, price=None, size=None, timestamp=None): # noqa: E501 + """HistTrade - a model defined in Swagger""" # noqa: E501 + self._condition1 = None + self._condition2 = None + self._condition3 = None + self._condition4 = None + self._exchange = None + self._price = None + self._size = None + self._timestamp = None + self.discriminator = None + self.condition1 = condition1 + self.condition2 = condition2 + self.condition3 = condition3 + self.condition4 = condition4 + self.exchange = exchange + self.price = price + self.size = size + self.timestamp = timestamp + + @property + def condition1(self): + """Gets the condition1 of this HistTrade. # noqa: E501 + + Condition 1 of this trade # noqa: E501 + + :return: The condition1 of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._condition1 + + @condition1.setter + def condition1(self, condition1): + """Sets the condition1 of this HistTrade. + + Condition 1 of this trade # noqa: E501 + + :param condition1: The condition1 of this HistTrade. # noqa: E501 + :type: int + """ + if condition1 is None: + raise ValueError("Invalid value for `condition1`, must not be `None`") # noqa: E501 + + self._condition1 = condition1 + + @property + def condition2(self): + """Gets the condition2 of this HistTrade. # noqa: E501 + + Condition 2 of this trade # noqa: E501 + + :return: The condition2 of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._condition2 + + @condition2.setter + def condition2(self, condition2): + """Sets the condition2 of this HistTrade. + + Condition 2 of this trade # noqa: E501 + + :param condition2: The condition2 of this HistTrade. # noqa: E501 + :type: int + """ + if condition2 is None: + raise ValueError("Invalid value for `condition2`, must not be `None`") # noqa: E501 + + self._condition2 = condition2 + + @property + def condition3(self): + """Gets the condition3 of this HistTrade. # noqa: E501 + + Condition 3 of this trade # noqa: E501 + + :return: The condition3 of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._condition3 + + @condition3.setter + def condition3(self, condition3): + """Sets the condition3 of this HistTrade. + + Condition 3 of this trade # noqa: E501 + + :param condition3: The condition3 of this HistTrade. # noqa: E501 + :type: int + """ + if condition3 is None: + raise ValueError("Invalid value for `condition3`, must not be `None`") # noqa: E501 + + self._condition3 = condition3 + + @property + def condition4(self): + """Gets the condition4 of this HistTrade. # noqa: E501 + + Condition 4 of this trade # noqa: E501 + + :return: The condition4 of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._condition4 + + @condition4.setter + def condition4(self, condition4): + """Sets the condition4 of this HistTrade. + + Condition 4 of this trade # noqa: E501 + + :param condition4: The condition4 of this HistTrade. # noqa: E501 + :type: int + """ + if condition4 is None: + raise ValueError("Invalid value for `condition4`, must not be `None`") # noqa: E501 + + self._condition4 = condition4 + + @property + def exchange(self): + """Gets the exchange of this HistTrade. # noqa: E501 + + The exchange this trade happened on # noqa: E501 + + :return: The exchange of this HistTrade. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this HistTrade. + + The exchange this trade happened on # noqa: E501 + + :param exchange: The exchange of this HistTrade. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def price(self): + """Gets the price of this HistTrade. # noqa: E501 + + Price of the trade # noqa: E501 + + :return: The price of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this HistTrade. + + Price of the trade # noqa: E501 + + :param price: The price of this HistTrade. # noqa: E501 + :type: int + """ + if price is None: + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def size(self): + """Gets the size of this HistTrade. # noqa: E501 + + Size of the trade # noqa: E501 + + :return: The size of this HistTrade. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this HistTrade. + + Size of the trade # noqa: E501 + + :param size: The size of this HistTrade. # noqa: E501 + :type: int + """ + if size is None: + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 + + self._size = size + + @property + def timestamp(self): + """Gets the timestamp of this HistTrade. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this HistTrade. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this HistTrade. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this HistTrade. # noqa: E501 + :type: str + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(HistTrade, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HistTrade): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/last_forex_quote.py b/polygon/rest/models/last_forex_quote.py new file mode 100644 index 00000000..962b0f91 --- /dev/null +++ b/polygon/rest/models/last_forex_quote.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class LastForexQuote(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ask': 'int', + 'bid': 'int', + 'exchange': 'int', + 'timestamp': 'int' + } + + attribute_map = { + 'ask': 'ask', + 'bid': 'bid', + 'exchange': 'exchange', + 'timestamp': 'timestamp' + } + + def __init__(self, ask=None, bid=None, exchange=None, timestamp=None): # noqa: E501 + """LastForexQuote - a model defined in Swagger""" # noqa: E501 + self._ask = None + self._bid = None + self._exchange = None + self._timestamp = None + self.discriminator = None + self.ask = ask + self.bid = bid + self.exchange = exchange + self.timestamp = timestamp + + @property + def ask(self): + """Gets the ask of this LastForexQuote. # noqa: E501 + + Ask Price # noqa: E501 + + :return: The ask of this LastForexQuote. # noqa: E501 + :rtype: int + """ + return self._ask + + @ask.setter + def ask(self, ask): + """Sets the ask of this LastForexQuote. + + Ask Price # noqa: E501 + + :param ask: The ask of this LastForexQuote. # noqa: E501 + :type: int + """ + if ask is None: + raise ValueError("Invalid value for `ask`, must not be `None`") # noqa: E501 + + self._ask = ask + + @property + def bid(self): + """Gets the bid of this LastForexQuote. # noqa: E501 + + Bid Price # noqa: E501 + + :return: The bid of this LastForexQuote. # noqa: E501 + :rtype: int + """ + return self._bid + + @bid.setter + def bid(self, bid): + """Sets the bid of this LastForexQuote. + + Bid Price # noqa: E501 + + :param bid: The bid of this LastForexQuote. # noqa: E501 + :type: int + """ + if bid is None: + raise ValueError("Invalid value for `bid`, must not be `None`") # noqa: E501 + + self._bid = bid + + @property + def exchange(self): + """Gets the exchange of this LastForexQuote. # noqa: E501 + + Exchange this trade happened on # noqa: E501 + + :return: The exchange of this LastForexQuote. # noqa: E501 + :rtype: int + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this LastForexQuote. + + Exchange this trade happened on # noqa: E501 + + :param exchange: The exchange of this LastForexQuote. # noqa: E501 + :type: int + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def timestamp(self): + """Gets the timestamp of this LastForexQuote. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this LastForexQuote. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this LastForexQuote. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this LastForexQuote. # noqa: E501 + :type: int + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LastForexQuote, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LastForexQuote): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/last_forex_trade.py b/polygon/rest/models/last_forex_trade.py new file mode 100644 index 00000000..57eef4b3 --- /dev/null +++ b/polygon/rest/models/last_forex_trade.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class LastForexTrade(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'price': 'int', + 'exchange': 'int', + 'timestamp': 'int' + } + + attribute_map = { + 'price': 'price', + 'exchange': 'exchange', + 'timestamp': 'timestamp' + } + + def __init__(self, price=None, exchange=None, timestamp=None): # noqa: E501 + """LastForexTrade - a model defined in Swagger""" # noqa: E501 + self._price = None + self._exchange = None + self._timestamp = None + self.discriminator = None + self.price = price + self.exchange = exchange + self.timestamp = timestamp + + @property + def price(self): + """Gets the price of this LastForexTrade. # noqa: E501 + + Price of the trade # noqa: E501 + + :return: The price of this LastForexTrade. # noqa: E501 + :rtype: int + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this LastForexTrade. + + Price of the trade # noqa: E501 + + :param price: The price of this LastForexTrade. # noqa: E501 + :type: int + """ + if price is None: + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def exchange(self): + """Gets the exchange of this LastForexTrade. # noqa: E501 + + Exchange this trade happened on # noqa: E501 + + :return: The exchange of this LastForexTrade. # noqa: E501 + :rtype: int + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this LastForexTrade. + + Exchange this trade happened on # noqa: E501 + + :param exchange: The exchange of this LastForexTrade. # noqa: E501 + :type: int + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def timestamp(self): + """Gets the timestamp of this LastForexTrade. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this LastForexTrade. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this LastForexTrade. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this LastForexTrade. # noqa: E501 + :type: int + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LastForexTrade, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LastForexTrade): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/last_quote.py b/polygon/rest/models/last_quote.py new file mode 100644 index 00000000..3b3e1eee --- /dev/null +++ b/polygon/rest/models/last_quote.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class LastQuote(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'askprice': 'int', + 'asksize': 'int', + 'askexchange': 'int', + 'bidprice': 'int', + 'bidsize': 'int', + 'bidexchange': 'int', + 'timestamp': 'int' + } + + attribute_map = { + 'askprice': 'askprice', + 'asksize': 'asksize', + 'askexchange': 'askexchange', + 'bidprice': 'bidprice', + 'bidsize': 'bidsize', + 'bidexchange': 'bidexchange', + 'timestamp': 'timestamp' + } + + def __init__(self, askprice=None, asksize=None, askexchange=None, bidprice=None, bidsize=None, bidexchange=None, timestamp=None): # noqa: E501 + """LastQuote - a model defined in Swagger""" # noqa: E501 + self._askprice = None + self._asksize = None + self._askexchange = None + self._bidprice = None + self._bidsize = None + self._bidexchange = None + self._timestamp = None + self.discriminator = None + self.askprice = askprice + self.asksize = asksize + self.askexchange = askexchange + self.bidprice = bidprice + self.bidsize = bidsize + self.bidexchange = bidexchange + self.timestamp = timestamp + + @property + def askprice(self): + """Gets the askprice of this LastQuote. # noqa: E501 + + Ask Price # noqa: E501 + + :return: The askprice of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._askprice + + @askprice.setter + def askprice(self, askprice): + """Sets the askprice of this LastQuote. + + Ask Price # noqa: E501 + + :param askprice: The askprice of this LastQuote. # noqa: E501 + :type: int + """ + if askprice is None: + raise ValueError("Invalid value for `askprice`, must not be `None`") # noqa: E501 + + self._askprice = askprice + + @property + def asksize(self): + """Gets the asksize of this LastQuote. # noqa: E501 + + Ask Size # noqa: E501 + + :return: The asksize of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._asksize + + @asksize.setter + def asksize(self, asksize): + """Sets the asksize of this LastQuote. + + Ask Size # noqa: E501 + + :param asksize: The asksize of this LastQuote. # noqa: E501 + :type: int + """ + if asksize is None: + raise ValueError("Invalid value for `asksize`, must not be `None`") # noqa: E501 + + self._asksize = asksize + + @property + def askexchange(self): + """Gets the askexchange of this LastQuote. # noqa: E501 + + Exchange the ask happened on # noqa: E501 + + :return: The askexchange of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._askexchange + + @askexchange.setter + def askexchange(self, askexchange): + """Sets the askexchange of this LastQuote. + + Exchange the ask happened on # noqa: E501 + + :param askexchange: The askexchange of this LastQuote. # noqa: E501 + :type: int + """ + if askexchange is None: + raise ValueError("Invalid value for `askexchange`, must not be `None`") # noqa: E501 + + self._askexchange = askexchange + + @property + def bidprice(self): + """Gets the bidprice of this LastQuote. # noqa: E501 + + Bid Price # noqa: E501 + + :return: The bidprice of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._bidprice + + @bidprice.setter + def bidprice(self, bidprice): + """Sets the bidprice of this LastQuote. + + Bid Price # noqa: E501 + + :param bidprice: The bidprice of this LastQuote. # noqa: E501 + :type: int + """ + if bidprice is None: + raise ValueError("Invalid value for `bidprice`, must not be `None`") # noqa: E501 + + self._bidprice = bidprice + + @property + def bidsize(self): + """Gets the bidsize of this LastQuote. # noqa: E501 + + Bid Size # noqa: E501 + + :return: The bidsize of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._bidsize + + @bidsize.setter + def bidsize(self, bidsize): + """Sets the bidsize of this LastQuote. + + Bid Size # noqa: E501 + + :param bidsize: The bidsize of this LastQuote. # noqa: E501 + :type: int + """ + if bidsize is None: + raise ValueError("Invalid value for `bidsize`, must not be `None`") # noqa: E501 + + self._bidsize = bidsize + + @property + def bidexchange(self): + """Gets the bidexchange of this LastQuote. # noqa: E501 + + Exchange the bid happened on # noqa: E501 + + :return: The bidexchange of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._bidexchange + + @bidexchange.setter + def bidexchange(self, bidexchange): + """Sets the bidexchange of this LastQuote. + + Exchange the bid happened on # noqa: E501 + + :param bidexchange: The bidexchange of this LastQuote. # noqa: E501 + :type: int + """ + if bidexchange is None: + raise ValueError("Invalid value for `bidexchange`, must not be `None`") # noqa: E501 + + self._bidexchange = bidexchange + + @property + def timestamp(self): + """Gets the timestamp of this LastQuote. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this LastQuote. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this LastQuote. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this LastQuote. # noqa: E501 + :type: int + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LastQuote, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LastQuote): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/last_trade.py b/polygon/rest/models/last_trade.py new file mode 100644 index 00000000..24243c30 --- /dev/null +++ b/polygon/rest/models/last_trade.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class LastTrade(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'price': 'int', + 'size': 'int', + 'exchange': 'int', + 'cond1': 'int', + 'cond2': 'int', + 'cond3': 'int', + 'cond4': 'int', + 'timestamp': 'int' + } + + attribute_map = { + 'price': 'price', + 'size': 'size', + 'exchange': 'exchange', + 'cond1': 'cond1', + 'cond2': 'cond2', + 'cond3': 'cond3', + 'cond4': 'cond4', + 'timestamp': 'timestamp' + } + + def __init__(self, price=None, size=None, exchange=None, cond1=None, cond2=None, cond3=None, cond4=None, timestamp=None): # noqa: E501 + """LastTrade - a model defined in Swagger""" # noqa: E501 + self._price = None + self._size = None + self._exchange = None + self._cond1 = None + self._cond2 = None + self._cond3 = None + self._cond4 = None + self._timestamp = None + self.discriminator = None + self.price = price + self.size = size + self.exchange = exchange + self.cond1 = cond1 + self.cond2 = cond2 + self.cond3 = cond3 + self.cond4 = cond4 + self.timestamp = timestamp + + @property + def price(self): + """Gets the price of this LastTrade. # noqa: E501 + + Price of the trade # noqa: E501 + + :return: The price of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this LastTrade. + + Price of the trade # noqa: E501 + + :param price: The price of this LastTrade. # noqa: E501 + :type: int + """ + if price is None: + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def size(self): + """Gets the size of this LastTrade. # noqa: E501 + + Size of this trade # noqa: E501 + + :return: The size of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this LastTrade. + + Size of this trade # noqa: E501 + + :param size: The size of this LastTrade. # noqa: E501 + :type: int + """ + if size is None: + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 + + self._size = size + + @property + def exchange(self): + """Gets the exchange of this LastTrade. # noqa: E501 + + Exchange this trade happened on # noqa: E501 + + :return: The exchange of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this LastTrade. + + Exchange this trade happened on # noqa: E501 + + :param exchange: The exchange of this LastTrade. # noqa: E501 + :type: int + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + + self._exchange = exchange + + @property + def cond1(self): + """Gets the cond1 of this LastTrade. # noqa: E501 + + Condition 1 of the trade # noqa: E501 + + :return: The cond1 of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._cond1 + + @cond1.setter + def cond1(self, cond1): + """Sets the cond1 of this LastTrade. + + Condition 1 of the trade # noqa: E501 + + :param cond1: The cond1 of this LastTrade. # noqa: E501 + :type: int + """ + if cond1 is None: + raise ValueError("Invalid value for `cond1`, must not be `None`") # noqa: E501 + + self._cond1 = cond1 + + @property + def cond2(self): + """Gets the cond2 of this LastTrade. # noqa: E501 + + Condition 2 of the trade # noqa: E501 + + :return: The cond2 of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._cond2 + + @cond2.setter + def cond2(self, cond2): + """Sets the cond2 of this LastTrade. + + Condition 2 of the trade # noqa: E501 + + :param cond2: The cond2 of this LastTrade. # noqa: E501 + :type: int + """ + if cond2 is None: + raise ValueError("Invalid value for `cond2`, must not be `None`") # noqa: E501 + + self._cond2 = cond2 + + @property + def cond3(self): + """Gets the cond3 of this LastTrade. # noqa: E501 + + Condition 3 of the trade # noqa: E501 + + :return: The cond3 of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._cond3 + + @cond3.setter + def cond3(self, cond3): + """Sets the cond3 of this LastTrade. + + Condition 3 of the trade # noqa: E501 + + :param cond3: The cond3 of this LastTrade. # noqa: E501 + :type: int + """ + if cond3 is None: + raise ValueError("Invalid value for `cond3`, must not be `None`") # noqa: E501 + + self._cond3 = cond3 + + @property + def cond4(self): + """Gets the cond4 of this LastTrade. # noqa: E501 + + Condition 4 of the trade # noqa: E501 + + :return: The cond4 of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._cond4 + + @cond4.setter + def cond4(self, cond4): + """Sets the cond4 of this LastTrade. + + Condition 4 of the trade # noqa: E501 + + :param cond4: The cond4 of this LastTrade. # noqa: E501 + :type: int + """ + if cond4 is None: + raise ValueError("Invalid value for `cond4`, must not be `None`") # noqa: E501 + + self._cond4 = cond4 + + @property + def timestamp(self): + """Gets the timestamp of this LastTrade. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The timestamp of this LastTrade. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this LastTrade. + + Timestamp of this trade # noqa: E501 + + :param timestamp: The timestamp of this LastTrade. # noqa: E501 + :type: int + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LastTrade, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LastTrade): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/market_holiday.py b/polygon/rest/models/market_holiday.py new file mode 100644 index 00000000..97164cf6 --- /dev/null +++ b/polygon/rest/models/market_holiday.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class MarketHoliday(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'exchange': 'str', + 'name': 'str', + 'status': 'str', + '_date': 'datetime', + 'open': 'datetime', + 'close': 'datetime' + } + + attribute_map = { + 'exchange': 'exchange', + 'name': 'name', + 'status': 'status', + '_date': 'date', + 'open': 'open', + 'close': 'close' + } + + def __init__(self, exchange=None, name=None, status=None, _date=None, open=None, close=None): # noqa: E501 + """MarketHoliday - a model defined in Swagger""" # noqa: E501 + self._exchange = None + self._name = None + self._status = None + self.__date = None + self._open = None + self._close = None + self.discriminator = None + self.exchange = exchange + self.name = name + self.status = status + self._date = _date + if open is not None: + self.open = open + if close is not None: + self.close = close + + @property + def exchange(self): + """Gets the exchange of this MarketHoliday. # noqa: E501 + + Which market this record is for # noqa: E501 + + :return: The exchange of this MarketHoliday. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this MarketHoliday. + + Which market this record is for # noqa: E501 + + :param exchange: The exchange of this MarketHoliday. # noqa: E501 + :type: str + """ + if exchange is None: + raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 + allowed_values = ["NYSE", "NASDAQ", "OTC"] # noqa: E501 + if exchange not in allowed_values: + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def name(self): + """Gets the name of this MarketHoliday. # noqa: E501 + + Human readable description of the holiday # noqa: E501 + + :return: The name of this MarketHoliday. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MarketHoliday. + + Human readable description of the holiday # noqa: E501 + + :param name: The name of this MarketHoliday. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def status(self): + """Gets the status of this MarketHoliday. # noqa: E501 + + Status of the market on this holiday # noqa: E501 + + :return: The status of this MarketHoliday. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this MarketHoliday. + + Status of the market on this holiday # noqa: E501 + + :param status: The status of this MarketHoliday. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["closed", "early-close", "late-close", "early-open", "late-open"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def _date(self): + """Gets the _date of this MarketHoliday. # noqa: E501 + + Date of this holiday # noqa: E501 + + :return: The _date of this MarketHoliday. # noqa: E501 + :rtype: datetime + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this MarketHoliday. + + Date of this holiday # noqa: E501 + + :param _date: The _date of this MarketHoliday. # noqa: E501 + :type: datetime + """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 + + self.__date = _date + + @property + def open(self): + """Gets the open of this MarketHoliday. # noqa: E501 + + Market open time on this holiday ( if it's not closed ) # noqa: E501 + + :return: The open of this MarketHoliday. # noqa: E501 + :rtype: datetime + """ + return self._open + + @open.setter + def open(self, open): + """Sets the open of this MarketHoliday. + + Market open time on this holiday ( if it's not closed ) # noqa: E501 + + :param open: The open of this MarketHoliday. # noqa: E501 + :type: datetime + """ + + self._open = open + + @property + def close(self): + """Gets the close of this MarketHoliday. # noqa: E501 + + Market close time on this holiday ( if it's not closed ) # noqa: E501 + + :return: The close of this MarketHoliday. # noqa: E501 + :rtype: datetime + """ + return self._close + + @close.setter + def close(self, close): + """Sets the close of this MarketHoliday. + + Market close time on this holiday ( if it's not closed ) # noqa: E501 + + :param close: The close of this MarketHoliday. # noqa: E501 + :type: datetime + """ + + self._close = close + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MarketHoliday, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarketHoliday): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/market_status.py b/polygon/rest/models/market_status.py new file mode 100644 index 00000000..c10f3f5a --- /dev/null +++ b/polygon/rest/models/market_status.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class MarketStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'market': 'str', + 'server_time': 'datetime', + 'exchanges': 'object', + 'currencies': 'object' + } + + attribute_map = { + 'market': 'market', + 'server_time': 'serverTime', + 'exchanges': 'exchanges', + 'currencies': 'currencies' + } + + def __init__(self, market=None, server_time=None, exchanges=None, currencies=None): # noqa: E501 + """MarketStatus - a model defined in Swagger""" # noqa: E501 + self._market = None + self._server_time = None + self._exchanges = None + self._currencies = None + self.discriminator = None + self.market = market + self.server_time = server_time + self.exchanges = exchanges + if currencies is not None: + self.currencies = currencies + + @property + def market(self): + """Gets the market of this MarketStatus. # noqa: E501 + + Status of the market as a whole # noqa: E501 + + :return: The market of this MarketStatus. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this MarketStatus. + + Status of the market as a whole # noqa: E501 + + :param market: The market of this MarketStatus. # noqa: E501 + :type: str + """ + if market is None: + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + allowed_values = ["open", "closed", "extended-hours"] # noqa: E501 + if market not in allowed_values: + raise ValueError( + "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 + .format(market, allowed_values) + ) + + self._market = market + + @property + def server_time(self): + """Gets the server_time of this MarketStatus. # noqa: E501 + + Current time of the server # noqa: E501 + + :return: The server_time of this MarketStatus. # noqa: E501 + :rtype: datetime + """ + return self._server_time + + @server_time.setter + def server_time(self, server_time): + """Sets the server_time of this MarketStatus. + + Current time of the server # noqa: E501 + + :param server_time: The server_time of this MarketStatus. # noqa: E501 + :type: datetime + """ + if server_time is None: + raise ValueError("Invalid value for `server_time`, must not be `None`") # noqa: E501 + + self._server_time = server_time + + @property + def exchanges(self): + """Gets the exchanges of this MarketStatus. # noqa: E501 + + + :return: The exchanges of this MarketStatus. # noqa: E501 + :rtype: object + """ + return self._exchanges + + @exchanges.setter + def exchanges(self, exchanges): + """Sets the exchanges of this MarketStatus. + + + :param exchanges: The exchanges of this MarketStatus. # noqa: E501 + :type: object + """ + if exchanges is None: + raise ValueError("Invalid value for `exchanges`, must not be `None`") # noqa: E501 + + self._exchanges = exchanges + + @property + def currencies(self): + """Gets the currencies of this MarketStatus. # noqa: E501 + + + :return: The currencies of this MarketStatus. # noqa: E501 + :rtype: object + """ + return self._currencies + + @currencies.setter + def currencies(self, currencies): + """Sets the currencies of this MarketStatus. + + + :param currencies: The currencies of this MarketStatus. # noqa: E501 + :type: object + """ + + self._currencies = currencies + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MarketStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarketStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/news.py b/polygon/rest/models/news.py new file mode 100644 index 00000000..125fd72c --- /dev/null +++ b/polygon/rest/models/news.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class News(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbols': 'list[StockSymbol]', + 'title': 'str', + 'url': 'str', + 'source': 'str', + 'summary': 'str', + 'image': 'str', + 'timestamp': 'datetime', + 'keywords': 'list[object]' + } + + attribute_map = { + 'symbols': 'symbols', + 'title': 'title', + 'url': 'url', + 'source': 'source', + 'summary': 'summary', + 'image': 'image', + 'timestamp': 'timestamp', + 'keywords': 'keywords' + } + + def __init__(self, symbols=None, title=None, url=None, source=None, summary=None, image=None, timestamp=None, keywords=None): # noqa: E501 + """News - a model defined in Swagger""" # noqa: E501 + self._symbols = None + self._title = None + self._url = None + self._source = None + self._summary = None + self._image = None + self._timestamp = None + self._keywords = None + self.discriminator = None + self.symbols = symbols + self.title = title + self.url = url + self.source = source + self.summary = summary + if image is not None: + self.image = image + self.timestamp = timestamp + if keywords is not None: + self.keywords = keywords + + @property + def symbols(self): + """Gets the symbols of this News. # noqa: E501 + + + :return: The symbols of this News. # noqa: E501 + :rtype: list[StockSymbol] + """ + return self._symbols + + @symbols.setter + def symbols(self, symbols): + """Sets the symbols of this News. + + + :param symbols: The symbols of this News. # noqa: E501 + :type: list[StockSymbol] + """ + if symbols is None: + raise ValueError("Invalid value for `symbols`, must not be `None`") # noqa: E501 + + self._symbols = symbols + + @property + def title(self): + """Gets the title of this News. # noqa: E501 + + Name of the article # noqa: E501 + + :return: The title of this News. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this News. + + Name of the article # noqa: E501 + + :param title: The title of this News. # noqa: E501 + :type: str + """ + if title is None: + raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + + self._title = title + + @property + def url(self): + """Gets the url of this News. # noqa: E501 + + URL of this article # noqa: E501 + + :return: The url of this News. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this News. + + URL of this article # noqa: E501 + + :param url: The url of this News. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + @property + def source(self): + """Gets the source of this News. # noqa: E501 + + Source of this article # noqa: E501 + + :return: The source of this News. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this News. + + Source of this article # noqa: E501 + + :param source: The source of this News. # noqa: E501 + :type: str + """ + if source is None: + raise ValueError("Invalid value for `source`, must not be `None`") # noqa: E501 + + self._source = source + + @property + def summary(self): + """Gets the summary of this News. # noqa: E501 + + Short summary of the article # noqa: E501 + + :return: The summary of this News. # noqa: E501 + :rtype: str + """ + return self._summary + + @summary.setter + def summary(self, summary): + """Sets the summary of this News. + + Short summary of the article # noqa: E501 + + :param summary: The summary of this News. # noqa: E501 + :type: str + """ + if summary is None: + raise ValueError("Invalid value for `summary`, must not be `None`") # noqa: E501 + + self._summary = summary + + @property + def image(self): + """Gets the image of this News. # noqa: E501 + + URL of the image for this article, if found # noqa: E501 + + :return: The image of this News. # noqa: E501 + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this News. + + URL of the image for this article, if found # noqa: E501 + + :param image: The image of this News. # noqa: E501 + :type: str + """ + + self._image = image + + @property + def timestamp(self): + """Gets the timestamp of this News. # noqa: E501 + + Timestamp of the article # noqa: E501 + + :return: The timestamp of this News. # noqa: E501 + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this News. + + Timestamp of the article # noqa: E501 + + :param timestamp: The timestamp of this News. # noqa: E501 + :type: datetime + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + @property + def keywords(self): + """Gets the keywords of this News. # noqa: E501 + + + :return: The keywords of this News. # noqa: E501 + :rtype: list[object] + """ + return self._keywords + + @keywords.setter + def keywords(self, keywords): + """Sets the keywords of this News. + + + :param keywords: The keywords of this News. # noqa: E501 + :type: list[object] + """ + + self._keywords = keywords + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(News, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, News): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/not_found.py b/polygon/rest/models/not_found.py new file mode 100644 index 00000000..7cbb6a0a --- /dev/null +++ b/polygon/rest/models/not_found.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class NotFound(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'message': 'str' + } + + attribute_map = { + 'message': 'message' + } + + def __init__(self, message=None): # noqa: E501 + """NotFound - a model defined in Swagger""" # noqa: E501 + self._message = None + self.discriminator = None + if message is not None: + self.message = message + + @property + def message(self): + """Gets the message of this NotFound. # noqa: E501 + + + :return: The message of this NotFound. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this NotFound. + + + :param message: The message of this NotFound. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NotFound, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NotFound): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/quote.py b/polygon/rest/models/quote.py new file mode 100644 index 00000000..00d634cf --- /dev/null +++ b/polygon/rest/models/quote.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Quote(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'c': 'int', + 'b_e': 'str', + 'a_e': 'str', + 'a_p': 'int', + 'b_p': 'int', + 'b_s': 'int', + 'a_s': 'int', + 't': 'int' + } + + attribute_map = { + 'c': 'c', + 'b_e': 'bE', + 'a_e': 'aE', + 'a_p': 'aP', + 'b_p': 'bP', + 'b_s': 'bS', + 'a_s': 'aS', + 't': 't' + } + + def __init__(self, c=None, b_e=None, a_e=None, a_p=None, b_p=None, b_s=None, a_s=None, t=None): # noqa: E501 + """Quote - a model defined in Swagger""" # noqa: E501 + self._c = None + self._b_e = None + self._a_e = None + self._a_p = None + self._b_p = None + self._b_s = None + self._a_s = None + self._t = None + self.discriminator = None + self.c = c + self.b_e = b_e + self.a_e = a_e + self.a_p = a_p + self.b_p = b_p + self.b_s = b_s + self.a_s = a_s + self.t = t + + @property + def c(self): + """Gets the c of this Quote. # noqa: E501 + + Condition of this quote # noqa: E501 + + :return: The c of this Quote. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this Quote. + + Condition of this quote # noqa: E501 + + :param c: The c of this Quote. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def b_e(self): + """Gets the b_e of this Quote. # noqa: E501 + + Bid Exchange # noqa: E501 + + :return: The b_e of this Quote. # noqa: E501 + :rtype: str + """ + return self._b_e + + @b_e.setter + def b_e(self, b_e): + """Sets the b_e of this Quote. + + Bid Exchange # noqa: E501 + + :param b_e: The b_e of this Quote. # noqa: E501 + :type: str + """ + if b_e is None: + raise ValueError("Invalid value for `b_e`, must not be `None`") # noqa: E501 + + self._b_e = b_e + + @property + def a_e(self): + """Gets the a_e of this Quote. # noqa: E501 + + Ask Exchange # noqa: E501 + + :return: The a_e of this Quote. # noqa: E501 + :rtype: str + """ + return self._a_e + + @a_e.setter + def a_e(self, a_e): + """Sets the a_e of this Quote. + + Ask Exchange # noqa: E501 + + :param a_e: The a_e of this Quote. # noqa: E501 + :type: str + """ + if a_e is None: + raise ValueError("Invalid value for `a_e`, must not be `None`") # noqa: E501 + + self._a_e = a_e + + @property + def a_p(self): + """Gets the a_p of this Quote. # noqa: E501 + + Ask Price # noqa: E501 + + :return: The a_p of this Quote. # noqa: E501 + :rtype: int + """ + return self._a_p + + @a_p.setter + def a_p(self, a_p): + """Sets the a_p of this Quote. + + Ask Price # noqa: E501 + + :param a_p: The a_p of this Quote. # noqa: E501 + :type: int + """ + if a_p is None: + raise ValueError("Invalid value for `a_p`, must not be `None`") # noqa: E501 + + self._a_p = a_p + + @property + def b_p(self): + """Gets the b_p of this Quote. # noqa: E501 + + Bid Price # noqa: E501 + + :return: The b_p of this Quote. # noqa: E501 + :rtype: int + """ + return self._b_p + + @b_p.setter + def b_p(self, b_p): + """Sets the b_p of this Quote. + + Bid Price # noqa: E501 + + :param b_p: The b_p of this Quote. # noqa: E501 + :type: int + """ + if b_p is None: + raise ValueError("Invalid value for `b_p`, must not be `None`") # noqa: E501 + + self._b_p = b_p + + @property + def b_s(self): + """Gets the b_s of this Quote. # noqa: E501 + + Bid Size # noqa: E501 + + :return: The b_s of this Quote. # noqa: E501 + :rtype: int + """ + return self._b_s + + @b_s.setter + def b_s(self, b_s): + """Sets the b_s of this Quote. + + Bid Size # noqa: E501 + + :param b_s: The b_s of this Quote. # noqa: E501 + :type: int + """ + if b_s is None: + raise ValueError("Invalid value for `b_s`, must not be `None`") # noqa: E501 + + self._b_s = b_s + + @property + def a_s(self): + """Gets the a_s of this Quote. # noqa: E501 + + Ask Size # noqa: E501 + + :return: The a_s of this Quote. # noqa: E501 + :rtype: int + """ + return self._a_s + + @a_s.setter + def a_s(self, a_s): + """Sets the a_s of this Quote. + + Ask Size # noqa: E501 + + :param a_s: The a_s of this Quote. # noqa: E501 + :type: int + """ + if a_s is None: + raise ValueError("Invalid value for `a_s`, must not be `None`") # noqa: E501 + + self._a_s = a_s + + @property + def t(self): + """Gets the t of this Quote. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The t of this Quote. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Quote. + + Timestamp of this trade # noqa: E501 + + :param t: The t of this Quote. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Quote, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Quote): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/rating_section.py b/polygon/rest/models/rating_section.py new file mode 100644 index 00000000..0e3dc7b9 --- /dev/null +++ b/polygon/rest/models/rating_section.py @@ -0,0 +1,257 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class RatingSection(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'current': 'float', + 'month1': 'float', + 'month2': 'float', + 'month3': 'float', + 'month4': 'float', + 'month5': 'float' + } + + attribute_map = { + 'current': 'current', + 'month1': 'month1', + 'month2': 'month2', + 'month3': 'month3', + 'month4': 'month4', + 'month5': 'month5' + } + + def __init__(self, current=None, month1=None, month2=None, month3=None, month4=None, month5=None): # noqa: E501 + """RatingSection - a model defined in Swagger""" # noqa: E501 + self._current = None + self._month1 = None + self._month2 = None + self._month3 = None + self._month4 = None + self._month5 = None + self.discriminator = None + self.current = current + self.month1 = month1 + self.month2 = month2 + self.month3 = month3 + if month4 is not None: + self.month4 = month4 + if month5 is not None: + self.month5 = month5 + + @property + def current(self): + """Gets the current of this RatingSection. # noqa: E501 + + Analyst Rating at current month # noqa: E501 + + :return: The current of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._current + + @current.setter + def current(self, current): + """Sets the current of this RatingSection. + + Analyst Rating at current month # noqa: E501 + + :param current: The current of this RatingSection. # noqa: E501 + :type: float + """ + if current is None: + raise ValueError("Invalid value for `current`, must not be `None`") # noqa: E501 + + self._current = current + + @property + def month1(self): + """Gets the month1 of this RatingSection. # noqa: E501 + + Analyst Ratings at 1 month in the future # noqa: E501 + + :return: The month1 of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._month1 + + @month1.setter + def month1(self, month1): + """Sets the month1 of this RatingSection. + + Analyst Ratings at 1 month in the future # noqa: E501 + + :param month1: The month1 of this RatingSection. # noqa: E501 + :type: float + """ + if month1 is None: + raise ValueError("Invalid value for `month1`, must not be `None`") # noqa: E501 + + self._month1 = month1 + + @property + def month2(self): + """Gets the month2 of this RatingSection. # noqa: E501 + + Analyst Ratings at 2 month in the future # noqa: E501 + + :return: The month2 of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._month2 + + @month2.setter + def month2(self, month2): + """Sets the month2 of this RatingSection. + + Analyst Ratings at 2 month in the future # noqa: E501 + + :param month2: The month2 of this RatingSection. # noqa: E501 + :type: float + """ + if month2 is None: + raise ValueError("Invalid value for `month2`, must not be `None`") # noqa: E501 + + self._month2 = month2 + + @property + def month3(self): + """Gets the month3 of this RatingSection. # noqa: E501 + + Analyst Ratings at 3 month in the future # noqa: E501 + + :return: The month3 of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._month3 + + @month3.setter + def month3(self, month3): + """Sets the month3 of this RatingSection. + + Analyst Ratings at 3 month in the future # noqa: E501 + + :param month3: The month3 of this RatingSection. # noqa: E501 + :type: float + """ + if month3 is None: + raise ValueError("Invalid value for `month3`, must not be `None`") # noqa: E501 + + self._month3 = month3 + + @property + def month4(self): + """Gets the month4 of this RatingSection. # noqa: E501 + + Analyst Ratings at 4 month in the future # noqa: E501 + + :return: The month4 of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._month4 + + @month4.setter + def month4(self, month4): + """Sets the month4 of this RatingSection. + + Analyst Ratings at 4 month in the future # noqa: E501 + + :param month4: The month4 of this RatingSection. # noqa: E501 + :type: float + """ + + self._month4 = month4 + + @property + def month5(self): + """Gets the month5 of this RatingSection. # noqa: E501 + + Analyst Ratings at 5 month in the future # noqa: E501 + + :return: The month5 of this RatingSection. # noqa: E501 + :rtype: float + """ + return self._month5 + + @month5.setter + def month5(self, month5): + """Sets the month5 of this RatingSection. + + Analyst Ratings at 5 month in the future # noqa: E501 + + :param month5: The month5 of this RatingSection. # noqa: E501 + :type: float + """ + + self._month5 = month5 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RatingSection, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RatingSection): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/split.py b/polygon/rest/models/split.py new file mode 100644 index 00000000..1261668f --- /dev/null +++ b/polygon/rest/models/split.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Split(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'TickerSymbol', + 'ex_date': 'datetime', + 'payment_date': 'datetime', + 'record_date': 'datetime', + 'declared_date': 'datetime', + 'ratio': 'float', + 'tofactor': 'float', + 'forfactor': 'float' + } + + attribute_map = { + 'ticker': 'ticker', + 'ex_date': 'exDate', + 'payment_date': 'paymentDate', + 'record_date': 'recordDate', + 'declared_date': 'declaredDate', + 'ratio': 'ratio', + 'tofactor': 'tofactor', + 'forfactor': 'forfactor' + } + + def __init__(self, ticker=None, ex_date=None, payment_date=None, record_date=None, declared_date=None, ratio=None, tofactor=None, forfactor=None): # noqa: E501 + """Split - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._ex_date = None + self._payment_date = None + self._record_date = None + self._declared_date = None + self._ratio = None + self._tofactor = None + self._forfactor = None + self.discriminator = None + self.ticker = ticker + self.ex_date = ex_date + self.payment_date = payment_date + if record_date is not None: + self.record_date = record_date + if declared_date is not None: + self.declared_date = declared_date + self.ratio = ratio + self.tofactor = tofactor + self.forfactor = forfactor + + @property + def ticker(self): + """Gets the ticker of this Split. # noqa: E501 + + + :return: The ticker of this Split. # noqa: E501 + :rtype: TickerSymbol + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this Split. + + + :param ticker: The ticker of this Split. # noqa: E501 + :type: TickerSymbol + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def ex_date(self): + """Gets the ex_date of this Split. # noqa: E501 + + Execution date of the split # noqa: E501 + + :return: The ex_date of this Split. # noqa: E501 + :rtype: datetime + """ + return self._ex_date + + @ex_date.setter + def ex_date(self, ex_date): + """Sets the ex_date of this Split. + + Execution date of the split # noqa: E501 + + :param ex_date: The ex_date of this Split. # noqa: E501 + :type: datetime + """ + if ex_date is None: + raise ValueError("Invalid value for `ex_date`, must not be `None`") # noqa: E501 + + self._ex_date = ex_date + + @property + def payment_date(self): + """Gets the payment_date of this Split. # noqa: E501 + + Payment date of the split # noqa: E501 + + :return: The payment_date of this Split. # noqa: E501 + :rtype: datetime + """ + return self._payment_date + + @payment_date.setter + def payment_date(self, payment_date): + """Sets the payment_date of this Split. + + Payment date of the split # noqa: E501 + + :param payment_date: The payment_date of this Split. # noqa: E501 + :type: datetime + """ + if payment_date is None: + raise ValueError("Invalid value for `payment_date`, must not be `None`") # noqa: E501 + + self._payment_date = payment_date + + @property + def record_date(self): + """Gets the record_date of this Split. # noqa: E501 + + Payment date of the split # noqa: E501 + + :return: The record_date of this Split. # noqa: E501 + :rtype: datetime + """ + return self._record_date + + @record_date.setter + def record_date(self, record_date): + """Sets the record_date of this Split. + + Payment date of the split # noqa: E501 + + :param record_date: The record_date of this Split. # noqa: E501 + :type: datetime + """ + + self._record_date = record_date + + @property + def declared_date(self): + """Gets the declared_date of this Split. # noqa: E501 + + Payment date of the split # noqa: E501 + + :return: The declared_date of this Split. # noqa: E501 + :rtype: datetime + """ + return self._declared_date + + @declared_date.setter + def declared_date(self, declared_date): + """Sets the declared_date of this Split. + + Payment date of the split # noqa: E501 + + :param declared_date: The declared_date of this Split. # noqa: E501 + :type: datetime + """ + + self._declared_date = declared_date + + @property + def ratio(self): + """Gets the ratio of this Split. # noqa: E501 + + refers to the split ratio. The split ratio is an inverse of the number of shares that a holder of the stock would have after the split divided by the number of shares that the holder had before.
For example: Split ratio of .5 = 2 for 1 split. # noqa: E501 + + :return: The ratio of this Split. # noqa: E501 + :rtype: float + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this Split. + + refers to the split ratio. The split ratio is an inverse of the number of shares that a holder of the stock would have after the split divided by the number of shares that the holder had before.
For example: Split ratio of .5 = 2 for 1 split. # noqa: E501 + + :param ratio: The ratio of this Split. # noqa: E501 + :type: float + """ + if ratio is None: + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + @property + def tofactor(self): + """Gets the tofactor of this Split. # noqa: E501 + + To factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 + + :return: The tofactor of this Split. # noqa: E501 + :rtype: float + """ + return self._tofactor + + @tofactor.setter + def tofactor(self, tofactor): + """Sets the tofactor of this Split. + + To factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 + + :param tofactor: The tofactor of this Split. # noqa: E501 + :type: float + """ + if tofactor is None: + raise ValueError("Invalid value for `tofactor`, must not be `None`") # noqa: E501 + + self._tofactor = tofactor + + @property + def forfactor(self): + """Gets the forfactor of this Split. # noqa: E501 + + For factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 + + :return: The forfactor of this Split. # noqa: E501 + :rtype: float + """ + return self._forfactor + + @forfactor.setter + def forfactor(self, forfactor): + """Sets the forfactor of this Split. + + For factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 + + :param forfactor: The forfactor of this Split. # noqa: E501 + :type: float + """ + if forfactor is None: + raise ValueError("Invalid value for `forfactor`, must not be `None`") # noqa: E501 + + self._forfactor = forfactor + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Split, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Split): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stock_symbol.py b/polygon/rest/models/stock_symbol.py new file mode 100644 index 00000000..dec75ee1 --- /dev/null +++ b/polygon/rest/models/stock_symbol.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StockSymbol(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """StockSymbol - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StockSymbol, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StockSymbol): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_snapshot_agg.py b/polygon/rest/models/stocks_snapshot_agg.py new file mode 100644 index 00000000..b5dff909 --- /dev/null +++ b/polygon/rest/models/stocks_snapshot_agg.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksSnapshotAgg(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'c': 'int', + 'h': 'int', + 'l': 'int', + 'o': 'int', + 'v': 'int' + } + + attribute_map = { + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o', + 'v': 'v' + } + + def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 + """StocksSnapshotAgg - a model defined in Swagger""" # noqa: E501 + self._c = None + self._h = None + self._l = None + self._o = None + self._v = None + self.discriminator = None + self.c = c + self.h = h + self.l = l + self.o = o + self.v = v + + @property + def c(self): + """Gets the c of this StocksSnapshotAgg. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this StocksSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this StocksSnapshotAgg. + + Close price # noqa: E501 + + :param c: The c of this StocksSnapshotAgg. # noqa: E501 + :type: int + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def h(self): + """Gets the h of this StocksSnapshotAgg. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this StocksSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this StocksSnapshotAgg. + + High price # noqa: E501 + + :param h: The h of this StocksSnapshotAgg. # noqa: E501 + :type: int + """ + if h is None: + raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 + + self._h = h + + @property + def l(self): + """Gets the l of this StocksSnapshotAgg. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this StocksSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this StocksSnapshotAgg. + + Low price # noqa: E501 + + :param l: The l of this StocksSnapshotAgg. # noqa: E501 + :type: int + """ + if l is None: + raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 + + self._l = l + + @property + def o(self): + """Gets the o of this StocksSnapshotAgg. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this StocksSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this StocksSnapshotAgg. + + Open price # noqa: E501 + + :param o: The o of this StocksSnapshotAgg. # noqa: E501 + :type: int + """ + if o is None: + raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 + + self._o = o + + @property + def v(self): + """Gets the v of this StocksSnapshotAgg. # noqa: E501 + + Volume # noqa: E501 + + :return: The v of this StocksSnapshotAgg. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this StocksSnapshotAgg. + + Volume # noqa: E501 + + :param v: The v of this StocksSnapshotAgg. # noqa: E501 + :type: int + """ + if v is None: + raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 + + self._v = v + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksSnapshotAgg, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksSnapshotAgg): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_snapshot_book_item.py b/polygon/rest/models/stocks_snapshot_book_item.py new file mode 100644 index 00000000..774eb848 --- /dev/null +++ b/polygon/rest/models/stocks_snapshot_book_item.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksSnapshotBookItem(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'p': 'int', + 'x': 'object' + } + + attribute_map = { + 'p': 'p', + 'x': 'x' + } + + def __init__(self, p=None, x=None): # noqa: E501 + """StocksSnapshotBookItem - a model defined in Swagger""" # noqa: E501 + self._p = None + self._x = None + self.discriminator = None + self.p = p + self.x = x + + @property + def p(self): + """Gets the p of this StocksSnapshotBookItem. # noqa: E501 + + Price of this book level # noqa: E501 + + :return: The p of this StocksSnapshotBookItem. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksSnapshotBookItem. + + Price of this book level # noqa: E501 + + :param p: The p of this StocksSnapshotBookItem. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def x(self): + """Gets the x of this StocksSnapshotBookItem. # noqa: E501 + + Exchange to Size of this price level # noqa: E501 + + :return: The x of this StocksSnapshotBookItem. # noqa: E501 + :rtype: object + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this StocksSnapshotBookItem. + + Exchange to Size of this price level # noqa: E501 + + :param x: The x of this StocksSnapshotBookItem. # noqa: E501 + :type: object + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksSnapshotBookItem, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksSnapshotBookItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_snapshot_quote.py b/polygon/rest/models/stocks_snapshot_quote.py new file mode 100644 index 00000000..b2edfb16 --- /dev/null +++ b/polygon/rest/models/stocks_snapshot_quote.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksSnapshotQuote(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'p': 'int', + 's': 'int', + 'p': 'int', + 's': 'int', + 't': 'int' + } + + attribute_map = { + 'p': 'p', + 's': 's', + 'p': 'P', + 's': 'S', + 't': 't' + } + + def __init__(self, p=None, s=None, p=None, s=None, t=None): # noqa: E501 + """StocksSnapshotQuote - a model defined in Swagger""" # noqa: E501 + self._p = None + self._s = None + self._p = None + self._s = None + self._t = None + self.discriminator = None + self.p = p + self.s = s + self.p = p + self.s = s + self.t = t + + @property + def p(self): + """Gets the p of this StocksSnapshotQuote. # noqa: E501 + + Bid Price # noqa: E501 + + :return: The p of this StocksSnapshotQuote. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksSnapshotQuote. + + Bid Price # noqa: E501 + + :param p: The p of this StocksSnapshotQuote. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def s(self): + """Gets the s of this StocksSnapshotQuote. # noqa: E501 + + Bid size in lots # noqa: E501 + + :return: The s of this StocksSnapshotQuote. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this StocksSnapshotQuote. + + Bid size in lots # noqa: E501 + + :param s: The s of this StocksSnapshotQuote. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def p(self): + """Gets the p of this StocksSnapshotQuote. # noqa: E501 + + Ask Price # noqa: E501 + + :return: The p of this StocksSnapshotQuote. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksSnapshotQuote. + + Ask Price # noqa: E501 + + :param p: The p of this StocksSnapshotQuote. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def s(self): + """Gets the s of this StocksSnapshotQuote. # noqa: E501 + + Ask size in lots # noqa: E501 + + :return: The s of this StocksSnapshotQuote. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this StocksSnapshotQuote. + + Ask size in lots # noqa: E501 + + :param s: The s of this StocksSnapshotQuote. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def t(self): + """Gets the t of this StocksSnapshotQuote. # noqa: E501 + + Last Updated timestamp ( Nanosecond Timestamp ) # noqa: E501 + + :return: The t of this StocksSnapshotQuote. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this StocksSnapshotQuote. + + Last Updated timestamp ( Nanosecond Timestamp ) # noqa: E501 + + :param t: The t of this StocksSnapshotQuote. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksSnapshotQuote, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksSnapshotQuote): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_snapshot_ticker.py b/polygon/rest/models/stocks_snapshot_ticker.py new file mode 100644 index 00000000..773ecb0e --- /dev/null +++ b/polygon/rest/models/stocks_snapshot_ticker.py @@ -0,0 +1,335 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksSnapshotTicker(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'day': 'StocksSnapshotAgg', + 'last_trade': 'Trade', + 'last_quote': 'StocksSnapshotQuote', + 'min': 'StocksSnapshotAgg', + 'prev_day': 'StocksSnapshotAgg', + 'todays_change': 'int', + 'todays_change_perc': 'int', + 'updated': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'day': 'day', + 'last_trade': 'lastTrade', + 'last_quote': 'lastQuote', + 'min': 'min', + 'prev_day': 'prevDay', + 'todays_change': 'todaysChange', + 'todays_change_perc': 'todaysChangePerc', + 'updated': 'updated' + } + + def __init__(self, ticker=None, day=None, last_trade=None, last_quote=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 + """StocksSnapshotTicker - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._day = None + self._last_trade = None + self._last_quote = None + self._min = None + self._prev_day = None + self._todays_change = None + self._todays_change_perc = None + self._updated = None + self.discriminator = None + self.ticker = ticker + self.day = day + self.last_trade = last_trade + if last_quote is not None: + self.last_quote = last_quote + self.min = min + self.prev_day = prev_day + self.todays_change = todays_change + self.todays_change_perc = todays_change_perc + self.updated = updated + + @property + def ticker(self): + """Gets the ticker of this StocksSnapshotTicker. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The ticker of this StocksSnapshotTicker. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this StocksSnapshotTicker. + + Ticker of the object # noqa: E501 + + :param ticker: The ticker of this StocksSnapshotTicker. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def day(self): + """Gets the day of this StocksSnapshotTicker. # noqa: E501 + + + :return: The day of this StocksSnapshotTicker. # noqa: E501 + :rtype: StocksSnapshotAgg + """ + return self._day + + @day.setter + def day(self, day): + """Sets the day of this StocksSnapshotTicker. + + + :param day: The day of this StocksSnapshotTicker. # noqa: E501 + :type: StocksSnapshotAgg + """ + if day is None: + raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 + + self._day = day + + @property + def last_trade(self): + """Gets the last_trade of this StocksSnapshotTicker. # noqa: E501 + + + :return: The last_trade of this StocksSnapshotTicker. # noqa: E501 + :rtype: Trade + """ + return self._last_trade + + @last_trade.setter + def last_trade(self, last_trade): + """Sets the last_trade of this StocksSnapshotTicker. + + + :param last_trade: The last_trade of this StocksSnapshotTicker. # noqa: E501 + :type: Trade + """ + if last_trade is None: + raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 + + self._last_trade = last_trade + + @property + def last_quote(self): + """Gets the last_quote of this StocksSnapshotTicker. # noqa: E501 + + + :return: The last_quote of this StocksSnapshotTicker. # noqa: E501 + :rtype: StocksSnapshotQuote + """ + return self._last_quote + + @last_quote.setter + def last_quote(self, last_quote): + """Sets the last_quote of this StocksSnapshotTicker. + + + :param last_quote: The last_quote of this StocksSnapshotTicker. # noqa: E501 + :type: StocksSnapshotQuote + """ + + self._last_quote = last_quote + + @property + def min(self): + """Gets the min of this StocksSnapshotTicker. # noqa: E501 + + + :return: The min of this StocksSnapshotTicker. # noqa: E501 + :rtype: StocksSnapshotAgg + """ + return self._min + + @min.setter + def min(self, min): + """Sets the min of this StocksSnapshotTicker. + + + :param min: The min of this StocksSnapshotTicker. # noqa: E501 + :type: StocksSnapshotAgg + """ + if min is None: + raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 + + self._min = min + + @property + def prev_day(self): + """Gets the prev_day of this StocksSnapshotTicker. # noqa: E501 + + + :return: The prev_day of this StocksSnapshotTicker. # noqa: E501 + :rtype: StocksSnapshotAgg + """ + return self._prev_day + + @prev_day.setter + def prev_day(self, prev_day): + """Sets the prev_day of this StocksSnapshotTicker. + + + :param prev_day: The prev_day of this StocksSnapshotTicker. # noqa: E501 + :type: StocksSnapshotAgg + """ + if prev_day is None: + raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 + + self._prev_day = prev_day + + @property + def todays_change(self): + """Gets the todays_change of this StocksSnapshotTicker. # noqa: E501 + + Value of the change from previous day # noqa: E501 + + :return: The todays_change of this StocksSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change + + @todays_change.setter + def todays_change(self, todays_change): + """Sets the todays_change of this StocksSnapshotTicker. + + Value of the change from previous day # noqa: E501 + + :param todays_change: The todays_change of this StocksSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change is None: + raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 + + self._todays_change = todays_change + + @property + def todays_change_perc(self): + """Gets the todays_change_perc of this StocksSnapshotTicker. # noqa: E501 + + Percentage change since previous day # noqa: E501 + + :return: The todays_change_perc of this StocksSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._todays_change_perc + + @todays_change_perc.setter + def todays_change_perc(self, todays_change_perc): + """Sets the todays_change_perc of this StocksSnapshotTicker. + + Percentage change since previous day # noqa: E501 + + :param todays_change_perc: The todays_change_perc of this StocksSnapshotTicker. # noqa: E501 + :type: int + """ + if todays_change_perc is None: + raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 + + self._todays_change_perc = todays_change_perc + + @property + def updated(self): + """Gets the updated of this StocksSnapshotTicker. # noqa: E501 + + Last Updated timestamp # noqa: E501 + + :return: The updated of this StocksSnapshotTicker. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this StocksSnapshotTicker. + + Last Updated timestamp # noqa: E501 + + :param updated: The updated of this StocksSnapshotTicker. # noqa: E501 + :type: int + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksSnapshotTicker, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksSnapshotTicker): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_snapshot_ticker_book.py b/polygon/rest/models/stocks_snapshot_ticker_book.py new file mode 100644 index 00000000..3c726b59 --- /dev/null +++ b/polygon/rest/models/stocks_snapshot_ticker_book.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksSnapshotTickerBook(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'str', + 'bids': 'list[StocksSnapshotBookItem]', + 'asks': 'list[StocksSnapshotBookItem]', + 'bid_count': 'int', + 'ask_count': 'int', + 'spread': 'int', + 'updated': 'int' + } + + attribute_map = { + 'ticker': 'ticker', + 'bids': 'bids', + 'asks': 'asks', + 'bid_count': 'bidCount', + 'ask_count': 'askCount', + 'spread': 'spread', + 'updated': 'updated' + } + + def __init__(self, ticker=None, bids=None, asks=None, bid_count=None, ask_count=None, spread=None, updated=None): # noqa: E501 + """StocksSnapshotTickerBook - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._bids = None + self._asks = None + self._bid_count = None + self._ask_count = None + self._spread = None + self._updated = None + self.discriminator = None + self.ticker = ticker + if bids is not None: + self.bids = bids + if asks is not None: + self.asks = asks + if bid_count is not None: + self.bid_count = bid_count + if ask_count is not None: + self.ask_count = ask_count + if spread is not None: + self.spread = spread + self.updated = updated + + @property + def ticker(self): + """Gets the ticker of this StocksSnapshotTickerBook. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The ticker of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: str + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this StocksSnapshotTickerBook. + + Ticker of the object # noqa: E501 + + :param ticker: The ticker of this StocksSnapshotTickerBook. # noqa: E501 + :type: str + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def bids(self): + """Gets the bids of this StocksSnapshotTickerBook. # noqa: E501 + + Bids # noqa: E501 + + :return: The bids of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: list[StocksSnapshotBookItem] + """ + return self._bids + + @bids.setter + def bids(self, bids): + """Sets the bids of this StocksSnapshotTickerBook. + + Bids # noqa: E501 + + :param bids: The bids of this StocksSnapshotTickerBook. # noqa: E501 + :type: list[StocksSnapshotBookItem] + """ + + self._bids = bids + + @property + def asks(self): + """Gets the asks of this StocksSnapshotTickerBook. # noqa: E501 + + Asks # noqa: E501 + + :return: The asks of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: list[StocksSnapshotBookItem] + """ + return self._asks + + @asks.setter + def asks(self, asks): + """Sets the asks of this StocksSnapshotTickerBook. + + Asks # noqa: E501 + + :param asks: The asks of this StocksSnapshotTickerBook. # noqa: E501 + :type: list[StocksSnapshotBookItem] + """ + + self._asks = asks + + @property + def bid_count(self): + """Gets the bid_count of this StocksSnapshotTickerBook. # noqa: E501 + + Combined total number of bids in the book # noqa: E501 + + :return: The bid_count of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._bid_count + + @bid_count.setter + def bid_count(self, bid_count): + """Sets the bid_count of this StocksSnapshotTickerBook. + + Combined total number of bids in the book # noqa: E501 + + :param bid_count: The bid_count of this StocksSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._bid_count = bid_count + + @property + def ask_count(self): + """Gets the ask_count of this StocksSnapshotTickerBook. # noqa: E501 + + Combined total number of asks in the book # noqa: E501 + + :return: The ask_count of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._ask_count + + @ask_count.setter + def ask_count(self, ask_count): + """Sets the ask_count of this StocksSnapshotTickerBook. + + Combined total number of asks in the book # noqa: E501 + + :param ask_count: The ask_count of this StocksSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._ask_count = ask_count + + @property + def spread(self): + """Gets the spread of this StocksSnapshotTickerBook. # noqa: E501 + + Difference between the best bid and the best ask price accross exchanges # noqa: E501 + + :return: The spread of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._spread + + @spread.setter + def spread(self, spread): + """Sets the spread of this StocksSnapshotTickerBook. + + Difference between the best bid and the best ask price accross exchanges # noqa: E501 + + :param spread: The spread of this StocksSnapshotTickerBook. # noqa: E501 + :type: int + """ + + self._spread = spread + + @property + def updated(self): + """Gets the updated of this StocksSnapshotTickerBook. # noqa: E501 + + Last Updated timestamp # noqa: E501 + + :return: The updated of this StocksSnapshotTickerBook. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this StocksSnapshotTickerBook. + + Last Updated timestamp # noqa: E501 + + :param updated: The updated of this StocksSnapshotTickerBook. # noqa: E501 + :type: int + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksSnapshotTickerBook, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksSnapshotTickerBook): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_v2_nbbo.py b/polygon/rest/models/stocks_v2_nbbo.py new file mode 100644 index 00000000..8b3e929b --- /dev/null +++ b/polygon/rest/models/stocks_v2_nbbo.py @@ -0,0 +1,486 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksV2NBBO(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 't': 'str', + 't': 'int', + 'y': 'int', + 'f': 'int', + 'q': 'int', + 'c': 'list[int]', + 'i': 'list[int]', + 'p': 'int', + 'x': 'int', + 's': 'int', + 'p': 'int', + 'x': 'int', + 's': 'int', + 'z': 'int' + } + + attribute_map = { + 't': 'T', + 't': 't', + 'y': 'y', + 'f': 'f', + 'q': 'q', + 'c': 'c', + 'i': 'i', + 'p': 'p', + 'x': 'x', + 's': 's', + 'p': 'P', + 'x': 'X', + 's': 'S', + 'z': 'z' + } + + def __init__(self, t=None, t=None, y=None, f=None, q=None, c=None, i=None, p=None, x=None, s=None, p=None, x=None, s=None, z=None): # noqa: E501 + """StocksV2NBBO - a model defined in Swagger""" # noqa: E501 + self._t = None + self._t = None + self._y = None + self._f = None + self._q = None + self._c = None + self._i = None + self._p = None + self._x = None + self._s = None + self._p = None + self._x = None + self._s = None + self._z = None + self.discriminator = None + if t is not None: + self.t = t + self.t = t + if y is not None: + self.y = y + if f is not None: + self.f = f + self.q = q + if c is not None: + self.c = c + if i is not None: + self.i = i + self.p = p + self.x = x + self.s = s + self.p = p + self.x = x + self.s = s + self.z = z + + @property + def t(self): + """Gets the t of this StocksV2NBBO. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The t of this StocksV2NBBO. # noqa: E501 + :rtype: str + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this StocksV2NBBO. + + Ticker of the object # noqa: E501 + + :param t: The t of this StocksV2NBBO. # noqa: E501 + :type: str + """ + + self._t = t + + @property + def t(self): + """Gets the t of this StocksV2NBBO. # noqa: E501 + + Nanosecond accuracy SIP Unix Timestamp # noqa: E501 + + :return: The t of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this StocksV2NBBO. + + Nanosecond accuracy SIP Unix Timestamp # noqa: E501 + + :param t: The t of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + @property + def y(self): + """Gets the y of this StocksV2NBBO. # noqa: E501 + + Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 + + :return: The y of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._y + + @y.setter + def y(self, y): + """Sets the y of this StocksV2NBBO. + + Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 + + :param y: The y of this StocksV2NBBO. # noqa: E501 + :type: int + """ + + self._y = y + + @property + def f(self): + """Gets the f of this StocksV2NBBO. # noqa: E501 + + Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 + + :return: The f of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._f + + @f.setter + def f(self, f): + """Sets the f of this StocksV2NBBO. + + Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 + + :param f: The f of this StocksV2NBBO. # noqa: E501 + :type: int + """ + + self._f = f + + @property + def q(self): + """Gets the q of this StocksV2NBBO. # noqa: E501 + + Sequence Number # noqa: E501 + + :return: The q of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._q + + @q.setter + def q(self, q): + """Sets the q of this StocksV2NBBO. + + Sequence Number # noqa: E501 + + :param q: The q of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if q is None: + raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 + + self._q = q + + @property + def c(self): + """Gets the c of this StocksV2NBBO. # noqa: E501 + + Conditions # noqa: E501 + + :return: The c of this StocksV2NBBO. # noqa: E501 + :rtype: list[int] + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this StocksV2NBBO. + + Conditions # noqa: E501 + + :param c: The c of this StocksV2NBBO. # noqa: E501 + :type: list[int] + """ + + self._c = c + + @property + def i(self): + """Gets the i of this StocksV2NBBO. # noqa: E501 + + Indicators # noqa: E501 + + :return: The i of this StocksV2NBBO. # noqa: E501 + :rtype: list[int] + """ + return self._i + + @i.setter + def i(self, i): + """Sets the i of this StocksV2NBBO. + + Indicators # noqa: E501 + + :param i: The i of this StocksV2NBBO. # noqa: E501 + :type: list[int] + """ + + self._i = i + + @property + def p(self): + """Gets the p of this StocksV2NBBO. # noqa: E501 + + BID Price # noqa: E501 + + :return: The p of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksV2NBBO. + + BID Price # noqa: E501 + + :param p: The p of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def x(self): + """Gets the x of this StocksV2NBBO. # noqa: E501 + + BID Exchange ID # noqa: E501 + + :return: The x of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this StocksV2NBBO. + + BID Exchange ID # noqa: E501 + + :param x: The x of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + @property + def s(self): + """Gets the s of this StocksV2NBBO. # noqa: E501 + + BID Size ( In round lots ) # noqa: E501 + + :return: The s of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this StocksV2NBBO. + + BID Size ( In round lots ) # noqa: E501 + + :param s: The s of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def p(self): + """Gets the p of this StocksV2NBBO. # noqa: E501 + + ASK Price # noqa: E501 + + :return: The p of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksV2NBBO. + + ASK Price # noqa: E501 + + :param p: The p of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def x(self): + """Gets the x of this StocksV2NBBO. # noqa: E501 + + ASK Exchange ID # noqa: E501 + + :return: The x of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this StocksV2NBBO. + + ASK Exchange ID # noqa: E501 + + :param x: The x of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + @property + def s(self): + """Gets the s of this StocksV2NBBO. # noqa: E501 + + ASK Size ( In round lots ) # noqa: E501 + + :return: The s of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this StocksV2NBBO. + + ASK Size ( In round lots ) # noqa: E501 + + :param s: The s of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def z(self): + """Gets the z of this StocksV2NBBO. # noqa: E501 + + Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 + + :return: The z of this StocksV2NBBO. # noqa: E501 + :rtype: int + """ + return self._z + + @z.setter + def z(self, z): + """Sets the z of this StocksV2NBBO. + + Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 + + :param z: The z of this StocksV2NBBO. # noqa: E501 + :type: int + """ + if z is None: + raise ValueError("Invalid value for `z`, must not be `None`") # noqa: E501 + + self._z = z + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksV2NBBO, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksV2NBBO): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/stocks_v2_trade.py b/polygon/rest/models/stocks_v2_trade.py new file mode 100644 index 00000000..cfee228e --- /dev/null +++ b/polygon/rest/models/stocks_v2_trade.py @@ -0,0 +1,401 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class StocksV2Trade(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 't': 'str', + 't': 'int', + 'y': 'int', + 'f': 'int', + 'q': 'int', + 'i': 'str', + 'x': 'int', + 's': 'int', + 'c': 'list[int]', + 'p': 'int', + 'z': 'int' + } + + attribute_map = { + 't': 'T', + 't': 't', + 'y': 'y', + 'f': 'f', + 'q': 'q', + 'i': 'i', + 'x': 'x', + 's': 's', + 'c': 'c', + 'p': 'p', + 'z': 'z' + } + + def __init__(self, t=None, t=None, y=None, f=None, q=None, i=None, x=None, s=None, c=None, p=None, z=None): # noqa: E501 + """StocksV2Trade - a model defined in Swagger""" # noqa: E501 + self._t = None + self._t = None + self._y = None + self._f = None + self._q = None + self._i = None + self._x = None + self._s = None + self._c = None + self._p = None + self._z = None + self.discriminator = None + if t is not None: + self.t = t + self.t = t + if y is not None: + self.y = y + if f is not None: + self.f = f + self.q = q + self.i = i + self.x = x + self.s = s + self.c = c + self.p = p + self.z = z + + @property + def t(self): + """Gets the t of this StocksV2Trade. # noqa: E501 + + Ticker of the object # noqa: E501 + + :return: The t of this StocksV2Trade. # noqa: E501 + :rtype: str + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this StocksV2Trade. + + Ticker of the object # noqa: E501 + + :param t: The t of this StocksV2Trade. # noqa: E501 + :type: str + """ + + self._t = t + + @property + def t(self): + """Gets the t of this StocksV2Trade. # noqa: E501 + + Nanosecond accuracy SIP Unix Timestamp # noqa: E501 + + :return: The t of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this StocksV2Trade. + + Nanosecond accuracy SIP Unix Timestamp # noqa: E501 + + :param t: The t of this StocksV2Trade. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + @property + def y(self): + """Gets the y of this StocksV2Trade. # noqa: E501 + + Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 + + :return: The y of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._y + + @y.setter + def y(self, y): + """Sets the y of this StocksV2Trade. + + Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 + + :param y: The y of this StocksV2Trade. # noqa: E501 + :type: int + """ + + self._y = y + + @property + def f(self): + """Gets the f of this StocksV2Trade. # noqa: E501 + + Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 + + :return: The f of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._f + + @f.setter + def f(self, f): + """Sets the f of this StocksV2Trade. + + Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 + + :param f: The f of this StocksV2Trade. # noqa: E501 + :type: int + """ + + self._f = f + + @property + def q(self): + """Gets the q of this StocksV2Trade. # noqa: E501 + + Sequence Number # noqa: E501 + + :return: The q of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._q + + @q.setter + def q(self, q): + """Sets the q of this StocksV2Trade. + + Sequence Number # noqa: E501 + + :param q: The q of this StocksV2Trade. # noqa: E501 + :type: int + """ + if q is None: + raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 + + self._q = q + + @property + def i(self): + """Gets the i of this StocksV2Trade. # noqa: E501 + + Trade ID # noqa: E501 + + :return: The i of this StocksV2Trade. # noqa: E501 + :rtype: str + """ + return self._i + + @i.setter + def i(self, i): + """Sets the i of this StocksV2Trade. + + Trade ID # noqa: E501 + + :param i: The i of this StocksV2Trade. # noqa: E501 + :type: str + """ + if i is None: + raise ValueError("Invalid value for `i`, must not be `None`") # noqa: E501 + + self._i = i + + @property + def x(self): + """Gets the x of this StocksV2Trade. # noqa: E501 + + Exchange ID # noqa: E501 + + :return: The x of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._x + + @x.setter + def x(self, x): + """Sets the x of this StocksV2Trade. + + Exchange ID # noqa: E501 + + :param x: The x of this StocksV2Trade. # noqa: E501 + :type: int + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + @property + def s(self): + """Gets the s of this StocksV2Trade. # noqa: E501 + + Size/Volume of the trade # noqa: E501 + + :return: The s of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this StocksV2Trade. + + Size/Volume of the trade # noqa: E501 + + :param s: The s of this StocksV2Trade. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def c(self): + """Gets the c of this StocksV2Trade. # noqa: E501 + + Conditions # noqa: E501 + + :return: The c of this StocksV2Trade. # noqa: E501 + :rtype: list[int] + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this StocksV2Trade. + + Conditions # noqa: E501 + + :param c: The c of this StocksV2Trade. # noqa: E501 + :type: list[int] + """ + if c is None: + raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 + + self._c = c + + @property + def p(self): + """Gets the p of this StocksV2Trade. # noqa: E501 + + Price of the trade # noqa: E501 + + :return: The p of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this StocksV2Trade. + + Price of the trade # noqa: E501 + + :param p: The p of this StocksV2Trade. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def z(self): + """Gets the z of this StocksV2Trade. # noqa: E501 + + Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 + + :return: The z of this StocksV2Trade. # noqa: E501 + :rtype: int + """ + return self._z + + @z.setter + def z(self, z): + """Sets the z of this StocksV2Trade. + + Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 + + :param z: The z of this StocksV2Trade. # noqa: E501 + :type: int + """ + if z is None: + raise ValueError("Invalid value for `z`, must not be `None`") # noqa: E501 + + self._z = z + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StocksV2Trade, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StocksV2Trade): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/symbol.py b/polygon/rest/models/symbol.py new file mode 100644 index 00000000..92dfd2d2 --- /dev/null +++ b/polygon/rest/models/symbol.py @@ -0,0 +1,257 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Symbol(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'symbol': 'StockSymbol', + 'name': 'str', + 'type': 'str', + 'url': 'str', + 'updated': 'datetime', + 'is_otc': 'bool' + } + + attribute_map = { + 'symbol': 'symbol', + 'name': 'name', + 'type': 'type', + 'url': 'url', + 'updated': 'updated', + 'is_otc': 'isOTC' + } + + def __init__(self, symbol=None, name=None, type=None, url=None, updated=None, is_otc=None): # noqa: E501 + """Symbol - a model defined in Swagger""" # noqa: E501 + self._symbol = None + self._name = None + self._type = None + self._url = None + self._updated = None + self._is_otc = None + self.discriminator = None + self.symbol = symbol + self.name = name + self.type = type + self.url = url + self.updated = updated + self.is_otc = is_otc + + @property + def symbol(self): + """Gets the symbol of this Symbol. # noqa: E501 + + + :return: The symbol of this Symbol. # noqa: E501 + :rtype: StockSymbol + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Symbol. + + + :param symbol: The symbol of this Symbol. # noqa: E501 + :type: StockSymbol + """ + if symbol is None: + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def name(self): + """Gets the name of this Symbol. # noqa: E501 + + Name of the item. # noqa: E501 + + :return: The name of this Symbol. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Symbol. + + Name of the item. # noqa: E501 + + :param name: The name of this Symbol. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def type(self): + """Gets the type of this Symbol. # noqa: E501 + + Type of symbol this is. See symbol types. # noqa: E501 + + :return: The type of this Symbol. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Symbol. + + Type of symbol this is. See symbol types. # noqa: E501 + + :param type: The type of this Symbol. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def url(self): + """Gets the url of this Symbol. # noqa: E501 + + URL of this symbol. Use this to get this symbols endpoints. # noqa: E501 + + :return: The url of this Symbol. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this Symbol. + + URL of this symbol. Use this to get this symbols endpoints. # noqa: E501 + + :param url: The url of this Symbol. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + @property + def updated(self): + """Gets the updated of this Symbol. # noqa: E501 + + Last time this company record was updated. # noqa: E501 + + :return: The updated of this Symbol. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Symbol. + + Last time this company record was updated. # noqa: E501 + + :param updated: The updated of this Symbol. # noqa: E501 + :type: datetime + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + @property + def is_otc(self): + """Gets the is_otc of this Symbol. # noqa: E501 + + If the symbol is listed on the OTC Markets. # noqa: E501 + + :return: The is_otc of this Symbol. # noqa: E501 + :rtype: bool + """ + return self._is_otc + + @is_otc.setter + def is_otc(self, is_otc): + """Sets the is_otc of this Symbol. + + If the symbol is listed on the OTC Markets. # noqa: E501 + + :param is_otc: The is_otc of this Symbol. # noqa: E501 + :type: bool + """ + if is_otc is None: + raise ValueError("Invalid value for `is_otc`, must not be `None`") # noqa: E501 + + self._is_otc = is_otc + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Symbol, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Symbol): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/symbol_type_map.py b/polygon/rest/models/symbol_type_map.py new file mode 100644 index 00000000..e0c6f113 --- /dev/null +++ b/polygon/rest/models/symbol_type_map.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SymbolTypeMap(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SymbolTypeMap - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SymbolTypeMap, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolTypeMap): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/ticker.py b/polygon/rest/models/ticker.py new file mode 100644 index 00000000..f10fa033 --- /dev/null +++ b/polygon/rest/models/ticker.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Ticker(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ticker': 'StockSymbol', + 'name': 'str', + 'market': 'str', + 'locale': 'str', + 'currency': 'str', + 'active': 'bool', + 'primary_exch': 'str', + 'url': 'str', + 'updated': 'datetime', + 'attrs': 'object', + 'codes': 'object' + } + + attribute_map = { + 'ticker': 'ticker', + 'name': 'name', + 'market': 'market', + 'locale': 'locale', + 'currency': 'currency', + 'active': 'active', + 'primary_exch': 'primaryExch', + 'url': 'url', + 'updated': 'updated', + 'attrs': 'attrs', + 'codes': 'codes' + } + + def __init__(self, ticker=None, name=None, market=None, locale=None, currency=None, active=None, primary_exch=None, url=None, updated=None, attrs=None, codes=None): # noqa: E501 + """Ticker - a model defined in Swagger""" # noqa: E501 + self._ticker = None + self._name = None + self._market = None + self._locale = None + self._currency = None + self._active = None + self._primary_exch = None + self._url = None + self._updated = None + self._attrs = None + self._codes = None + self.discriminator = None + self.ticker = ticker + self.name = name + self.market = market + self.locale = locale + if currency is not None: + self.currency = currency + if active is not None: + self.active = active + if primary_exch is not None: + self.primary_exch = primary_exch + if url is not None: + self.url = url + self.updated = updated + if attrs is not None: + self.attrs = attrs + if codes is not None: + self.codes = codes + + @property + def ticker(self): + """Gets the ticker of this Ticker. # noqa: E501 + + + :return: The ticker of this Ticker. # noqa: E501 + :rtype: StockSymbol + """ + return self._ticker + + @ticker.setter + def ticker(self, ticker): + """Sets the ticker of this Ticker. + + + :param ticker: The ticker of this Ticker. # noqa: E501 + :type: StockSymbol + """ + if ticker is None: + raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 + + self._ticker = ticker + + @property + def name(self): + """Gets the name of this Ticker. # noqa: E501 + + Name of the item. # noqa: E501 + + :return: The name of this Ticker. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Ticker. + + Name of the item. # noqa: E501 + + :param name: The name of this Ticker. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def market(self): + """Gets the market of this Ticker. # noqa: E501 + + The market in which this ticker participates # noqa: E501 + + :return: The market of this Ticker. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this Ticker. + + The market in which this ticker participates # noqa: E501 + + :param market: The market of this Ticker. # noqa: E501 + :type: str + """ + if market is None: + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def locale(self): + """Gets the locale of this Ticker. # noqa: E501 + + Locale of where this ticker is traded # noqa: E501 + + :return: The locale of this Ticker. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this Ticker. + + Locale of where this ticker is traded # noqa: E501 + + :param locale: The locale of this Ticker. # noqa: E501 + :type: str + """ + if locale is None: + raise ValueError("Invalid value for `locale`, must not be `None`") # noqa: E501 + + self._locale = locale + + @property + def currency(self): + """Gets the currency of this Ticker. # noqa: E501 + + Currency this ticker is traded in # noqa: E501 + + :return: The currency of this Ticker. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this Ticker. + + Currency this ticker is traded in # noqa: E501 + + :param currency: The currency of this Ticker. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def active(self): + """Gets the active of this Ticker. # noqa: E501 + + If the ticker is active. False means the ticker has been delisted # noqa: E501 + + :return: The active of this Ticker. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Ticker. + + If the ticker is active. False means the ticker has been delisted # noqa: E501 + + :param active: The active of this Ticker. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def primary_exch(self): + """Gets the primary_exch of this Ticker. # noqa: E501 + + The listing exchange for this ticker # noqa: E501 + + :return: The primary_exch of this Ticker. # noqa: E501 + :rtype: str + """ + return self._primary_exch + + @primary_exch.setter + def primary_exch(self, primary_exch): + """Sets the primary_exch of this Ticker. + + The listing exchange for this ticker # noqa: E501 + + :param primary_exch: The primary_exch of this Ticker. # noqa: E501 + :type: str + """ + + self._primary_exch = primary_exch + + @property + def url(self): + """Gets the url of this Ticker. # noqa: E501 + + URL of this ticker. Use this to get more information about the ticker. # noqa: E501 + + :return: The url of this Ticker. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this Ticker. + + URL of this ticker. Use this to get more information about the ticker. # noqa: E501 + + :param url: The url of this Ticker. # noqa: E501 + :type: str + """ + + self._url = url + + @property + def updated(self): + """Gets the updated of this Ticker. # noqa: E501 + + Last time this ticker record was updated. # noqa: E501 + + :return: The updated of this Ticker. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Ticker. + + Last time this ticker record was updated. # noqa: E501 + + :param updated: The updated of this Ticker. # noqa: E501 + :type: datetime + """ + if updated is None: + raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 + + self._updated = updated + + @property + def attrs(self): + """Gets the attrs of this Ticker. # noqa: E501 + + Additional details about this ticker. No schema. # noqa: E501 + + :return: The attrs of this Ticker. # noqa: E501 + :rtype: object + """ + return self._attrs + + @attrs.setter + def attrs(self, attrs): + """Sets the attrs of this Ticker. + + Additional details about this ticker. No schema. # noqa: E501 + + :param attrs: The attrs of this Ticker. # noqa: E501 + :type: object + """ + + self._attrs = attrs + + @property + def codes(self): + """Gets the codes of this Ticker. # noqa: E501 + + Additional details about this ticker. No schema. # noqa: E501 + + :return: The codes of this Ticker. # noqa: E501 + :rtype: object + """ + return self._codes + + @codes.setter + def codes(self, codes): + """Sets the codes of this Ticker. + + Additional details about this ticker. No schema. # noqa: E501 + + :param codes: The codes of this Ticker. # noqa: E501 + :type: object + """ + + self._codes = codes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Ticker, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Ticker): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/ticker_symbol.py b/polygon/rest/models/ticker_symbol.py new file mode 100644 index 00000000..80996ad4 --- /dev/null +++ b/polygon/rest/models/ticker_symbol.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class TickerSymbol(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """TickerSymbol - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TickerSymbol, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TickerSymbol): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/trade.py b/polygon/rest/models/trade.py new file mode 100644 index 00000000..b3eab1ea --- /dev/null +++ b/polygon/rest/models/trade.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Trade(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'c1': 'int', + 'c2': 'int', + 'c3': 'int', + 'c4': 'int', + 'e': 'str', + 'p': 'int', + 's': 'int', + 't': 'int' + } + + attribute_map = { + 'c1': 'c1', + 'c2': 'c2', + 'c3': 'c3', + 'c4': 'c4', + 'e': 'e', + 'p': 'p', + 's': 's', + 't': 't' + } + + def __init__(self, c1=None, c2=None, c3=None, c4=None, e=None, p=None, s=None, t=None): # noqa: E501 + """Trade - a model defined in Swagger""" # noqa: E501 + self._c1 = None + self._c2 = None + self._c3 = None + self._c4 = None + self._e = None + self._p = None + self._s = None + self._t = None + self.discriminator = None + self.c1 = c1 + self.c2 = c2 + self.c3 = c3 + self.c4 = c4 + self.e = e + self.p = p + self.s = s + self.t = t + + @property + def c1(self): + """Gets the c1 of this Trade. # noqa: E501 + + Condition 1 of this trade # noqa: E501 + + :return: The c1 of this Trade. # noqa: E501 + :rtype: int + """ + return self._c1 + + @c1.setter + def c1(self, c1): + """Sets the c1 of this Trade. + + Condition 1 of this trade # noqa: E501 + + :param c1: The c1 of this Trade. # noqa: E501 + :type: int + """ + if c1 is None: + raise ValueError("Invalid value for `c1`, must not be `None`") # noqa: E501 + + self._c1 = c1 + + @property + def c2(self): + """Gets the c2 of this Trade. # noqa: E501 + + Condition 2 of this trade # noqa: E501 + + :return: The c2 of this Trade. # noqa: E501 + :rtype: int + """ + return self._c2 + + @c2.setter + def c2(self, c2): + """Sets the c2 of this Trade. + + Condition 2 of this trade # noqa: E501 + + :param c2: The c2 of this Trade. # noqa: E501 + :type: int + """ + if c2 is None: + raise ValueError("Invalid value for `c2`, must not be `None`") # noqa: E501 + + self._c2 = c2 + + @property + def c3(self): + """Gets the c3 of this Trade. # noqa: E501 + + Condition 3 of this trade # noqa: E501 + + :return: The c3 of this Trade. # noqa: E501 + :rtype: int + """ + return self._c3 + + @c3.setter + def c3(self, c3): + """Sets the c3 of this Trade. + + Condition 3 of this trade # noqa: E501 + + :param c3: The c3 of this Trade. # noqa: E501 + :type: int + """ + if c3 is None: + raise ValueError("Invalid value for `c3`, must not be `None`") # noqa: E501 + + self._c3 = c3 + + @property + def c4(self): + """Gets the c4 of this Trade. # noqa: E501 + + Condition 4 of this trade # noqa: E501 + + :return: The c4 of this Trade. # noqa: E501 + :rtype: int + """ + return self._c4 + + @c4.setter + def c4(self, c4): + """Sets the c4 of this Trade. + + Condition 4 of this trade # noqa: E501 + + :param c4: The c4 of this Trade. # noqa: E501 + :type: int + """ + if c4 is None: + raise ValueError("Invalid value for `c4`, must not be `None`") # noqa: E501 + + self._c4 = c4 + + @property + def e(self): + """Gets the e of this Trade. # noqa: E501 + + The exchange this trade happened on # noqa: E501 + + :return: The e of this Trade. # noqa: E501 + :rtype: str + """ + return self._e + + @e.setter + def e(self, e): + """Sets the e of this Trade. + + The exchange this trade happened on # noqa: E501 + + :param e: The e of this Trade. # noqa: E501 + :type: str + """ + if e is None: + raise ValueError("Invalid value for `e`, must not be `None`") # noqa: E501 + + self._e = e + + @property + def p(self): + """Gets the p of this Trade. # noqa: E501 + + Price of the trade # noqa: E501 + + :return: The p of this Trade. # noqa: E501 + :rtype: int + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this Trade. + + Price of the trade # noqa: E501 + + :param p: The p of this Trade. # noqa: E501 + :type: int + """ + if p is None: + raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + + self._p = p + + @property + def s(self): + """Gets the s of this Trade. # noqa: E501 + + Size of the trade # noqa: E501 + + :return: The s of this Trade. # noqa: E501 + :rtype: int + """ + return self._s + + @s.setter + def s(self, s): + """Sets the s of this Trade. + + Size of the trade # noqa: E501 + + :param s: The s of this Trade. # noqa: E501 + :type: int + """ + if s is None: + raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + + self._s = s + + @property + def t(self): + """Gets the t of this Trade. # noqa: E501 + + Timestamp of this trade # noqa: E501 + + :return: The t of this Trade. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this Trade. + + Timestamp of this trade # noqa: E501 + + :param t: The t of this Trade. # noqa: E501 + :type: int + """ + if t is None: + raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Trade, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Trade): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/polygon/rest/models/unauthorized.py b/polygon/rest/models/unauthorized.py new file mode 100644 index 00000000..aa2d689a --- /dev/null +++ b/polygon/rest/models/unauthorized.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Unauthorized(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'message': 'str' + } + + attribute_map = { + 'message': 'message' + } + + def __init__(self, message=None): # noqa: E501 + """Unauthorized - a model defined in Swagger""" # noqa: E501 + self._message = None + self.discriminator = None + if message is not None: + self.message = message + + @property + def message(self): + """Gets the message of this Unauthorized. # noqa: E501 + + + :return: The message of this Unauthorized. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Unauthorized. + + + :param message: The message of this Unauthorized. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Unauthorized, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Unauthorized): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From 188931fb024e5aef01a650965b6761f51a31223d Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:35 -0500 Subject: [PATCH 03/16] Fixed up import paths and case insensitive repeated model attributes --- polygon/rest/__init__.py | 75 ++++++++++++++ polygon/rest/api/__init__.py | 8 +- polygon/rest/api/crypto_api.py | 2 +- polygon/rest/api/forex__currencies_api.py | 2 +- polygon/rest/api/reference_api.py | 2 +- polygon/rest/api/stocks__equities_api.py | 2 +- polygon/rest/models/__init__.py | 100 +++++++++---------- polygon/rest/models/aggv2.py | 30 +++--- polygon/rest/models/stocks_snapshot_quote.py | 58 +++++------ polygon/rest/models/stocks_v2_nbbo.py | 93 +++++++++-------- polygon/rest/models/stocks_v2_trade.py | 30 +++--- polygon/rest/rest_client.py | 32 ++++++ 12 files changed, 270 insertions(+), 164 deletions(-) create mode 100644 polygon/rest/__init__.py create mode 100644 polygon/rest/rest_client.py diff --git a/polygon/rest/__init__.py b/polygon/rest/__init__.py new file mode 100644 index 00000000..0d82df78 --- /dev/null +++ b/polygon/rest/__init__.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Polygon API + + The future of fintech. # noqa: E501 + + OpenAPI spec version: 1.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from polygon.rest.api import CryptoApi +from polygon.rest.api import ForexCurrenciesApi +from polygon.rest.api import ReferenceApi +from polygon.rest.api import StocksEquitiesApi +# import ApiClient +from polygon.rest.api_client import ApiClient +from polygon.rest.configuration import Configuration +# import models into sdk package +from polygon.rest.models import AggResponse +from polygon.rest.models import Aggregate +from polygon.rest.models import Aggv2 +from polygon.rest.models import AnalystRatings +from polygon.rest.models import Company +from polygon.rest.models import ConditionTypeMap +from polygon.rest.models import Conflict +from polygon.rest.models import CryptoExchange +from polygon.rest.models import CryptoSnapshotAgg +from polygon.rest.models import CryptoSnapshotBookItem +from polygon.rest.models import CryptoSnapshotTicker +from polygon.rest.models import CryptoSnapshotTickerBook +from polygon.rest.models import CryptoTick +from polygon.rest.models import CryptoTickJson +from polygon.rest.models import Dividend +from polygon.rest.models import Earning +from polygon.rest.models import Error +from polygon.rest.models import Exchange +from polygon.rest.models import Financial +from polygon.rest.models import Financials +from polygon.rest.models import Forex +from polygon.rest.models import ForexAggregate +from polygon.rest.models import ForexSnapshotAgg +from polygon.rest.models import ForexSnapshotTicker +from polygon.rest.models import HistTrade +from polygon.rest.models import LastForexQuote +from polygon.rest.models import LastForexTrade +from polygon.rest.models import LastQuote +from polygon.rest.models import LastTrade +from polygon.rest.models import MarketHoliday +from polygon.rest.models import MarketStatus +from polygon.rest.models import News +from polygon.rest.models import NotFound +from polygon.rest.models import Quote +from polygon.rest.models import RatingSection +from polygon.rest.models import Split +from polygon.rest.models import StockSymbol +from polygon.rest.models import StocksSnapshotAgg +from polygon.rest.models import StocksSnapshotBookItem +from polygon.rest.models import StocksSnapshotQuote +from polygon.rest.models import StocksSnapshotTicker +from polygon.rest.models import StocksSnapshotTickerBook +from polygon.rest.models import StocksV2NBBO +from polygon.rest.models import StocksV2Trade +from polygon.rest.models import Symbol +from polygon.rest.models import SymbolTypeMap +from polygon.rest.models import Ticker +from polygon.rest.models import TickerSymbol +from polygon.rest.models import Trade +from polygon.rest.models import Unauthorized diff --git a/polygon/rest/api/__init__.py b/polygon/rest/api/__init__.py index 2d9a3a64..09bb8dee 100644 --- a/polygon/rest/api/__init__.py +++ b/polygon/rest/api/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa # import apis into api package -from .crypto_api import CryptoApi -from .forex__currencies_api import ForexCurrenciesApi -from .reference_api import ReferenceApi -from .stocks__equities_api import StocksEquitiesApi +from polygon.rest.api.crypto_api import CryptoApi +from polygon.rest.api.forex__currencies_api import ForexCurrenciesApi +from polygon.rest.api.reference_api import ReferenceApi +from polygon.rest.api.stocks__equities_api import StocksEquitiesApi diff --git a/polygon/rest/api/crypto_api.py b/polygon/rest/api/crypto_api.py index dbe867c6..261e0f72 100644 --- a/polygon/rest/api/crypto_api.py +++ b/polygon/rest/api/crypto_api.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from swagger_client.api_client import ApiClient +from polygon.rest.api_client import ApiClient class CryptoApi(object): diff --git a/polygon/rest/api/forex__currencies_api.py b/polygon/rest/api/forex__currencies_api.py index f3d5a59e..e69294c0 100644 --- a/polygon/rest/api/forex__currencies_api.py +++ b/polygon/rest/api/forex__currencies_api.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from swagger_client.api_client import ApiClient +from polygon.rest.api_client import ApiClient class ForexCurrenciesApi(object): diff --git a/polygon/rest/api/reference_api.py b/polygon/rest/api/reference_api.py index 184d73fc..dbb395ee 100644 --- a/polygon/rest/api/reference_api.py +++ b/polygon/rest/api/reference_api.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from swagger_client.api_client import ApiClient +from polygon.rest.api_client import ApiClient class ReferenceApi(object): diff --git a/polygon/rest/api/stocks__equities_api.py b/polygon/rest/api/stocks__equities_api.py index 15a1a49c..c968c83d 100644 --- a/polygon/rest/api/stocks__equities_api.py +++ b/polygon/rest/api/stocks__equities_api.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from swagger_client.api_client import ApiClient +from polygon.rest.api_client import ApiClient class StocksEquitiesApi(object): diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py index 56506ca9..af11d638 100644 --- a/polygon/rest/models/__init__.py +++ b/polygon/rest/models/__init__.py @@ -14,53 +14,53 @@ from __future__ import absolute_import # import models into model package -from swagger_client.models.agg_response import AggResponse -from swagger_client.models.aggregate import Aggregate -from swagger_client.models.aggv2 import Aggv2 -from swagger_client.models.analyst_ratings import AnalystRatings -from swagger_client.models.company import Company -from swagger_client.models.condition_type_map import ConditionTypeMap -from swagger_client.models.conflict import Conflict -from swagger_client.models.crypto_exchange import CryptoExchange -from swagger_client.models.crypto_snapshot_agg import CryptoSnapshotAgg -from swagger_client.models.crypto_snapshot_book_item import CryptoSnapshotBookItem -from swagger_client.models.crypto_snapshot_ticker import CryptoSnapshotTicker -from swagger_client.models.crypto_snapshot_ticker_book import CryptoSnapshotTickerBook -from swagger_client.models.crypto_tick import CryptoTick -from swagger_client.models.crypto_tick_json import CryptoTickJson -from swagger_client.models.dividend import Dividend -from swagger_client.models.earning import Earning -from swagger_client.models.error import Error -from swagger_client.models.exchange import Exchange -from swagger_client.models.financial import Financial -from swagger_client.models.financials import Financials -from swagger_client.models.forex import Forex -from swagger_client.models.forex_aggregate import ForexAggregate -from swagger_client.models.forex_snapshot_agg import ForexSnapshotAgg -from swagger_client.models.forex_snapshot_ticker import ForexSnapshotTicker -from swagger_client.models.hist_trade import HistTrade -from swagger_client.models.last_forex_quote import LastForexQuote -from swagger_client.models.last_forex_trade import LastForexTrade -from swagger_client.models.last_quote import LastQuote -from swagger_client.models.last_trade import LastTrade -from swagger_client.models.market_holiday import MarketHoliday -from swagger_client.models.market_status import MarketStatus -from swagger_client.models.news import News -from swagger_client.models.not_found import NotFound -from swagger_client.models.quote import Quote -from swagger_client.models.rating_section import RatingSection -from swagger_client.models.split import Split -from swagger_client.models.stock_symbol import StockSymbol -from swagger_client.models.stocks_snapshot_agg import StocksSnapshotAgg -from swagger_client.models.stocks_snapshot_book_item import StocksSnapshotBookItem -from swagger_client.models.stocks_snapshot_quote import StocksSnapshotQuote -from swagger_client.models.stocks_snapshot_ticker import StocksSnapshotTicker -from swagger_client.models.stocks_snapshot_ticker_book import StocksSnapshotTickerBook -from swagger_client.models.stocks_v2_nbbo import StocksV2NBBO -from swagger_client.models.stocks_v2_trade import StocksV2Trade -from swagger_client.models.symbol import Symbol -from swagger_client.models.symbol_type_map import SymbolTypeMap -from swagger_client.models.ticker import Ticker -from swagger_client.models.ticker_symbol import TickerSymbol -from swagger_client.models.trade import Trade -from swagger_client.models.unauthorized import Unauthorized +from polygon.rest.models.agg_response import AggResponse +from polygon.rest.models.aggregate import Aggregate +from polygon.rest.models.aggv2 import Aggv2 +from polygon.rest.models.analyst_ratings import AnalystRatings +from polygon.rest.models.company import Company +from polygon.rest.models.condition_type_map import ConditionTypeMap +from polygon.rest.models.conflict import Conflict +from polygon.rest.models.crypto_exchange import CryptoExchange +from polygon.rest.models.crypto_snapshot_agg import CryptoSnapshotAgg +from polygon.rest.models.crypto_snapshot_book_item import CryptoSnapshotBookItem +from polygon.rest.models.crypto_snapshot_ticker import CryptoSnapshotTicker +from polygon.rest.models.crypto_snapshot_ticker_book import CryptoSnapshotTickerBook +from polygon.rest.models.crypto_tick import CryptoTick +from polygon.rest.models.crypto_tick_json import CryptoTickJson +from polygon.rest.models.dividend import Dividend +from polygon.rest.models.earning import Earning +from polygon.rest.models.error import Error +from polygon.rest.models.exchange import Exchange +from polygon.rest.models.financial import Financial +from polygon.rest.models.financials import Financials +from polygon.rest.models.forex import Forex +from polygon.rest.models.forex_aggregate import ForexAggregate +from polygon.rest.models.forex_snapshot_agg import ForexSnapshotAgg +from polygon.rest.models.forex_snapshot_ticker import ForexSnapshotTicker +from polygon.rest.models.hist_trade import HistTrade +from polygon.rest.models.last_forex_quote import LastForexQuote +from polygon.rest.models.last_forex_trade import LastForexTrade +from polygon.rest.models.last_quote import LastQuote +from polygon.rest.models.last_trade import LastTrade +from polygon.rest.models.market_holiday import MarketHoliday +from polygon.rest.models.market_status import MarketStatus +from polygon.rest.models.news import News +from polygon.rest.models.not_found import NotFound +from polygon.rest.models.quote import Quote +from polygon.rest.models.rating_section import RatingSection +from polygon.rest.models.split import Split +from polygon.rest.models.stock_symbol import StockSymbol +from polygon.rest.models.stocks_snapshot_agg import StocksSnapshotAgg +from polygon.rest.models.stocks_snapshot_book_item import StocksSnapshotBookItem +from polygon.rest.models.stocks_snapshot_quote import StocksSnapshotQuote +from polygon.rest.models.stocks_snapshot_ticker import StocksSnapshotTicker +from polygon.rest.models.stocks_snapshot_ticker_book import StocksSnapshotTickerBook +from polygon.rest.models.stocks_v2_nbbo import StocksV2NBBO +from polygon.rest.models.stocks_v2_trade import StocksV2Trade +from polygon.rest.models.symbol import Symbol +from polygon.rest.models.symbol_type_map import SymbolTypeMap +from polygon.rest.models.ticker import Ticker +from polygon.rest.models.ticker_symbol import TickerSymbol +from polygon.rest.models.trade import Trade +from polygon.rest.models.unauthorized import Unauthorized diff --git a/polygon/rest/models/aggv2.py b/polygon/rest/models/aggv2.py index 05e46c2c..b91be9de 100644 --- a/polygon/rest/models/aggv2.py +++ b/polygon/rest/models/aggv2.py @@ -29,7 +29,7 @@ class Aggv2(object): and the value is json key in definition. """ swagger_types = { - 't': 'str', + 'T': 'str', 'v': 'int', 'o': 'int', 'c': 'int', @@ -40,7 +40,7 @@ class Aggv2(object): } attribute_map = { - 't': 'T', + 'T': 'T', 'v': 'v', 'o': 'o', 'c': 'c', @@ -50,9 +50,9 @@ class Aggv2(object): 'n': 'n' } - def __init__(self, t=None, v=None, o=None, c=None, h=None, l=None, t=None, n=None): # noqa: E501 + def __init__(self, T=None, v=None, o=None, c=None, h=None, l=None, t=None, n=None): # noqa: E501 """Aggv2 - a model defined in Swagger""" # noqa: E501 - self._t = None + self._T = None self._v = None self._o = None self._c = None @@ -61,8 +61,8 @@ def __init__(self, t=None, v=None, o=None, c=None, h=None, l=None, t=None, n=Non self._t = None self._n = None self.discriminator = None - if t is not None: - self.t = t + if T is not None: + self.T = T self.v = v self.o = o self.c = c @@ -74,27 +74,27 @@ def __init__(self, t=None, v=None, o=None, c=None, h=None, l=None, t=None, n=Non self.n = n @property - def t(self): - """Gets the t of this Aggv2. # noqa: E501 + def T(self): + """Gets the T of this Aggv2. # noqa: E501 Ticker symbol # noqa: E501 - :return: The t of this Aggv2. # noqa: E501 + :return: The T of this Aggv2. # noqa: E501 :rtype: str """ - return self._t + return self._T - @t.setter - def t(self, t): - """Sets the t of this Aggv2. + @T.setter + def T(self, T): + """Sets the T of this Aggv2. Ticker symbol # noqa: E501 - :param t: The t of this Aggv2. # noqa: E501 + :param T: The T of this Aggv2. # noqa: E501 :type: str """ - self._t = t + self._T = T @property def v(self): diff --git a/polygon/rest/models/stocks_snapshot_quote.py b/polygon/rest/models/stocks_snapshot_quote.py index b2edfb16..5b38e159 100644 --- a/polygon/rest/models/stocks_snapshot_quote.py +++ b/polygon/rest/models/stocks_snapshot_quote.py @@ -31,31 +31,31 @@ class StocksSnapshotQuote(object): swagger_types = { 'p': 'int', 's': 'int', - 'p': 'int', - 's': 'int', + 'P': 'int', + 'S': 'int', 't': 'int' } attribute_map = { 'p': 'p', 's': 's', - 'p': 'P', - 's': 'S', + 'P': 'P', + 'S': 'S', 't': 't' } - def __init__(self, p=None, s=None, p=None, s=None, t=None): # noqa: E501 + def __init__(self, p=None, s=None, P=None, S=None, t=None): # noqa: E501 """StocksSnapshotQuote - a model defined in Swagger""" # noqa: E501 self._p = None self._s = None - self._p = None + self._P = None self._s = None self._t = None self.discriminator = None self.p = p self.s = s - self.p = p - self.s = s + self.P = P + self.S = S self.t = t @property @@ -109,54 +109,54 @@ def s(self, s): self._s = s @property - def p(self): - """Gets the p of this StocksSnapshotQuote. # noqa: E501 + def P(self): + """Gets the P of this StocksSnapshotQuote. # noqa: E501 Ask Price # noqa: E501 - :return: The p of this StocksSnapshotQuote. # noqa: E501 + :return: The P of this StocksSnapshotQuote. # noqa: E501 :rtype: int """ - return self._p + return self._P - @p.setter - def p(self, p): + @P.setter + def P(self, P): """Sets the p of this StocksSnapshotQuote. Ask Price # noqa: E501 - :param p: The p of this StocksSnapshotQuote. # noqa: E501 + :param P: The P of this StocksSnapshotQuote. # noqa: E501 :type: int """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + if P is None: + raise ValueError("Invalid value for `P`, must not be `None`") # noqa: E501 - self._p = p + self._P = P @property - def s(self): - """Gets the s of this StocksSnapshotQuote. # noqa: E501 + def S(self): + """Gets the S of this StocksSnapshotQuote. # noqa: E501 Ask size in lots # noqa: E501 - :return: The s of this StocksSnapshotQuote. # noqa: E501 + :return: The S of this StocksSnapshotQuote. # noqa: E501 :rtype: int """ - return self._s + return self._S - @s.setter - def s(self, s): - """Sets the s of this StocksSnapshotQuote. + @S.setter + def S(self, S): + """Sets the S of this StocksSnapshotQuote. Ask size in lots # noqa: E501 - :param s: The s of this StocksSnapshotQuote. # noqa: E501 + :param S: The s of this StocksSnapshotQuote. # noqa: E501 :type: int """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + if S is None: + raise ValueError("Invalid value for `S`, must not be `None`") # noqa: E501 - self._s = s + self._S = S @property def t(self): diff --git a/polygon/rest/models/stocks_v2_nbbo.py b/polygon/rest/models/stocks_v2_nbbo.py index 8b3e929b..4fe55d36 100644 --- a/polygon/rest/models/stocks_v2_nbbo.py +++ b/polygon/rest/models/stocks_v2_nbbo.py @@ -29,7 +29,7 @@ class StocksV2NBBO(object): and the value is json key in definition. """ swagger_types = { - 't': 'str', + 'T': 'str', 't': 'int', 'y': 'int', 'f': 'int', @@ -39,14 +39,14 @@ class StocksV2NBBO(object): 'p': 'int', 'x': 'int', 's': 'int', - 'p': 'int', - 'x': 'int', - 's': 'int', + 'P': 'int', + 'X': 'int', + 'S': 'int', 'z': 'int' } attribute_map = { - 't': 'T', + 'T': 'T', 't': 't', 'y': 'y', 'f': 'f', @@ -56,15 +56,15 @@ class StocksV2NBBO(object): 'p': 'p', 'x': 'x', 's': 's', - 'p': 'P', - 'x': 'X', - 's': 'S', + 'P': 'P', + 'X': 'X', + 'S': 'S', 'z': 'z' } - def __init__(self, t=None, t=None, y=None, f=None, q=None, c=None, i=None, p=None, x=None, s=None, p=None, x=None, s=None, z=None): # noqa: E501 + def __init__(self, T=None, t=None, y=None, f=None, q=None, c=None, i=None, p=None, x=None, s=None, P=None, X=None, S=None, z=None): # noqa: E501 """StocksV2NBBO - a model defined in Swagger""" # noqa: E501 - self._t = None + self._T = None self._t = None self._y = None self._f = None @@ -74,13 +74,13 @@ def __init__(self, t=None, t=None, y=None, f=None, q=None, c=None, i=None, p=Non self._p = None self._x = None self._s = None - self._p = None - self._x = None - self._s = None + self._P = None + self._X = None + self._S = None self._z = None self.discriminator = None - if t is not None: - self.t = t + if T is not None: + self.T = T self.t = t if y is not None: self.y = y @@ -100,27 +100,26 @@ def __init__(self, t=None, t=None, y=None, f=None, q=None, c=None, i=None, p=Non self.z = z @property - def t(self): - """Gets the t of this StocksV2NBBO. # noqa: E501 + def T(self): + """Gets the T of this StocksV2NBBO. # noqa: E501 Ticker of the object # noqa: E501 - :return: The t of this StocksV2NBBO. # noqa: E501 + :return: The T of this StocksV2NBBO. # noqa: E501 :rtype: str """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this StocksV2NBBO. + return self._T + @T.setter + def T(self, T): + """Sets the T of this StocksV2NBBO. Ticker of the object # noqa: E501 - :param t: The t of this StocksV2NBBO. # noqa: E501 + :param T: The T of this StocksV2NBBO. # noqa: E501 :type: str """ - self._t = t + self._T = T @property def t(self): @@ -340,29 +339,29 @@ def s(self, s): self._s = s @property - def p(self): - """Gets the p of this StocksV2NBBO. # noqa: E501 + def P(self): + """Gets the P of this StocksV2NBBO. # noqa: E501 ASK Price # noqa: E501 - :return: The p of this StocksV2NBBO. # noqa: E501 + :return: The P of this StocksV2NBBO. # noqa: E501 :rtype: int """ - return self._p + return self._P - @p.setter - def p(self, p): - """Sets the p of this StocksV2NBBO. + @P.setter + def P(self, P): + """Sets the P of this StocksV2NBBO. ASK Price # noqa: E501 - :param p: The p of this StocksV2NBBO. # noqa: E501 + :param P: The P of this StocksV2NBBO. # noqa: E501 :type: int """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 + if P is None: + raise ValueError("Invalid value for `P`, must not be `None`") # noqa: E501 - self._p = p + self._P = P @property def x(self): @@ -390,29 +389,29 @@ def x(self, x): self._x = x @property - def s(self): - """Gets the s of this StocksV2NBBO. # noqa: E501 + def S(self): + """Gets the S of this StocksV2NBBO. # noqa: E501 ASK Size ( In round lots ) # noqa: E501 - :return: The s of this StocksV2NBBO. # noqa: E501 + :return: The S of this StocksV2NBBO. # noqa: E501 :rtype: int """ - return self._s + return self._S - @s.setter - def s(self, s): - """Sets the s of this StocksV2NBBO. + @S.setter + def S(self, S): + """Sets the S of this StocksV2NBBO. ASK Size ( In round lots ) # noqa: E501 - :param s: The s of this StocksV2NBBO. # noqa: E501 + :param S: The S of this StocksV2NBBO. # noqa: E501 :type: int """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 + if S is None: + raise ValueError("Invalid value for `S`, must not be `None`") # noqa: E501 - self._s = s + self._S = S @property def z(self): diff --git a/polygon/rest/models/stocks_v2_trade.py b/polygon/rest/models/stocks_v2_trade.py index cfee228e..7ba1c13f 100644 --- a/polygon/rest/models/stocks_v2_trade.py +++ b/polygon/rest/models/stocks_v2_trade.py @@ -29,7 +29,7 @@ class StocksV2Trade(object): and the value is json key in definition. """ swagger_types = { - 't': 'str', + 'T': 'str', 't': 'int', 'y': 'int', 'f': 'int', @@ -43,7 +43,7 @@ class StocksV2Trade(object): } attribute_map = { - 't': 'T', + 'T': 'T', 't': 't', 'y': 'y', 'f': 'f', @@ -56,9 +56,9 @@ class StocksV2Trade(object): 'z': 'z' } - def __init__(self, t=None, t=None, y=None, f=None, q=None, i=None, x=None, s=None, c=None, p=None, z=None): # noqa: E501 + def __init__(self, T=None, t=None, y=None, f=None, q=None, i=None, x=None, s=None, c=None, p=None, z=None): # noqa: E501 """StocksV2Trade - a model defined in Swagger""" # noqa: E501 - self._t = None + self._T = None self._t = None self._y = None self._f = None @@ -70,8 +70,8 @@ def __init__(self, t=None, t=None, y=None, f=None, q=None, i=None, x=None, s=Non self._p = None self._z = None self.discriminator = None - if t is not None: - self.t = t + if T is not None: + self.T = T self.t = t if y is not None: self.y = y @@ -86,27 +86,27 @@ def __init__(self, t=None, t=None, y=None, f=None, q=None, i=None, x=None, s=Non self.z = z @property - def t(self): - """Gets the t of this StocksV2Trade. # noqa: E501 + def T(self): + """Gets the T of this StocksV2Trade. # noqa: E501 Ticker of the object # noqa: E501 - :return: The t of this StocksV2Trade. # noqa: E501 + :return: The T of this StocksV2Trade. # noqa: E501 :rtype: str """ - return self._t + return self._T - @t.setter - def t(self, t): - """Sets the t of this StocksV2Trade. + @T.setter + def T(self, T): + """Sets the T of this StocksV2Trade. Ticker of the object # noqa: E501 - :param t: The t of this StocksV2Trade. # noqa: E501 + :param T: The T of this StocksV2Trade. # noqa: E501 :type: str """ - self._t = t + self._T = T @property def t(self): diff --git a/polygon/rest/rest_client.py b/polygon/rest/rest_client.py new file mode 100644 index 00000000..8d27e71e --- /dev/null +++ b/polygon/rest/rest_client.py @@ -0,0 +1,32 @@ +import logging + +import requests + + +class RESTClient: + DEFAULT_HOST = "api.polygon.io" + + def __init__(self, auth_key: str, debug: bool = False): + self.auth_key = auth_key + self.url = "https://" + self.DEFAULT_HOST + + self._session = requests.Session() + self._session.params["apiKey"] = self.auth_key + + logging.basicConfig(level=logging.DEBUG if debug else None) + + def tickers(self, **params): + endpoint = f"{self.url}/v2/reference/tickers" + return self._session.get(endpoint, params=params) + + def ticker_types(self, **params): + endpoint = f"{self.url}/v2/references/types" + return self._session.get(endpoint, params=params) + + def ticker_details(self, symbol, **params): + endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" + return self._session.get(endpoint, params=params) + + def ticker_news(self, symbol, **params): + endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" + return self._session.get(endpoint, params=params) \ No newline at end of file From 1228ccb157cb5873a023bc502658e1a4fb22bdea Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:44 -0500 Subject: [PATCH 04/16] Removing swagger codegen files --- polygon/rest/api/__init__.py | 9 - polygon/rest/api/crypto_api.py | 1170 ------- polygon/rest/api/forex__currencies_api.py | 893 ----- polygon/rest/api/reference_api.py | 1082 ------ polygon/rest/api/stocks__equities_api.py | 1590 --------- polygon/rest/models/__init__.py | 66 - polygon/rest/models/agg_response.py | 255 -- polygon/rest/models/aggregate.py | 288 -- polygon/rest/models/aggv2.py | 314 -- polygon/rest/models/analyst_ratings.py | 346 -- polygon/rest/models/company.py | 700 ---- polygon/rest/models/condition_type_map.py | 85 - polygon/rest/models/conflict.py | 111 - polygon/rest/models/crypto_exchange.py | 242 -- polygon/rest/models/crypto_snapshot_agg.py | 230 -- .../rest/models/crypto_snapshot_book_item.py | 143 - polygon/rest/models/crypto_snapshot_ticker.py | 309 -- .../models/crypto_snapshot_ticker_book.py | 283 -- polygon/rest/models/crypto_tick.py | 230 -- polygon/rest/models/crypto_tick_json.py | 230 -- polygon/rest/models/dividend.py | 345 -- polygon/rest/models/earning.py | 458 --- polygon/rest/models/error.py | 163 - polygon/rest/models/exchange.py | 271 -- polygon/rest/models/financial.py | 666 ---- polygon/rest/models/financials.py | 2954 ----------------- polygon/rest/models/forex.py | 172 - polygon/rest/models/forex_aggregate.py | 259 -- polygon/rest/models/forex_snapshot_agg.py | 230 -- polygon/rest/models/forex_snapshot_ticker.py | 309 -- polygon/rest/models/hist_trade.py | 317 -- polygon/rest/models/last_forex_quote.py | 201 -- polygon/rest/models/last_forex_trade.py | 172 - polygon/rest/models/last_quote.py | 288 -- polygon/rest/models/last_trade.py | 317 -- polygon/rest/models/market_holiday.py | 269 -- polygon/rest/models/market_status.py | 202 -- polygon/rest/models/news.py | 311 -- polygon/rest/models/not_found.py | 111 - polygon/rest/models/quote.py | 317 -- polygon/rest/models/rating_section.py | 257 -- polygon/rest/models/split.py | 313 -- polygon/rest/models/stock_symbol.py | 85 - polygon/rest/models/stocks_snapshot_agg.py | 230 -- .../rest/models/stocks_snapshot_book_item.py | 143 - polygon/rest/models/stocks_snapshot_quote.py | 230 -- polygon/rest/models/stocks_snapshot_ticker.py | 335 -- .../models/stocks_snapshot_ticker_book.py | 283 -- polygon/rest/models/stocks_v2_nbbo.py | 485 --- polygon/rest/models/stocks_v2_trade.py | 401 --- polygon/rest/models/symbol.py | 257 -- polygon/rest/models/symbol_type_map.py | 85 - polygon/rest/models/ticker.py | 396 --- polygon/rest/models/ticker_symbol.py | 85 - polygon/rest/models/trade.py | 317 -- polygon/rest/models/unauthorized.py | 111 - 56 files changed, 20921 deletions(-) delete mode 100644 polygon/rest/api/__init__.py delete mode 100644 polygon/rest/api/crypto_api.py delete mode 100644 polygon/rest/api/forex__currencies_api.py delete mode 100644 polygon/rest/api/reference_api.py delete mode 100644 polygon/rest/api/stocks__equities_api.py delete mode 100644 polygon/rest/models/__init__.py delete mode 100644 polygon/rest/models/agg_response.py delete mode 100644 polygon/rest/models/aggregate.py delete mode 100644 polygon/rest/models/aggv2.py delete mode 100644 polygon/rest/models/analyst_ratings.py delete mode 100644 polygon/rest/models/company.py delete mode 100644 polygon/rest/models/condition_type_map.py delete mode 100644 polygon/rest/models/conflict.py delete mode 100644 polygon/rest/models/crypto_exchange.py delete mode 100644 polygon/rest/models/crypto_snapshot_agg.py delete mode 100644 polygon/rest/models/crypto_snapshot_book_item.py delete mode 100644 polygon/rest/models/crypto_snapshot_ticker.py delete mode 100644 polygon/rest/models/crypto_snapshot_ticker_book.py delete mode 100644 polygon/rest/models/crypto_tick.py delete mode 100644 polygon/rest/models/crypto_tick_json.py delete mode 100644 polygon/rest/models/dividend.py delete mode 100644 polygon/rest/models/earning.py delete mode 100644 polygon/rest/models/error.py delete mode 100644 polygon/rest/models/exchange.py delete mode 100644 polygon/rest/models/financial.py delete mode 100644 polygon/rest/models/financials.py delete mode 100644 polygon/rest/models/forex.py delete mode 100644 polygon/rest/models/forex_aggregate.py delete mode 100644 polygon/rest/models/forex_snapshot_agg.py delete mode 100644 polygon/rest/models/forex_snapshot_ticker.py delete mode 100644 polygon/rest/models/hist_trade.py delete mode 100644 polygon/rest/models/last_forex_quote.py delete mode 100644 polygon/rest/models/last_forex_trade.py delete mode 100644 polygon/rest/models/last_quote.py delete mode 100644 polygon/rest/models/last_trade.py delete mode 100644 polygon/rest/models/market_holiday.py delete mode 100644 polygon/rest/models/market_status.py delete mode 100644 polygon/rest/models/news.py delete mode 100644 polygon/rest/models/not_found.py delete mode 100644 polygon/rest/models/quote.py delete mode 100644 polygon/rest/models/rating_section.py delete mode 100644 polygon/rest/models/split.py delete mode 100644 polygon/rest/models/stock_symbol.py delete mode 100644 polygon/rest/models/stocks_snapshot_agg.py delete mode 100644 polygon/rest/models/stocks_snapshot_book_item.py delete mode 100644 polygon/rest/models/stocks_snapshot_quote.py delete mode 100644 polygon/rest/models/stocks_snapshot_ticker.py delete mode 100644 polygon/rest/models/stocks_snapshot_ticker_book.py delete mode 100644 polygon/rest/models/stocks_v2_nbbo.py delete mode 100644 polygon/rest/models/stocks_v2_trade.py delete mode 100644 polygon/rest/models/symbol.py delete mode 100644 polygon/rest/models/symbol_type_map.py delete mode 100644 polygon/rest/models/ticker.py delete mode 100644 polygon/rest/models/ticker_symbol.py delete mode 100644 polygon/rest/models/trade.py delete mode 100644 polygon/rest/models/unauthorized.py diff --git a/polygon/rest/api/__init__.py b/polygon/rest/api/__init__.py deleted file mode 100644 index 09bb8dee..00000000 --- a/polygon/rest/api/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from polygon.rest.api.crypto_api import CryptoApi -from polygon.rest.api.forex__currencies_api import ForexCurrenciesApi -from polygon.rest.api.reference_api import ReferenceApi -from polygon.rest.api.stocks__equities_api import StocksEquitiesApi diff --git a/polygon/rest/api/crypto_api.py b/polygon/rest/api/crypto_api.py deleted file mode 100644 index 261e0f72..00000000 --- a/polygon/rest/api/crypto_api.py +++ /dev/null @@ -1,1170 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from polygon.rest.api_client import ApiClient - - -class CryptoApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def v1_historic_crypto_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 - """Historic Crypto Trades # noqa: E501 - - Get historic trade ticks for a crypto pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_crypto_from_to_date_get(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the crypto pair (required) - :param str to: To Symbol of the crypto pair (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 10000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - return data - - def v1_historic_crypto_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 - """Historic Crypto Trades # noqa: E501 - - Get historic trade ticks for a crypto pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_crypto_from_to_date_get_with_http_info(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the crypto pair (required) - :param str to: To Symbol of the crypto pair (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 10000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to', '_date', 'offset', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_historic_crypto_from_to_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_historic_crypto_from_to_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/historic/crypto/{from}/{to}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_last_crypto_from_to_get(self, _from, to, **kwargs): # noqa: E501 - """Last Trade for a Crypto Pair # noqa: E501 - - Get Last Trade Tick for a Currency Pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_crypto_from_to_get(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_last_crypto_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - else: - (data) = self.v1_last_crypto_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - return data - - def v1_last_crypto_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 - """Last Trade for a Crypto Pair # noqa: E501 - - Get Last Trade Tick for a Currency Pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_crypto_from_to_get_with_http_info(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_last_crypto_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_last_crypto_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_last_crypto_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/last/crypto/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_meta_crypto_exchanges_get(self, **kwargs): # noqa: E501 - """Crypto Exchanges # noqa: E501 - - List of crypto currency exchanges which are supported by Polygon.io # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_crypto_exchanges_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[CryptoExchange] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_meta_crypto_exchanges_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v1_meta_crypto_exchanges_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v1_meta_crypto_exchanges_get_with_http_info(self, **kwargs): # noqa: E501 - """Crypto Exchanges # noqa: E501 - - List of crypto currency exchanges which are supported by Polygon.io # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_crypto_exchanges_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[CryptoExchange] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_meta_crypto_exchanges_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/meta/crypto-exchanges', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[CryptoExchange]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_open_close_crypto_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 - """Daily Open / Close # noqa: E501 - - Get the open, close prices of a symbol on a certain day. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_open_close_crypto_from_to_date_get(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :param date _date: Date of the requested open/close (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - return data - - def v1_open_close_crypto_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 - """Daily Open / Close # noqa: E501 - - Get the open, close prices of a symbol on a certain day. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_open_close_crypto_from_to_date_get_with_http_info(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :param date _date: Date of the requested open/close (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to', '_date'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_open_close_crypto_from_to_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_open_close_crypto_from_to_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/open-close/crypto/{from}/{to}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - return data - - def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'locale' is set - if ('locale' not in params or - params['locale'] is None): - raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter 'market' is set - if ('market' not in params or - params['market'] is None): - raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'locale' in params: - path_params['locale'] = params['locale'] # noqa: E501 - if 'market' in params: - path_params['market'] = params['market'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_prev_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/prev', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'multiplier' is set - if ('multiplier' not in params or - params['multiplier'] is None): - raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'timespan' is set - if ('timespan' not in params or - params['timespan'] is None): - raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - if 'multiplier' in params: - path_params['multiplier'] = params['multiplier'] # noqa: E501 - if 'timespan' in params: - path_params['timespan'] = params['timespan'] # noqa: E501 - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_crypto_direction_get(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_direction_get(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_direction_get_with_http_info(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['direction'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_crypto_direction_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'direction' is set - if ('direction' not in params or - params['direction'] is None): - raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_global_markets_crypto_direction_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'direction' in params: - path_params['direction'] = params['direction'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/crypto/{direction}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_crypto_tickers_get(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_crypto_tickers_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/crypto/tickers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker Full Book ( L2 ) # noqa: E501 - - See the current level 2 book of a single ticker. This is the combined book from all the exchanges. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker Full Book ( L2 ) # noqa: E501 - - See the current level 2 book of a single ticker. This is the combined book from all the exchanges. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_global_markets_crypto_tickers_ticker_book_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_crypto_tickers_ticker_get(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker # noqa: E501 - - See the current snapshot of a single ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker # noqa: E501 - - See the current snapshot of a single ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_crypto_tickers_ticker_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_crypto_tickers_ticker_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_global_markets_crypto_tickers_ticker_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/polygon/rest/api/forex__currencies_api.py b/polygon/rest/api/forex__currencies_api.py deleted file mode 100644 index e69294c0..00000000 --- a/polygon/rest/api/forex__currencies_api.py +++ /dev/null @@ -1,893 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from polygon.rest.api_client import ApiClient - - -class ForexCurrenciesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def v1_conversion_from_to_get(self, _from, to, **kwargs): # noqa: E501 - """Real-time Currency Conversion # noqa: E501 - - Convert currencies using the latest market conversion rates. Note than you can convert in both directions. For example USD->CAD or CAD->USD. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_conversion_from_to_get(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :param int amount: Amount we want to convert. With decimal - :param int precision: Decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_conversion_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - else: - (data) = self.v1_conversion_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - return data - - def v1_conversion_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 - """Real-time Currency Conversion # noqa: E501 - - Convert currencies using the latest market conversion rates. Note than you can convert in both directions. For example USD->CAD or CAD->USD. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_conversion_from_to_get_with_http_info(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :param int amount: Amount we want to convert. With decimal - :param int precision: Decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to', 'amount', 'precision'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_conversion_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_conversion_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_conversion_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - if 'amount' in params: - query_params.append(('amount', params['amount'])) # noqa: E501 - if 'precision' in params: - query_params.append(('precision', params['precision'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/conversion/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_historic_forex_from_to_date_get(self, _from, to, _date, **kwargs): # noqa: E501 - """Historic Forex Ticks # noqa: E501 - - Get historic ticks for a currency pair. Example for **USD/JPY** the from would be **USD** and to would be **JPY**. The date formatted like **2017-6-22** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_forex_from_to_date_get(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the currency pair (required) - :param str to: To Symbol of the currency pair (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 10000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, **kwargs) # noqa: E501 - return data - - def v1_historic_forex_from_to_date_get_with_http_info(self, _from, to, _date, **kwargs): # noqa: E501 - """Historic Forex Ticks # noqa: E501 - - Get historic ticks for a currency pair. Example for **USD/JPY** the from would be **USD** and to would be **JPY**. The date formatted like **2017-6-22** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_forex_from_to_date_get_with_http_info(_from, to, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the currency pair (required) - :param str to: To Symbol of the currency pair (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 10000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to', '_date', 'offset', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_historic_forex_from_to_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_historic_forex_from_to_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/historic/forex/{from}/{to}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_last_quote_currencies_from_to_get(self, _from, to, **kwargs): # noqa: E501 - """Last Quote for a Currency Pair # noqa: E501 - - Get Last Quote Tick for a Currency Pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_quote_currencies_from_to_get(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - else: - (data) = self.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, **kwargs) # noqa: E501 - return data - - def v1_last_quote_currencies_from_to_get_with_http_info(self, _from, to, **kwargs): # noqa: E501 - """Last Quote for a Currency Pair # noqa: E501 - - Get Last Quote Tick for a Currency Pair. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_quote_currencies_from_to_get_with_http_info(_from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str _from: From Symbol of the pair (required) - :param str to: To Symbol of the pair (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['_from', 'to'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_last_quote_currencies_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v1_last_quote_currencies_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v1_last_quote_currencies_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/last_quote/currencies/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - return data - - def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'locale' is set - if ('locale' not in params or - params['locale'] is None): - raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter 'market' is set - if ('market' not in params or - params['market'] is None): - raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'locale' in params: - path_params['locale'] = params['locale'] # noqa: E501 - if 'market' in params: - path_params['market'] = params['market'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_prev_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/prev', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'multiplier' is set - if ('multiplier' not in params or - params['multiplier'] is None): - raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'timespan' is set - if ('timespan' not in params or - params['timespan'] is None): - raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - if 'multiplier' in params: - path_params['multiplier'] = params['multiplier'] # noqa: E501 - if 'timespan' in params: - path_params['timespan'] = params['timespan'] # noqa: E501 - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_forex_direction_get(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_forex_direction_get(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_forex_direction_get_with_http_info(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['direction'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_forex_direction_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'direction' is set - if ('direction' not in params or - params['direction'] is None): - raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_global_markets_forex_direction_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'direction' in params: - path_params['direction'] = params['direction'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/forex/{direction}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_global_markets_forex_tickers_get(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_forex_tickers_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_global_markets_forex_tickers_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_global_markets_forex_tickers_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/global/markets/forex/tickers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/polygon/rest/api/reference_api.py b/polygon/rest/api/reference_api.py deleted file mode 100644 index dbb395ee..00000000 --- a/polygon/rest/api/reference_api.py +++ /dev/null @@ -1,1082 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from polygon.rest.api_client import ApiClient - - -class ReferenceApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def v1_marketstatus_now_get(self, **kwargs): # noqa: E501 - """Market Status # noqa: E501 - - Current status of each market # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_marketstatus_now_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: MarketStatus - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_marketstatus_now_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v1_marketstatus_now_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v1_marketstatus_now_get_with_http_info(self, **kwargs): # noqa: E501 - """Market Status # noqa: E501 - - Current status of each market # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_marketstatus_now_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: MarketStatus - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_marketstatus_now_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/marketstatus/now', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MarketStatus', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_marketstatus_upcoming_get(self, **kwargs): # noqa: E501 - """Market Holidays # noqa: E501 - - Get upcoming market holidays and their open/close times # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_marketstatus_upcoming_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[MarketHoliday] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_marketstatus_upcoming_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v1_marketstatus_upcoming_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v1_marketstatus_upcoming_get_with_http_info(self, **kwargs): # noqa: E501 - """Market Holidays # noqa: E501 - - Get upcoming market holidays and their open/close times # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_marketstatus_upcoming_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[MarketHoliday] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_marketstatus_upcoming_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/marketstatus/upcoming', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[MarketHoliday]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_meta_symbols_symbol_company_get(self, symbol, **kwargs): # noqa: E501 - """Ticker Details # noqa: E501 - - Get the details of the symbol company/entity. These are important details which offer an overview of the entity. Things like name, sector, description, logo and similar companies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_symbols_symbol_company_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want details for (required) - :return: Company - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_meta_symbols_symbol_company_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v1_meta_symbols_symbol_company_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v1_meta_symbols_symbol_company_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Ticker Details # noqa: E501 - - Get the details of the symbol company/entity. These are important details which offer an overview of the entity. Things like name, sector, description, logo and similar companies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_symbols_symbol_company_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want details for (required) - :return: Company - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_meta_symbols_symbol_company_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_meta_symbols_symbol_company_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/meta/symbols/{symbol}/company', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Company', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_meta_symbols_symbol_news_get(self, symbol, **kwargs): # noqa: E501 - """Ticker News # noqa: E501 - - Get news articles for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_symbols_symbol_news_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Ticker we want details for (required) - :param float perpage: How many items to be on each page during pagination. Max 50 - :param float page: Which page of results to return - :return: list[News] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_meta_symbols_symbol_news_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v1_meta_symbols_symbol_news_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v1_meta_symbols_symbol_news_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Ticker News # noqa: E501 - - Get news articles for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_symbols_symbol_news_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Ticker we want details for (required) - :param float perpage: How many items to be on each page during pagination. Max 50 - :param float page: Which page of results to return - :return: list[News] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol', 'perpage', 'page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_meta_symbols_symbol_news_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_meta_symbols_symbol_news_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - if 'perpage' in params: - query_params.append(('perpage', params['perpage'])) # noqa: E501 - if 'page' in params: - query_params.append(('page', params['page'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/meta/symbols/{symbol}/news', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[News]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_dividends_symbol_get(self, symbol, **kwargs): # noqa: E501 - """Stock Dividends # noqa: E501 - - Get the historical divdends for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_dividends_symbol_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want dividends for (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_dividends_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v2_reference_dividends_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v2_reference_dividends_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Stock Dividends # noqa: E501 - - Get the historical divdends for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_dividends_symbol_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want dividends for (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_dividends_symbol_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_dividends_symbol_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/dividends/{symbol}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_financials_symbol_get(self, symbol, **kwargs): # noqa: E501 - """Stock Financials # noqa: E501 - - Get the historical financials for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_financials_symbol_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want financials for (required) - :param float limit: Limit the number of results - :param str type: Type of reports - :param str sort: Sort direction - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_financials_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v2_reference_financials_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v2_reference_financials_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Stock Financials # noqa: E501 - - Get the historical financials for this ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_financials_symbol_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want financials for (required) - :param float limit: Limit the number of results - :param str type: Type of reports - :param str sort: Sort direction - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol', 'limit', 'type', 'sort'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_financials_symbol_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_financials_symbol_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/financials/{symbol}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_locales_get(self, **kwargs): # noqa: E501 - """Locales # noqa: E501 - - Get the list of currently supported locales # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_locales_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_locales_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_reference_locales_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_reference_locales_get_with_http_info(self, **kwargs): # noqa: E501 - """Locales # noqa: E501 - - Get the list of currently supported locales # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_locales_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_locales_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/locales', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_markets_get(self, **kwargs): # noqa: E501 - """Markets # noqa: E501 - - Get the list of currently supported markets # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_markets_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_markets_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_reference_markets_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_reference_markets_get_with_http_info(self, **kwargs): # noqa: E501 - """Markets # noqa: E501 - - Get the list of currently supported markets # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_markets_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_markets_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/markets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_splits_symbol_get(self, symbol, **kwargs): # noqa: E501 - """Stock Splits # noqa: E501 - - Get the historical splits for this symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_splits_symbol_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want details for (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_splits_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v2_reference_splits_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v2_reference_splits_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Stock Splits # noqa: E501 - - Get the historical splits for this symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_splits_symbol_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol we want details for (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_splits_symbol_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v2_reference_splits_symbol_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/splits/{symbol}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_tickers_get(self, **kwargs): # noqa: E501 - """Tickers # noqa: E501 - - Query all ticker symbols which are supported by Polygon.io. This API includes Indices, Crypto, FX, and Stocks/Equities. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_tickers_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str sort: Which field to sort by. For desc place a `-` in front of the field name. **Example:** - `?sort=-ticker` to sort symbols Z-A - `?sort=type` to sort symbols by type - :param str type: If you want the results to only container a certain type. **Example:** - `?type=etp` to get all ETFs - `?type=cs` to get all Common Stock's - :param str market: Get tickers for a specific market **Example:** - `?market=stocks` to get all stock tickers - `?market=indices` to get all index tickers - :param str locale: Get tickers for a specific region/locale **Example:** - `?locale=us` to get all US tickers - `?locale=g` to get all Global tickers - :param str search: Search the name of tickers **Example:** - `?search=microsoft` Search tickers for microsoft - :param float perpage: How many items to be on each page during pagination. Max 50 - :param float page: Which page of results to return - :param bool active: Filter for only active or inactive symbols - :return: list[Symbol] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_tickers_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_reference_tickers_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_reference_tickers_get_with_http_info(self, **kwargs): # noqa: E501 - """Tickers # noqa: E501 - - Query all ticker symbols which are supported by Polygon.io. This API includes Indices, Crypto, FX, and Stocks/Equities. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_tickers_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str sort: Which field to sort by. For desc place a `-` in front of the field name. **Example:** - `?sort=-ticker` to sort symbols Z-A - `?sort=type` to sort symbols by type - :param str type: If you want the results to only container a certain type. **Example:** - `?type=etp` to get all ETFs - `?type=cs` to get all Common Stock's - :param str market: Get tickers for a specific market **Example:** - `?market=stocks` to get all stock tickers - `?market=indices` to get all index tickers - :param str locale: Get tickers for a specific region/locale **Example:** - `?locale=us` to get all US tickers - `?locale=g` to get all Global tickers - :param str search: Search the name of tickers **Example:** - `?search=microsoft` Search tickers for microsoft - :param float perpage: How many items to be on each page during pagination. Max 50 - :param float page: Which page of results to return - :param bool active: Filter for only active or inactive symbols - :return: list[Symbol] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['sort', 'type', 'market', 'locale', 'search', 'perpage', 'page', 'active'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_tickers_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - if 'market' in params: - query_params.append(('market', params['market'])) # noqa: E501 - if 'locale' in params: - query_params.append(('locale', params['locale'])) # noqa: E501 - if 'search' in params: - query_params.append(('search', params['search'])) # noqa: E501 - if 'perpage' in params: - query_params.append(('perpage', params['perpage'])) # noqa: E501 - if 'page' in params: - query_params.append(('page', params['page'])) # noqa: E501 - if 'active' in params: - query_params.append(('active', params['active'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/tickers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Symbol]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_reference_types_get(self, **kwargs): # noqa: E501 - """Ticker Types # noqa: E501 - - Get the mapping of ticker types to descriptions / long names # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_types_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_reference_types_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_reference_types_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_reference_types_get_with_http_info(self, **kwargs): # noqa: E501 - """Ticker Types # noqa: E501 - - Get the mapping of ticker types to descriptions / long names # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_reference_types_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_reference_types_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/reference/types', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/polygon/rest/api/stocks__equities_api.py b/polygon/rest/api/stocks__equities_api.py deleted file mode 100644 index c968c83d..00000000 --- a/polygon/rest/api/stocks__equities_api.py +++ /dev/null @@ -1,1590 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from polygon.rest.api_client import ApiClient - - -class StocksEquitiesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def v1_historic_quotes_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 - """Historic Quotes # noqa: E501 - - Get historic quotes for a symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_quotes_symbol_date_get(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the company to retrieve (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - return data - - def v1_historic_quotes_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 - """Historic Quotes # noqa: E501 - - Get historic quotes for a symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_quotes_symbol_date_get_with_http_info(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the company to retrieve (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol', '_date', 'offset', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_historic_quotes_symbol_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_historic_quotes_symbol_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_historic_quotes_symbol_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/historic/quotes/{symbol}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_historic_trades_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 - """Historic Trades # noqa: E501 - - Get historic trades for a symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_trades_symbol_date_get(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the company to retrieve (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - return data - - def v1_historic_trades_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 - """Historic Trades # noqa: E501 - - Get historic trades for a symbol. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_historic_trades_symbol_date_get_with_http_info(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the company to retrieve (required) - :param date _date: Date/Day of the historic ticks to retreive (required) - :param int offset: 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. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol', '_date', 'offset', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_historic_trades_symbol_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_historic_trades_symbol_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_historic_trades_symbol_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/historic/trades/{symbol}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_last_quote_stocks_symbol_get(self, symbol, **kwargs): # noqa: E501 - """Last Quote for a Symbol # noqa: E501 - - Get the last quote tick for a given stock. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_quote_stocks_symbol_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the quote to get (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_last_quote_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v1_last_quote_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v1_last_quote_stocks_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Last Quote for a Symbol # noqa: E501 - - Get the last quote tick for a given stock. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_quote_stocks_symbol_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the quote to get (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_last_quote_stocks_symbol_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_last_quote_stocks_symbol_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/last_quote/stocks/{symbol}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_last_stocks_symbol_get(self, symbol, **kwargs): # noqa: E501 - """Last Trade for a Symbol # noqa: E501 - - Get the last trade for a given stock. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_stocks_symbol_get(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the stock to get (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_last_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - else: - (data) = self.v1_last_stocks_symbol_get_with_http_info(symbol, **kwargs) # noqa: E501 - return data - - def v1_last_stocks_symbol_get_with_http_info(self, symbol, **kwargs): # noqa: E501 - """Last Trade for a Symbol # noqa: E501 - - Get the last trade for a given stock. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_last_stocks_symbol_get_with_http_info(symbol, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the stock to get (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_last_stocks_symbol_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_last_stocks_symbol_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/last/stocks/{symbol}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_meta_conditions_ticktype_get(self, ticktype, **kwargs): # noqa: E501 - """Condition Mappings # noqa: E501 - - The mappings for conditions on trades and quotes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_conditions_ticktype_get(ticktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticktype: Ticker type we want mappings for (required) - :return: ConditionTypeMap - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_meta_conditions_ticktype_get_with_http_info(ticktype, **kwargs) # noqa: E501 - else: - (data) = self.v1_meta_conditions_ticktype_get_with_http_info(ticktype, **kwargs) # noqa: E501 - return data - - def v1_meta_conditions_ticktype_get_with_http_info(self, ticktype, **kwargs): # noqa: E501 - """Condition Mappings # noqa: E501 - - The mappings for conditions on trades and quotes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_conditions_ticktype_get_with_http_info(ticktype, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticktype: Ticker type we want mappings for (required) - :return: ConditionTypeMap - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticktype'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_meta_conditions_ticktype_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticktype' is set - if ('ticktype' not in params or - params['ticktype'] is None): - raise ValueError("Missing the required parameter `ticktype` when calling `v1_meta_conditions_ticktype_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticktype' in params: - path_params['ticktype'] = params['ticktype'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/meta/conditions/{ticktype}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ConditionTypeMap', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_meta_exchanges_get(self, **kwargs): # noqa: E501 - """Exchanges # noqa: E501 - - List of stock exchanges which are supported by Polygon.io # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_exchanges_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[Exchange] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_meta_exchanges_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v1_meta_exchanges_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v1_meta_exchanges_get_with_http_info(self, **kwargs): # noqa: E501 - """Exchanges # noqa: E501 - - List of stock exchanges which are supported by Polygon.io # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_meta_exchanges_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: list[Exchange] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_meta_exchanges_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/meta/exchanges', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Exchange]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v1_open_close_symbol_date_get(self, symbol, _date, **kwargs): # noqa: E501 - """Daily Open / Close # noqa: E501 - - Get the open, close and afterhours prices of a symbol on a certain date. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_open_close_symbol_date_get(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the stock to get (required) - :param date _date: Date of the requested open/close (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v1_open_close_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - else: - (data) = self.v1_open_close_symbol_date_get_with_http_info(symbol, _date, **kwargs) # noqa: E501 - return data - - def v1_open_close_symbol_date_get_with_http_info(self, symbol, _date, **kwargs): # noqa: E501 - """Daily Open / Close # noqa: E501 - - Get the open, close and afterhours prices of a symbol on a certain date. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v1_open_close_symbol_date_get_with_http_info(symbol, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str symbol: Symbol of the stock to get (required) - :param date _date: Date of the requested open/close (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['symbol', '_date'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v1_open_close_symbol_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'symbol' is set - if ('symbol' not in params or - params['symbol'] is None): - raise ValueError("Missing the required parameter `symbol` when calling `v1_open_close_symbol_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v1_open_close_symbol_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'symbol' in params: - path_params['symbol'] = params['symbol'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v1/open-close/{symbol}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_grouped_locale_locale_market_market_date_get(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, **kwargs) # noqa: E501 - return data - - def v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(self, locale, market, _date, **kwargs): # noqa: E501 - """Grouped Daily # noqa: E501 - - Get the daily OHLC for entire markets. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_grouped_locale_locale_market_market_date_get_with_http_info(locale, market, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str locale: Locale of the aggregates ( See 'Locales' API ) (required) - :param str market: Market of the aggregates ( See 'Markets' API ) (required) - :param str _date: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['locale', 'market', '_date', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_grouped_locale_locale_market_market_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'locale' is set - if ('locale' not in params or - params['locale'] is None): - raise ValueError("Missing the required parameter `locale` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter 'market' is set - if ('market' not in params or - params['market'] is None): - raise ValueError("Missing the required parameter `market` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v2_aggs_grouped_locale_locale_market_market_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'locale' in params: - path_params['locale'] = params['locale'] # noqa: E501 - if 'market' in params: - path_params['market'] = params['market'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/grouped/locale/{locale}/market/{market}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_prev_get(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_prev_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Previous Close # noqa: E501 - - Get the previous day close for the specified ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_prev_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_prev_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_prev_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/prev', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - else: - (data) = self.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, **kwargs) # noqa: E501 - return data - - def v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(self, ticker, multiplier, timespan, _from, to, **kwargs): # noqa: E501 - """Aggregates # noqa: E501 - - Get aggregates for a date range, in custom time window sizes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get_with_http_info(ticker, multiplier, timespan, _from, to, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol of the request (required) - :param float multiplier: Size of the timespan multiplier (required) - :param str timespan: Size of the time window (required) - :param str _from: From date (required) - :param str to: To date (required) - :param bool unadjusted: Set to true if the results should NOT be adjusted for splits. - :return: AggResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', 'multiplier', 'timespan', '_from', 'to', 'unadjusted'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'multiplier' is set - if ('multiplier' not in params or - params['multiplier'] is None): - raise ValueError("Missing the required parameter `multiplier` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'timespan' is set - if ('timespan' not in params or - params['timespan'] is None): - raise ValueError("Missing the required parameter `timespan` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter '_from' is set - if ('_from' not in params or - params['_from'] is None): - raise ValueError("Missing the required parameter `_from` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - # verify the required parameter 'to' is set - if ('to' not in params or - params['to'] is None): - raise ValueError("Missing the required parameter `to` when calling `v2_aggs_ticker_ticker_range_multiplier_timespan_from_to_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - if 'multiplier' in params: - path_params['multiplier'] = params['multiplier'] # noqa: E501 - if 'timespan' in params: - path_params['timespan'] = params['timespan'] # noqa: E501 - if '_from' in params: - path_params['from'] = params['_from'] # noqa: E501 - if 'to' in params: - path_params['to'] = params['to'] # noqa: E501 - - query_params = [] - if 'unadjusted' in params: - query_params.append(('unadjusted', params['unadjusted'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AggResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_us_markets_stocks_direction_get(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_direction_get(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(self, direction, **kwargs): # noqa: E501 - """Snapshot - Gainers / Losers # noqa: E501 - - See the current snapshot of the top 20 gainers or losers of the day at the moment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_direction_get_with_http_info(direction, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str direction: Direction we want (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['direction'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_us_markets_stocks_direction_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'direction' is set - if ('direction' not in params or - params['direction'] is None): - raise ValueError("Missing the required parameter `direction` when calling `v2_snapshot_locale_us_markets_stocks_direction_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'direction' in params: - path_params['direction'] = params['direction'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/us/markets/stocks/{direction}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_us_markets_stocks_tickers_get(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_get(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(**kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(self, **kwargs): # noqa: E501 - """Snapshot - All Tickers # noqa: E501 - - Snapshot allows you to see all tickers current minute aggregate, daily aggregate and last trade. As well as previous days aggregate and calculated change for today. ### *** Warning, may cause browser to hang *** The response size is large, and sometimes will cause the browser prettyprint to crash. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_us_markets_stocks_tickers_get" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/us/markets/stocks/tickers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_snapshot_locale_us_markets_stocks_tickers_ticker_get(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker # noqa: E501 - - See the current snapshot of a single ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 - else: - (data) = self.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, **kwargs) # noqa: E501 - return data - - def v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(self, ticker, **kwargs): # noqa: E501 - """Snapshot - Single Ticker # noqa: E501 - - See the current snapshot of a single ticker # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_snapshot_locale_us_markets_stocks_tickers_ticker_get_with_http_info(ticker, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker of the snapshot (required) - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_snapshot_locale_us_markets_stocks_tickers_ticker_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_snapshot_locale_us_markets_stocks_tickers_ticker_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_ticks_stocks_nbbo_ticker_date_get(self, ticker, _date, **kwargs): # noqa: E501 - """( v2 ) Historic NBBO Quotes # noqa: E501 - - Get historic NBBO quotes for a ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_ticks_stocks_nbbo_ticker_date_get(ticker, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol we want ticks for (required) - :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) - :param int timestamp: 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. - :param int timestamp_limit: Maximum timestamp allowed in the results. - :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 - else: - (data) = self.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 - return data - - def v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(self, ticker, _date, **kwargs): # noqa: E501 - """( v2 ) Historic NBBO Quotes # noqa: E501 - - Get historic NBBO quotes for a ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_ticks_stocks_nbbo_ticker_date_get_with_http_info(ticker, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol we want ticks for (required) - :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) - :param int timestamp: 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. - :param int timestamp_limit: Maximum timestamp allowed in the results. - :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', '_date', 'timestamp', 'timestamp_limit', 'reverse', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_ticks_stocks_nbbo_ticker_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_ticks_stocks_nbbo_ticker_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v2_ticks_stocks_nbbo_ticker_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'timestamp' in params: - query_params.append(('timestamp', params['timestamp'])) # noqa: E501 - if 'timestamp_limit' in params: - query_params.append(('timestampLimit', params['timestamp_limit'])) # noqa: E501 - if 'reverse' in params: - query_params.append(('reverse', params['reverse'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/ticks/stocks/nbbo/{ticker}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def v2_ticks_stocks_trades_ticker_date_get(self, ticker, _date, **kwargs): # noqa: E501 - """( v2 ) Historic Trades # noqa: E501 - - Get historic trades for a ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_ticks_stocks_trades_ticker_date_get(ticker, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol we want ticks for (required) - :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) - :param int timestamp: 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. - :param int timestamp_limit: Maximum timestamp allowed in the results. - :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 - else: - (data) = self.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, **kwargs) # noqa: E501 - return data - - def v2_ticks_stocks_trades_ticker_date_get_with_http_info(self, ticker, _date, **kwargs): # noqa: E501 - """( v2 ) Historic Trades # noqa: E501 - - Get historic trades for a ticker. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.v2_ticks_stocks_trades_ticker_date_get_with_http_info(ticker, _date, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str ticker: Ticker symbol we want ticks for (required) - :param date _date: Date/Day of the historic ticks to retreive ( YYYY-MM-DD ) (required) - :param int timestamp: 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. - :param int timestamp_limit: Maximum timestamp allowed in the results. - :param bool reverse: Reverse the order of the results. This is useful in combination with `timestamp` param. - :param int limit: Limit the size of response, Max 50000 - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['ticker', '_date', 'timestamp', 'timestamp_limit', 'reverse', 'limit'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method v2_ticks_stocks_trades_ticker_date_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'ticker' is set - if ('ticker' not in params or - params['ticker'] is None): - raise ValueError("Missing the required parameter `ticker` when calling `v2_ticks_stocks_trades_ticker_date_get`") # noqa: E501 - # verify the required parameter '_date' is set - if ('_date' not in params or - params['_date'] is None): - raise ValueError("Missing the required parameter `_date` when calling `v2_ticks_stocks_trades_ticker_date_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'ticker' in params: - path_params['ticker'] = params['ticker'] # noqa: E501 - if '_date' in params: - path_params['date'] = params['_date'] # noqa: E501 - - query_params = [] - if 'timestamp' in params: - query_params.append(('timestamp', params['timestamp'])) # noqa: E501 - if 'timestamp_limit' in params: - query_params.append(('timestampLimit', params['timestamp_limit'])) # noqa: E501 - if 'reverse' in params: - query_params.append(('reverse', params['reverse'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiKey'] # noqa: E501 - - return self.api_client.call_api( - '/v2/ticks/stocks/trades/{ticker}/{date}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py deleted file mode 100644 index af11d638..00000000 --- a/polygon/rest/models/__init__.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -# import models into model package -from polygon.rest.models.agg_response import AggResponse -from polygon.rest.models.aggregate import Aggregate -from polygon.rest.models.aggv2 import Aggv2 -from polygon.rest.models.analyst_ratings import AnalystRatings -from polygon.rest.models.company import Company -from polygon.rest.models.condition_type_map import ConditionTypeMap -from polygon.rest.models.conflict import Conflict -from polygon.rest.models.crypto_exchange import CryptoExchange -from polygon.rest.models.crypto_snapshot_agg import CryptoSnapshotAgg -from polygon.rest.models.crypto_snapshot_book_item import CryptoSnapshotBookItem -from polygon.rest.models.crypto_snapshot_ticker import CryptoSnapshotTicker -from polygon.rest.models.crypto_snapshot_ticker_book import CryptoSnapshotTickerBook -from polygon.rest.models.crypto_tick import CryptoTick -from polygon.rest.models.crypto_tick_json import CryptoTickJson -from polygon.rest.models.dividend import Dividend -from polygon.rest.models.earning import Earning -from polygon.rest.models.error import Error -from polygon.rest.models.exchange import Exchange -from polygon.rest.models.financial import Financial -from polygon.rest.models.financials import Financials -from polygon.rest.models.forex import Forex -from polygon.rest.models.forex_aggregate import ForexAggregate -from polygon.rest.models.forex_snapshot_agg import ForexSnapshotAgg -from polygon.rest.models.forex_snapshot_ticker import ForexSnapshotTicker -from polygon.rest.models.hist_trade import HistTrade -from polygon.rest.models.last_forex_quote import LastForexQuote -from polygon.rest.models.last_forex_trade import LastForexTrade -from polygon.rest.models.last_quote import LastQuote -from polygon.rest.models.last_trade import LastTrade -from polygon.rest.models.market_holiday import MarketHoliday -from polygon.rest.models.market_status import MarketStatus -from polygon.rest.models.news import News -from polygon.rest.models.not_found import NotFound -from polygon.rest.models.quote import Quote -from polygon.rest.models.rating_section import RatingSection -from polygon.rest.models.split import Split -from polygon.rest.models.stock_symbol import StockSymbol -from polygon.rest.models.stocks_snapshot_agg import StocksSnapshotAgg -from polygon.rest.models.stocks_snapshot_book_item import StocksSnapshotBookItem -from polygon.rest.models.stocks_snapshot_quote import StocksSnapshotQuote -from polygon.rest.models.stocks_snapshot_ticker import StocksSnapshotTicker -from polygon.rest.models.stocks_snapshot_ticker_book import StocksSnapshotTickerBook -from polygon.rest.models.stocks_v2_nbbo import StocksV2NBBO -from polygon.rest.models.stocks_v2_trade import StocksV2Trade -from polygon.rest.models.symbol import Symbol -from polygon.rest.models.symbol_type_map import SymbolTypeMap -from polygon.rest.models.ticker import Ticker -from polygon.rest.models.ticker_symbol import TickerSymbol -from polygon.rest.models.trade import Trade -from polygon.rest.models.unauthorized import Unauthorized diff --git a/polygon/rest/models/agg_response.py b/polygon/rest/models/agg_response.py deleted file mode 100644 index efb2dfe2..00000000 --- a/polygon/rest/models/agg_response.py +++ /dev/null @@ -1,255 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class AggResponse(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'status': 'str', - 'adjusted': 'bool', - 'query_count': 'float', - 'results_count': 'float', - 'results': 'list[Aggv2]' - } - - attribute_map = { - 'ticker': 'ticker', - 'status': 'status', - 'adjusted': 'adjusted', - 'query_count': 'queryCount', - 'results_count': 'resultsCount', - 'results': 'results' - } - - def __init__(self, ticker=None, status=None, adjusted=None, query_count=None, results_count=None, results=None): # noqa: E501 - """AggResponse - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._status = None - self._adjusted = None - self._query_count = None - self._results_count = None - self._results = None - self.discriminator = None - self.ticker = ticker - self.status = status - self.adjusted = adjusted - if query_count is not None: - self.query_count = query_count - if results_count is not None: - self.results_count = results_count - self.results = results - - @property - def ticker(self): - """Gets the ticker of this AggResponse. # noqa: E501 - - Ticker symbol requested # noqa: E501 - - :return: The ticker of this AggResponse. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this AggResponse. - - Ticker symbol requested # noqa: E501 - - :param ticker: The ticker of this AggResponse. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def status(self): - """Gets the status of this AggResponse. # noqa: E501 - - Status of the response # noqa: E501 - - :return: The status of this AggResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this AggResponse. - - Status of the response # noqa: E501 - - :param status: The status of this AggResponse. # noqa: E501 - :type: str - """ - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - - self._status = status - - @property - def adjusted(self): - """Gets the adjusted of this AggResponse. # noqa: E501 - - If this response was adjusted for splits # noqa: E501 - - :return: The adjusted of this AggResponse. # noqa: E501 - :rtype: bool - """ - return self._adjusted - - @adjusted.setter - def adjusted(self, adjusted): - """Sets the adjusted of this AggResponse. - - If this response was adjusted for splits # noqa: E501 - - :param adjusted: The adjusted of this AggResponse. # noqa: E501 - :type: bool - """ - if adjusted is None: - raise ValueError("Invalid value for `adjusted`, must not be `None`") # noqa: E501 - - self._adjusted = adjusted - - @property - def query_count(self): - """Gets the query_count of this AggResponse. # noqa: E501 - - Number of aggregate ( min or day ) used to generate the response # noqa: E501 - - :return: The query_count of this AggResponse. # noqa: E501 - :rtype: float - """ - return self._query_count - - @query_count.setter - def query_count(self, query_count): - """Sets the query_count of this AggResponse. - - Number of aggregate ( min or day ) used to generate the response # noqa: E501 - - :param query_count: The query_count of this AggResponse. # noqa: E501 - :type: float - """ - - self._query_count = query_count - - @property - def results_count(self): - """Gets the results_count of this AggResponse. # noqa: E501 - - Total number of results generated # noqa: E501 - - :return: The results_count of this AggResponse. # noqa: E501 - :rtype: float - """ - return self._results_count - - @results_count.setter - def results_count(self, results_count): - """Sets the results_count of this AggResponse. - - Total number of results generated # noqa: E501 - - :param results_count: The results_count of this AggResponse. # noqa: E501 - :type: float - """ - - self._results_count = results_count - - @property - def results(self): - """Gets the results of this AggResponse. # noqa: E501 - - - :return: The results of this AggResponse. # noqa: E501 - :rtype: list[Aggv2] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this AggResponse. - - - :param results: The results of this AggResponse. # noqa: E501 - :type: list[Aggv2] - """ - if results is None: - raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(AggResponse, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AggResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/aggregate.py b/polygon/rest/models/aggregate.py deleted file mode 100644 index 404de86a..00000000 --- a/polygon/rest/models/aggregate.py +++ /dev/null @@ -1,288 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Aggregate(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'o': 'int', - 'c': 'int', - 'l': 'int', - 'h': 'int', - 'v': 'int', - 'k': 'int', - 't': 'int' - } - - attribute_map = { - 'o': 'o', - 'c': 'c', - 'l': 'l', - 'h': 'h', - 'v': 'v', - 'k': 'k', - 't': 't' - } - - def __init__(self, o=None, c=None, l=None, h=None, v=None, k=None, t=None): # noqa: E501 - """Aggregate - a model defined in Swagger""" # noqa: E501 - self._o = None - self._c = None - self._l = None - self._h = None - self._v = None - self._k = None - self._t = None - self.discriminator = None - self.o = o - self.c = c - self.l = l - self.h = h - self.v = v - self.k = k - self.t = t - - @property - def o(self): - """Gets the o of this Aggregate. # noqa: E501 - - Open price # noqa: E501 - - :return: The o of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this Aggregate. - - Open price # noqa: E501 - - :param o: The o of this Aggregate. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def c(self): - """Gets the c of this Aggregate. # noqa: E501 - - Close price # noqa: E501 - - :return: The c of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this Aggregate. - - Close price # noqa: E501 - - :param c: The c of this Aggregate. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def l(self): - """Gets the l of this Aggregate. # noqa: E501 - - Low price # noqa: E501 - - :return: The l of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this Aggregate. - - Low price # noqa: E501 - - :param l: The l of this Aggregate. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def h(self): - """Gets the h of this Aggregate. # noqa: E501 - - High price # noqa: E501 - - :return: The h of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this Aggregate. - - High price # noqa: E501 - - :param h: The h of this Aggregate. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def v(self): - """Gets the v of this Aggregate. # noqa: E501 - - Total Volume of all trades ( total shares exchanged ) # noqa: E501 - - :return: The v of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this Aggregate. - - Total Volume of all trades ( total shares exchanged ) # noqa: E501 - - :param v: The v of this Aggregate. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - @property - def k(self): - """Gets the k of this Aggregate. # noqa: E501 - - Transactions ( 1 transaction contains X shares exchanged ) # noqa: E501 - - :return: The k of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._k - - @k.setter - def k(self, k): - """Sets the k of this Aggregate. - - Transactions ( 1 transaction contains X shares exchanged ) # noqa: E501 - - :param k: The k of this Aggregate. # noqa: E501 - :type: int - """ - if k is None: - raise ValueError("Invalid value for `k`, must not be `None`") # noqa: E501 - - self._k = k - - @property - def t(self): - """Gets the t of this Aggregate. # noqa: E501 - - Timestamp of this aggregation # noqa: E501 - - :return: The t of this Aggregate. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this Aggregate. - - Timestamp of this aggregation # noqa: E501 - - :param t: The t of this Aggregate. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Aggregate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Aggregate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/aggv2.py b/polygon/rest/models/aggv2.py deleted file mode 100644 index b91be9de..00000000 --- a/polygon/rest/models/aggv2.py +++ /dev/null @@ -1,314 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Aggv2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'T': 'str', - 'v': 'int', - 'o': 'int', - 'c': 'int', - 'h': 'int', - 'l': 'int', - 't': 'float', - 'n': 'float' - } - - attribute_map = { - 'T': 'T', - 'v': 'v', - 'o': 'o', - 'c': 'c', - 'h': 'h', - 'l': 'l', - 't': 't', - 'n': 'n' - } - - def __init__(self, T=None, v=None, o=None, c=None, h=None, l=None, t=None, n=None): # noqa: E501 - """Aggv2 - a model defined in Swagger""" # noqa: E501 - self._T = None - self._v = None - self._o = None - self._c = None - self._h = None - self._l = None - self._t = None - self._n = None - self.discriminator = None - if T is not None: - self.T = T - self.v = v - self.o = o - self.c = c - self.h = h - self.l = l - if t is not None: - self.t = t - if n is not None: - self.n = n - - @property - def T(self): - """Gets the T of this Aggv2. # noqa: E501 - - Ticker symbol # noqa: E501 - - :return: The T of this Aggv2. # noqa: E501 - :rtype: str - """ - return self._T - - @T.setter - def T(self, T): - """Sets the T of this Aggv2. - - Ticker symbol # noqa: E501 - - :param T: The T of this Aggv2. # noqa: E501 - :type: str - """ - - self._T = T - - @property - def v(self): - """Gets the v of this Aggv2. # noqa: E501 - - Volume # noqa: E501 - - :return: The v of this Aggv2. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this Aggv2. - - Volume # noqa: E501 - - :param v: The v of this Aggv2. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - @property - def o(self): - """Gets the o of this Aggv2. # noqa: E501 - - Open # noqa: E501 - - :return: The o of this Aggv2. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this Aggv2. - - Open # noqa: E501 - - :param o: The o of this Aggv2. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def c(self): - """Gets the c of this Aggv2. # noqa: E501 - - Close # noqa: E501 - - :return: The c of this Aggv2. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this Aggv2. - - Close # noqa: E501 - - :param c: The c of this Aggv2. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def h(self): - """Gets the h of this Aggv2. # noqa: E501 - - High # noqa: E501 - - :return: The h of this Aggv2. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this Aggv2. - - High # noqa: E501 - - :param h: The h of this Aggv2. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def l(self): - """Gets the l of this Aggv2. # noqa: E501 - - Low # noqa: E501 - - :return: The l of this Aggv2. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this Aggv2. - - Low # noqa: E501 - - :param l: The l of this Aggv2. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def t(self): - """Gets the t of this Aggv2. # noqa: E501 - - Unix Msec Timestamp ( Start of Aggregate window ) # noqa: E501 - - :return: The t of this Aggv2. # noqa: E501 - :rtype: float - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this Aggv2. - - Unix Msec Timestamp ( Start of Aggregate window ) # noqa: E501 - - :param t: The t of this Aggv2. # noqa: E501 - :type: float - """ - - self._t = t - - @property - def n(self): - """Gets the n of this Aggv2. # noqa: E501 - - Number of items in aggregate window # noqa: E501 - - :return: The n of this Aggv2. # noqa: E501 - :rtype: float - """ - return self._n - - @n.setter - def n(self, n): - """Sets the n of this Aggv2. - - Number of items in aggregate window # noqa: E501 - - :param n: The n of this Aggv2. # noqa: E501 - :type: float - """ - - self._n = n - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Aggv2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Aggv2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/analyst_ratings.py b/polygon/rest/models/analyst_ratings.py deleted file mode 100644 index 9d9347e9..00000000 --- a/polygon/rest/models/analyst_ratings.py +++ /dev/null @@ -1,346 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class AnalystRatings(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbol': 'str', - 'analysts': 'float', - 'change': 'float', - 'strong_buy': 'object', - 'buy': 'object', - 'hold': 'object', - 'sell': 'object', - 'strong_sell': 'object', - 'updated': 'datetime' - } - - attribute_map = { - 'symbol': 'symbol', - 'analysts': 'analysts', - 'change': 'change', - 'strong_buy': 'strongBuy', - 'buy': 'buy', - 'hold': 'hold', - 'sell': 'sell', - 'strong_sell': 'strongSell', - 'updated': 'updated' - } - - def __init__(self, symbol=None, analysts=None, change=None, strong_buy=None, buy=None, hold=None, sell=None, strong_sell=None, updated=None): # noqa: E501 - """AnalystRatings - a model defined in Swagger""" # noqa: E501 - self._symbol = None - self._analysts = None - self._change = None - self._strong_buy = None - self._buy = None - self._hold = None - self._sell = None - self._strong_sell = None - self._updated = None - self.discriminator = None - self.symbol = symbol - self.analysts = analysts - self.change = change - self.strong_buy = strong_buy - self.buy = buy - self.hold = hold - self.sell = sell - self.strong_sell = strong_sell - self.updated = updated - - @property - def symbol(self): - """Gets the symbol of this AnalystRatings. # noqa: E501 - - Symbol which we are requesting ratings # noqa: E501 - - :return: The symbol of this AnalystRatings. # noqa: E501 - :rtype: str - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this AnalystRatings. - - Symbol which we are requesting ratings # noqa: E501 - - :param symbol: The symbol of this AnalystRatings. # noqa: E501 - :type: str - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def analysts(self): - """Gets the analysts of this AnalystRatings. # noqa: E501 - - Number of analysts reporting # noqa: E501 - - :return: The analysts of this AnalystRatings. # noqa: E501 - :rtype: float - """ - return self._analysts - - @analysts.setter - def analysts(self, analysts): - """Sets the analysts of this AnalystRatings. - - Number of analysts reporting # noqa: E501 - - :param analysts: The analysts of this AnalystRatings. # noqa: E501 - :type: float - """ - if analysts is None: - raise ValueError("Invalid value for `analysts`, must not be `None`") # noqa: E501 - - self._analysts = analysts - - @property - def change(self): - """Gets the change of this AnalystRatings. # noqa: E501 - - Change from last month to current # noqa: E501 - - :return: The change of this AnalystRatings. # noqa: E501 - :rtype: float - """ - return self._change - - @change.setter - def change(self, change): - """Sets the change of this AnalystRatings. - - Change from last month to current # noqa: E501 - - :param change: The change of this AnalystRatings. # noqa: E501 - :type: float - """ - if change is None: - raise ValueError("Invalid value for `change`, must not be `None`") # noqa: E501 - - self._change = change - - @property - def strong_buy(self): - """Gets the strong_buy of this AnalystRatings. # noqa: E501 - - Strong buy ratings # noqa: E501 - - :return: The strong_buy of this AnalystRatings. # noqa: E501 - :rtype: object - """ - return self._strong_buy - - @strong_buy.setter - def strong_buy(self, strong_buy): - """Sets the strong_buy of this AnalystRatings. - - Strong buy ratings # noqa: E501 - - :param strong_buy: The strong_buy of this AnalystRatings. # noqa: E501 - :type: object - """ - if strong_buy is None: - raise ValueError("Invalid value for `strong_buy`, must not be `None`") # noqa: E501 - - self._strong_buy = strong_buy - - @property - def buy(self): - """Gets the buy of this AnalystRatings. # noqa: E501 - - Moderate buy ratings # noqa: E501 - - :return: The buy of this AnalystRatings. # noqa: E501 - :rtype: object - """ - return self._buy - - @buy.setter - def buy(self, buy): - """Sets the buy of this AnalystRatings. - - Moderate buy ratings # noqa: E501 - - :param buy: The buy of this AnalystRatings. # noqa: E501 - :type: object - """ - if buy is None: - raise ValueError("Invalid value for `buy`, must not be `None`") # noqa: E501 - - self._buy = buy - - @property - def hold(self): - """Gets the hold of this AnalystRatings. # noqa: E501 - - Hold ratings # noqa: E501 - - :return: The hold of this AnalystRatings. # noqa: E501 - :rtype: object - """ - return self._hold - - @hold.setter - def hold(self, hold): - """Sets the hold of this AnalystRatings. - - Hold ratings # noqa: E501 - - :param hold: The hold of this AnalystRatings. # noqa: E501 - :type: object - """ - if hold is None: - raise ValueError("Invalid value for `hold`, must not be `None`") # noqa: E501 - - self._hold = hold - - @property - def sell(self): - """Gets the sell of this AnalystRatings. # noqa: E501 - - Moderate Sell ratings # noqa: E501 - - :return: The sell of this AnalystRatings. # noqa: E501 - :rtype: object - """ - return self._sell - - @sell.setter - def sell(self, sell): - """Sets the sell of this AnalystRatings. - - Moderate Sell ratings # noqa: E501 - - :param sell: The sell of this AnalystRatings. # noqa: E501 - :type: object - """ - if sell is None: - raise ValueError("Invalid value for `sell`, must not be `None`") # noqa: E501 - - self._sell = sell - - @property - def strong_sell(self): - """Gets the strong_sell of this AnalystRatings. # noqa: E501 - - Strong Sell ratings # noqa: E501 - - :return: The strong_sell of this AnalystRatings. # noqa: E501 - :rtype: object - """ - return self._strong_sell - - @strong_sell.setter - def strong_sell(self, strong_sell): - """Sets the strong_sell of this AnalystRatings. - - Strong Sell ratings # noqa: E501 - - :param strong_sell: The strong_sell of this AnalystRatings. # noqa: E501 - :type: object - """ - if strong_sell is None: - raise ValueError("Invalid value for `strong_sell`, must not be `None`") # noqa: E501 - - self._strong_sell = strong_sell - - @property - def updated(self): - """Gets the updated of this AnalystRatings. # noqa: E501 - - Last time the ratings for this symbol were updated. # noqa: E501 - - :return: The updated of this AnalystRatings. # noqa: E501 - :rtype: datetime - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this AnalystRatings. - - Last time the ratings for this symbol were updated. # noqa: E501 - - :param updated: The updated of this AnalystRatings. # noqa: E501 - :type: datetime - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(AnalystRatings, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AnalystRatings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/company.py b/polygon/rest/models/company.py deleted file mode 100644 index 866ec502..00000000 --- a/polygon/rest/models/company.py +++ /dev/null @@ -1,700 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Company(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'logo': 'str', - 'exchange': 'str', - 'name': 'str', - 'symbol': 'StockSymbol', - 'listdate': 'date', - 'cik': 'str', - 'bloomberg': 'str', - 'figi': 'str', - 'lei': 'str', - 'sic': 'float', - 'country': 'str', - 'industry': 'str', - 'sector': 'str', - 'marketcap': 'float', - 'employees': 'float', - 'phone': 'str', - 'ceo': 'str', - 'url': 'str', - 'description': 'str', - 'similar': 'list[StockSymbol]', - 'tags': 'list[str]', - 'updated': 'datetime' - } - - attribute_map = { - 'logo': 'logo', - 'exchange': 'exchange', - 'name': 'name', - 'symbol': 'symbol', - 'listdate': 'listdate', - 'cik': 'cik', - 'bloomberg': 'bloomberg', - 'figi': 'figi', - 'lei': 'lei', - 'sic': 'sic', - 'country': 'country', - 'industry': 'industry', - 'sector': 'sector', - 'marketcap': 'marketcap', - 'employees': 'employees', - 'phone': 'phone', - 'ceo': 'ceo', - 'url': 'url', - 'description': 'description', - 'similar': 'similar', - 'tags': 'tags', - 'updated': 'updated' - } - - def __init__(self, logo=None, exchange=None, name=None, symbol=None, listdate=None, cik=None, bloomberg=None, figi=None, lei=None, sic=None, country=None, industry=None, sector=None, marketcap=None, employees=None, phone=None, ceo=None, url=None, description=None, similar=None, tags=None, updated=None): # noqa: E501 - """Company - a model defined in Swagger""" # noqa: E501 - self._logo = None - self._exchange = None - self._name = None - self._symbol = None - self._listdate = None - self._cik = None - self._bloomberg = None - self._figi = None - self._lei = None - self._sic = None - self._country = None - self._industry = None - self._sector = None - self._marketcap = None - self._employees = None - self._phone = None - self._ceo = None - self._url = None - self._description = None - self._similar = None - self._tags = None - self._updated = None - self.discriminator = None - if logo is not None: - self.logo = logo - self.exchange = exchange - self.name = name - self.symbol = symbol - if listdate is not None: - self.listdate = listdate - if cik is not None: - self.cik = cik - if bloomberg is not None: - self.bloomberg = bloomberg - if figi is not None: - self.figi = figi - if lei is not None: - self.lei = lei - if sic is not None: - self.sic = sic - if country is not None: - self.country = country - if industry is not None: - self.industry = industry - if sector is not None: - self.sector = sector - if marketcap is not None: - self.marketcap = marketcap - if employees is not None: - self.employees = employees - if phone is not None: - self.phone = phone - if ceo is not None: - self.ceo = ceo - if url is not None: - self.url = url - self.description = description - if similar is not None: - self.similar = similar - if tags is not None: - self.tags = tags - self.updated = updated - - @property - def logo(self): - """Gets the logo of this Company. # noqa: E501 - - URL of the entities logo. # noqa: E501 - - :return: The logo of this Company. # noqa: E501 - :rtype: str - """ - return self._logo - - @logo.setter - def logo(self, logo): - """Sets the logo of this Company. - - URL of the entities logo. # noqa: E501 - - :param logo: The logo of this Company. # noqa: E501 - :type: str - """ - - self._logo = logo - - @property - def exchange(self): - """Gets the exchange of this Company. # noqa: E501 - - Symbols primary exchange # noqa: E501 - - :return: The exchange of this Company. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this Company. - - Symbols primary exchange # noqa: E501 - - :param exchange: The exchange of this Company. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def name(self): - """Gets the name of this Company. # noqa: E501 - - Name of the company/entity # noqa: E501 - - :return: The name of this Company. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Company. - - Name of the company/entity # noqa: E501 - - :param name: The name of this Company. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def symbol(self): - """Gets the symbol of this Company. # noqa: E501 - - - :return: The symbol of this Company. # noqa: E501 - :rtype: StockSymbol - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this Company. - - - :param symbol: The symbol of this Company. # noqa: E501 - :type: StockSymbol - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def listdate(self): - """Gets the listdate of this Company. # noqa: E501 - - Date this symbol was listed on the exchange. # noqa: E501 - - :return: The listdate of this Company. # noqa: E501 - :rtype: date - """ - return self._listdate - - @listdate.setter - def listdate(self, listdate): - """Sets the listdate of this Company. - - Date this symbol was listed on the exchange. # noqa: E501 - - :param listdate: The listdate of this Company. # noqa: E501 - :type: date - """ - - self._listdate = listdate - - @property - def cik(self): - """Gets the cik of this Company. # noqa: E501 - - Official CIK guid used for SEC database / filings. # noqa: E501 - - :return: The cik of this Company. # noqa: E501 - :rtype: str - """ - return self._cik - - @cik.setter - def cik(self, cik): - """Sets the cik of this Company. - - Official CIK guid used for SEC database / filings. # noqa: E501 - - :param cik: The cik of this Company. # noqa: E501 - :type: str - """ - - self._cik = cik - - @property - def bloomberg(self): - """Gets the bloomberg of this Company. # noqa: E501 - - Bloomberg guid for this symbol # noqa: E501 - - :return: The bloomberg of this Company. # noqa: E501 - :rtype: str - """ - return self._bloomberg - - @bloomberg.setter - def bloomberg(self, bloomberg): - """Sets the bloomberg of this Company. - - Bloomberg guid for this symbol # noqa: E501 - - :param bloomberg: The bloomberg of this Company. # noqa: E501 - :type: str - """ - - self._bloomberg = bloomberg - - @property - def figi(self): - """Gets the figi of this Company. # noqa: E501 - - guid for the OpenFigi project ( https://openfigi.com/ ) # noqa: E501 - - :return: The figi of this Company. # noqa: E501 - :rtype: str - """ - return self._figi - - @figi.setter - def figi(self, figi): - """Sets the figi of this Company. - - guid for the OpenFigi project ( https://openfigi.com/ ) # noqa: E501 - - :param figi: The figi of this Company. # noqa: E501 - :type: str - """ - - self._figi = figi - - @property - def lei(self): - """Gets the lei of this Company. # noqa: E501 - - Legal Entity Identifier (LEI) guid for symbol ( https://en.wikipedia.org/wiki/Legal_Entity_Identifier ) # noqa: E501 - - :return: The lei of this Company. # noqa: E501 - :rtype: str - """ - return self._lei - - @lei.setter - def lei(self, lei): - """Sets the lei of this Company. - - Legal Entity Identifier (LEI) guid for symbol ( https://en.wikipedia.org/wiki/Legal_Entity_Identifier ) # noqa: E501 - - :param lei: The lei of this Company. # noqa: E501 - :type: str - """ - - self._lei = lei - - @property - def sic(self): - """Gets the sic of this Company. # noqa: E501 - - Standard Industrial Classification (SIC) id for symbol ( https://en.wikipedia.org/wiki/Standard_Industrial_Classification ) # noqa: E501 - - :return: The sic of this Company. # noqa: E501 - :rtype: float - """ - return self._sic - - @sic.setter - def sic(self, sic): - """Sets the sic of this Company. - - Standard Industrial Classification (SIC) id for symbol ( https://en.wikipedia.org/wiki/Standard_Industrial_Classification ) # noqa: E501 - - :param sic: The sic of this Company. # noqa: E501 - :type: float - """ - - self._sic = sic - - @property - def country(self): - """Gets the country of this Company. # noqa: E501 - - Country in which this company is registered # noqa: E501 - - :return: The country of this Company. # noqa: E501 - :rtype: str - """ - return self._country - - @country.setter - def country(self, country): - """Sets the country of this Company. - - Country in which this company is registered # noqa: E501 - - :param country: The country of this Company. # noqa: E501 - :type: str - """ - - self._country = country - - @property - def industry(self): - """Gets the industry of this Company. # noqa: E501 - - Industry this company operates in # noqa: E501 - - :return: The industry of this Company. # noqa: E501 - :rtype: str - """ - return self._industry - - @industry.setter - def industry(self, industry): - """Sets the industry of this Company. - - Industry this company operates in # noqa: E501 - - :param industry: The industry of this Company. # noqa: E501 - :type: str - """ - - self._industry = industry - - @property - def sector(self): - """Gets the sector of this Company. # noqa: E501 - - Sector of the indsutry in which this symbol operates in # noqa: E501 - - :return: The sector of this Company. # noqa: E501 - :rtype: str - """ - return self._sector - - @sector.setter - def sector(self, sector): - """Sets the sector of this Company. - - Sector of the indsutry in which this symbol operates in # noqa: E501 - - :param sector: The sector of this Company. # noqa: E501 - :type: str - """ - - self._sector = sector - - @property - def marketcap(self): - """Gets the marketcap of this Company. # noqa: E501 - - Current market cap for this company # noqa: E501 - - :return: The marketcap of this Company. # noqa: E501 - :rtype: float - """ - return self._marketcap - - @marketcap.setter - def marketcap(self, marketcap): - """Sets the marketcap of this Company. - - Current market cap for this company # noqa: E501 - - :param marketcap: The marketcap of this Company. # noqa: E501 - :type: float - """ - - self._marketcap = marketcap - - @property - def employees(self): - """Gets the employees of this Company. # noqa: E501 - - Approximate number of employees # noqa: E501 - - :return: The employees of this Company. # noqa: E501 - :rtype: float - """ - return self._employees - - @employees.setter - def employees(self, employees): - """Sets the employees of this Company. - - Approximate number of employees # noqa: E501 - - :param employees: The employees of this Company. # noqa: E501 - :type: float - """ - - self._employees = employees - - @property - def phone(self): - """Gets the phone of this Company. # noqa: E501 - - Phone number for this company. Usually corporate contact number. # noqa: E501 - - :return: The phone of this Company. # noqa: E501 - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this Company. - - Phone number for this company. Usually corporate contact number. # noqa: E501 - - :param phone: The phone of this Company. # noqa: E501 - :type: str - """ - - self._phone = phone - - @property - def ceo(self): - """Gets the ceo of this Company. # noqa: E501 - - Name of the companies current CEO # noqa: E501 - - :return: The ceo of this Company. # noqa: E501 - :rtype: str - """ - return self._ceo - - @ceo.setter - def ceo(self, ceo): - """Sets the ceo of this Company. - - Name of the companies current CEO # noqa: E501 - - :param ceo: The ceo of this Company. # noqa: E501 - :type: str - """ - - self._ceo = ceo - - @property - def url(self): - """Gets the url of this Company. # noqa: E501 - - URL of the companies website # noqa: E501 - - :return: The url of this Company. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this Company. - - URL of the companies website # noqa: E501 - - :param url: The url of this Company. # noqa: E501 - :type: str - """ - - self._url = url - - @property - def description(self): - """Gets the description of this Company. # noqa: E501 - - A description of the company and what they do/offer # noqa: E501 - - :return: The description of this Company. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Company. - - A description of the company and what they do/offer # noqa: E501 - - :param description: The description of this Company. # noqa: E501 - :type: str - """ - if description is None: - raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 - - self._description = description - - @property - def similar(self): - """Gets the similar of this Company. # noqa: E501 - - - :return: The similar of this Company. # noqa: E501 - :rtype: list[StockSymbol] - """ - return self._similar - - @similar.setter - def similar(self, similar): - """Sets the similar of this Company. - - - :param similar: The similar of this Company. # noqa: E501 - :type: list[StockSymbol] - """ - - self._similar = similar - - @property - def tags(self): - """Gets the tags of this Company. # noqa: E501 - - - :return: The tags of this Company. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Company. - - - :param tags: The tags of this Company. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def updated(self): - """Gets the updated of this Company. # noqa: E501 - - Last time this company record was updated. # noqa: E501 - - :return: The updated of this Company. # noqa: E501 - :rtype: datetime - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this Company. - - Last time this company record was updated. # noqa: E501 - - :param updated: The updated of this Company. # noqa: E501 - :type: datetime - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Company, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Company): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/condition_type_map.py b/polygon/rest/models/condition_type_map.py deleted file mode 100644 index 52a0a86c..00000000 --- a/polygon/rest/models/condition_type_map.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class ConditionTypeMap(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """ConditionTypeMap - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ConditionTypeMap, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ConditionTypeMap): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/conflict.py b/polygon/rest/models/conflict.py deleted file mode 100644 index 2b2a1c96..00000000 --- a/polygon/rest/models/conflict.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Conflict(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str' - } - - attribute_map = { - 'message': 'message' - } - - def __init__(self, message=None): # noqa: E501 - """Conflict - a model defined in Swagger""" # noqa: E501 - self._message = None - self.discriminator = None - if message is not None: - self.message = message - - @property - def message(self): - """Gets the message of this Conflict. # noqa: E501 - - - :return: The message of this Conflict. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this Conflict. - - - :param message: The message of this Conflict. # noqa: E501 - :type: str - """ - - self._message = message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Conflict, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Conflict): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_exchange.py b/polygon/rest/models/crypto_exchange.py deleted file mode 100644 index 0e600db3..00000000 --- a/polygon/rest/models/crypto_exchange.py +++ /dev/null @@ -1,242 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoExchange(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'float', - 'type': 'str', - 'market': 'str', - 'name': 'str', - 'url': 'str' - } - - attribute_map = { - 'id': 'id', - 'type': 'type', - 'market': 'market', - 'name': 'name', - 'url': 'url' - } - - def __init__(self, id=None, type=None, market=None, name=None, url=None): # noqa: E501 - """CryptoExchange - a model defined in Swagger""" # noqa: E501 - self._id = None - self._type = None - self._market = None - self._name = None - self._url = None - self.discriminator = None - self.id = id - self.type = type - self.market = market - self.name = name - self.url = url - - @property - def id(self): - """Gets the id of this CryptoExchange. # noqa: E501 - - ID of the exchange # noqa: E501 - - :return: The id of this CryptoExchange. # noqa: E501 - :rtype: float - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CryptoExchange. - - ID of the exchange # noqa: E501 - - :param id: The id of this CryptoExchange. # noqa: E501 - :type: float - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def type(self): - """Gets the type of this CryptoExchange. # noqa: E501 - - Type of exchange feed # noqa: E501 - - :return: The type of this CryptoExchange. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this CryptoExchange. - - Type of exchange feed # noqa: E501 - - :param type: The type of this CryptoExchange. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["exchange"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def market(self): - """Gets the market of this CryptoExchange. # noqa: E501 - - Market data type this exchange contains ( crypto only currently ) # noqa: E501 - - :return: The market of this CryptoExchange. # noqa: E501 - :rtype: str - """ - return self._market - - @market.setter - def market(self, market): - """Sets the market of this CryptoExchange. - - Market data type this exchange contains ( crypto only currently ) # noqa: E501 - - :param market: The market of this CryptoExchange. # noqa: E501 - :type: str - """ - if market is None: - raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 - allowed_values = ["crypto"] # noqa: E501 - if market not in allowed_values: - raise ValueError( - "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 - .format(market, allowed_values) - ) - - self._market = market - - @property - def name(self): - """Gets the name of this CryptoExchange. # noqa: E501 - - Name of the exchange # noqa: E501 - - :return: The name of this CryptoExchange. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CryptoExchange. - - Name of the exchange # noqa: E501 - - :param name: The name of this CryptoExchange. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def url(self): - """Gets the url of this CryptoExchange. # noqa: E501 - - URL of this exchange # noqa: E501 - - :return: The url of this CryptoExchange. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this CryptoExchange. - - URL of this exchange # noqa: E501 - - :param url: The url of this CryptoExchange. # noqa: E501 - :type: str - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoExchange, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoExchange): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_snapshot_agg.py b/polygon/rest/models/crypto_snapshot_agg.py deleted file mode 100644 index b3dd669d..00000000 --- a/polygon/rest/models/crypto_snapshot_agg.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoSnapshotAgg(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'c': 'int', - 'h': 'int', - 'l': 'int', - 'o': 'int', - 'v': 'int' - } - - attribute_map = { - 'c': 'c', - 'h': 'h', - 'l': 'l', - 'o': 'o', - 'v': 'v' - } - - def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 - """CryptoSnapshotAgg - a model defined in Swagger""" # noqa: E501 - self._c = None - self._h = None - self._l = None - self._o = None - self._v = None - self.discriminator = None - self.c = c - self.h = h - self.l = l - self.o = o - self.v = v - - @property - def c(self): - """Gets the c of this CryptoSnapshotAgg. # noqa: E501 - - Close price # noqa: E501 - - :return: The c of this CryptoSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this CryptoSnapshotAgg. - - Close price # noqa: E501 - - :param c: The c of this CryptoSnapshotAgg. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def h(self): - """Gets the h of this CryptoSnapshotAgg. # noqa: E501 - - High price # noqa: E501 - - :return: The h of this CryptoSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this CryptoSnapshotAgg. - - High price # noqa: E501 - - :param h: The h of this CryptoSnapshotAgg. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def l(self): - """Gets the l of this CryptoSnapshotAgg. # noqa: E501 - - Low price # noqa: E501 - - :return: The l of this CryptoSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this CryptoSnapshotAgg. - - Low price # noqa: E501 - - :param l: The l of this CryptoSnapshotAgg. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def o(self): - """Gets the o of this CryptoSnapshotAgg. # noqa: E501 - - Open price # noqa: E501 - - :return: The o of this CryptoSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this CryptoSnapshotAgg. - - Open price # noqa: E501 - - :param o: The o of this CryptoSnapshotAgg. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def v(self): - """Gets the v of this CryptoSnapshotAgg. # noqa: E501 - - Volume # noqa: E501 - - :return: The v of this CryptoSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this CryptoSnapshotAgg. - - Volume # noqa: E501 - - :param v: The v of this CryptoSnapshotAgg. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoSnapshotAgg, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoSnapshotAgg): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_snapshot_book_item.py b/polygon/rest/models/crypto_snapshot_book_item.py deleted file mode 100644 index 10820430..00000000 --- a/polygon/rest/models/crypto_snapshot_book_item.py +++ /dev/null @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoSnapshotBookItem(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'p': 'int', - 'x': 'object' - } - - attribute_map = { - 'p': 'p', - 'x': 'x' - } - - def __init__(self, p=None, x=None): # noqa: E501 - """CryptoSnapshotBookItem - a model defined in Swagger""" # noqa: E501 - self._p = None - self._x = None - self.discriminator = None - self.p = p - self.x = x - - @property - def p(self): - """Gets the p of this CryptoSnapshotBookItem. # noqa: E501 - - Price of this book level # noqa: E501 - - :return: The p of this CryptoSnapshotBookItem. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this CryptoSnapshotBookItem. - - Price of this book level # noqa: E501 - - :param p: The p of this CryptoSnapshotBookItem. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def x(self): - """Gets the x of this CryptoSnapshotBookItem. # noqa: E501 - - Exchange to Size of this price level # noqa: E501 - - :return: The x of this CryptoSnapshotBookItem. # noqa: E501 - :rtype: object - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this CryptoSnapshotBookItem. - - Exchange to Size of this price level # noqa: E501 - - :param x: The x of this CryptoSnapshotBookItem. # noqa: E501 - :type: object - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoSnapshotBookItem, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoSnapshotBookItem): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_snapshot_ticker.py b/polygon/rest/models/crypto_snapshot_ticker.py deleted file mode 100644 index 44a4f982..00000000 --- a/polygon/rest/models/crypto_snapshot_ticker.py +++ /dev/null @@ -1,309 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoSnapshotTicker(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'day': 'CryptoSnapshotAgg', - 'last_trade': 'CryptoTickJson', - 'min': 'CryptoSnapshotAgg', - 'prev_day': 'CryptoSnapshotAgg', - 'todays_change': 'int', - 'todays_change_perc': 'int', - 'updated': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'day': 'day', - 'last_trade': 'lastTrade', - 'min': 'min', - 'prev_day': 'prevDay', - 'todays_change': 'todaysChange', - 'todays_change_perc': 'todaysChangePerc', - 'updated': 'updated' - } - - def __init__(self, ticker=None, day=None, last_trade=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 - """CryptoSnapshotTicker - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._day = None - self._last_trade = None - self._min = None - self._prev_day = None - self._todays_change = None - self._todays_change_perc = None - self._updated = None - self.discriminator = None - self.ticker = ticker - self.day = day - self.last_trade = last_trade - self.min = min - self.prev_day = prev_day - self.todays_change = todays_change - self.todays_change_perc = todays_change_perc - self.updated = updated - - @property - def ticker(self): - """Gets the ticker of this CryptoSnapshotTicker. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The ticker of this CryptoSnapshotTicker. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this CryptoSnapshotTicker. - - Ticker of the object # noqa: E501 - - :param ticker: The ticker of this CryptoSnapshotTicker. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def day(self): - """Gets the day of this CryptoSnapshotTicker. # noqa: E501 - - - :return: The day of this CryptoSnapshotTicker. # noqa: E501 - :rtype: CryptoSnapshotAgg - """ - return self._day - - @day.setter - def day(self, day): - """Sets the day of this CryptoSnapshotTicker. - - - :param day: The day of this CryptoSnapshotTicker. # noqa: E501 - :type: CryptoSnapshotAgg - """ - if day is None: - raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 - - self._day = day - - @property - def last_trade(self): - """Gets the last_trade of this CryptoSnapshotTicker. # noqa: E501 - - - :return: The last_trade of this CryptoSnapshotTicker. # noqa: E501 - :rtype: CryptoTickJson - """ - return self._last_trade - - @last_trade.setter - def last_trade(self, last_trade): - """Sets the last_trade of this CryptoSnapshotTicker. - - - :param last_trade: The last_trade of this CryptoSnapshotTicker. # noqa: E501 - :type: CryptoTickJson - """ - if last_trade is None: - raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 - - self._last_trade = last_trade - - @property - def min(self): - """Gets the min of this CryptoSnapshotTicker. # noqa: E501 - - - :return: The min of this CryptoSnapshotTicker. # noqa: E501 - :rtype: CryptoSnapshotAgg - """ - return self._min - - @min.setter - def min(self, min): - """Sets the min of this CryptoSnapshotTicker. - - - :param min: The min of this CryptoSnapshotTicker. # noqa: E501 - :type: CryptoSnapshotAgg - """ - if min is None: - raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 - - self._min = min - - @property - def prev_day(self): - """Gets the prev_day of this CryptoSnapshotTicker. # noqa: E501 - - - :return: The prev_day of this CryptoSnapshotTicker. # noqa: E501 - :rtype: CryptoSnapshotAgg - """ - return self._prev_day - - @prev_day.setter - def prev_day(self, prev_day): - """Sets the prev_day of this CryptoSnapshotTicker. - - - :param prev_day: The prev_day of this CryptoSnapshotTicker. # noqa: E501 - :type: CryptoSnapshotAgg - """ - if prev_day is None: - raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 - - self._prev_day = prev_day - - @property - def todays_change(self): - """Gets the todays_change of this CryptoSnapshotTicker. # noqa: E501 - - Value of the change from previous day # noqa: E501 - - :return: The todays_change of this CryptoSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change - - @todays_change.setter - def todays_change(self, todays_change): - """Sets the todays_change of this CryptoSnapshotTicker. - - Value of the change from previous day # noqa: E501 - - :param todays_change: The todays_change of this CryptoSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change is None: - raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 - - self._todays_change = todays_change - - @property - def todays_change_perc(self): - """Gets the todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 - - Percentage change since previous day # noqa: E501 - - :return: The todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change_perc - - @todays_change_perc.setter - def todays_change_perc(self, todays_change_perc): - """Sets the todays_change_perc of this CryptoSnapshotTicker. - - Percentage change since previous day # noqa: E501 - - :param todays_change_perc: The todays_change_perc of this CryptoSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change_perc is None: - raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 - - self._todays_change_perc = todays_change_perc - - @property - def updated(self): - """Gets the updated of this CryptoSnapshotTicker. # noqa: E501 - - Last Updated timestamp # noqa: E501 - - :return: The updated of this CryptoSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this CryptoSnapshotTicker. - - Last Updated timestamp # noqa: E501 - - :param updated: The updated of this CryptoSnapshotTicker. # noqa: E501 - :type: int - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoSnapshotTicker, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoSnapshotTicker): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_snapshot_ticker_book.py b/polygon/rest/models/crypto_snapshot_ticker_book.py deleted file mode 100644 index 73327541..00000000 --- a/polygon/rest/models/crypto_snapshot_ticker_book.py +++ /dev/null @@ -1,283 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoSnapshotTickerBook(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'bids': 'list[CryptoSnapshotBookItem]', - 'asks': 'list[CryptoSnapshotBookItem]', - 'bid_count': 'int', - 'ask_count': 'int', - 'spread': 'int', - 'updated': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'bids': 'bids', - 'asks': 'asks', - 'bid_count': 'bidCount', - 'ask_count': 'askCount', - 'spread': 'spread', - 'updated': 'updated' - } - - def __init__(self, ticker=None, bids=None, asks=None, bid_count=None, ask_count=None, spread=None, updated=None): # noqa: E501 - """CryptoSnapshotTickerBook - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._bids = None - self._asks = None - self._bid_count = None - self._ask_count = None - self._spread = None - self._updated = None - self.discriminator = None - self.ticker = ticker - if bids is not None: - self.bids = bids - if asks is not None: - self.asks = asks - if bid_count is not None: - self.bid_count = bid_count - if ask_count is not None: - self.ask_count = ask_count - if spread is not None: - self.spread = spread - self.updated = updated - - @property - def ticker(self): - """Gets the ticker of this CryptoSnapshotTickerBook. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The ticker of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this CryptoSnapshotTickerBook. - - Ticker of the object # noqa: E501 - - :param ticker: The ticker of this CryptoSnapshotTickerBook. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def bids(self): - """Gets the bids of this CryptoSnapshotTickerBook. # noqa: E501 - - Bids # noqa: E501 - - :return: The bids of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: list[CryptoSnapshotBookItem] - """ - return self._bids - - @bids.setter - def bids(self, bids): - """Sets the bids of this CryptoSnapshotTickerBook. - - Bids # noqa: E501 - - :param bids: The bids of this CryptoSnapshotTickerBook. # noqa: E501 - :type: list[CryptoSnapshotBookItem] - """ - - self._bids = bids - - @property - def asks(self): - """Gets the asks of this CryptoSnapshotTickerBook. # noqa: E501 - - Asks # noqa: E501 - - :return: The asks of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: list[CryptoSnapshotBookItem] - """ - return self._asks - - @asks.setter - def asks(self, asks): - """Sets the asks of this CryptoSnapshotTickerBook. - - Asks # noqa: E501 - - :param asks: The asks of this CryptoSnapshotTickerBook. # noqa: E501 - :type: list[CryptoSnapshotBookItem] - """ - - self._asks = asks - - @property - def bid_count(self): - """Gets the bid_count of this CryptoSnapshotTickerBook. # noqa: E501 - - Combined total number of bids in the book # noqa: E501 - - :return: The bid_count of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._bid_count - - @bid_count.setter - def bid_count(self, bid_count): - """Sets the bid_count of this CryptoSnapshotTickerBook. - - Combined total number of bids in the book # noqa: E501 - - :param bid_count: The bid_count of this CryptoSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._bid_count = bid_count - - @property - def ask_count(self): - """Gets the ask_count of this CryptoSnapshotTickerBook. # noqa: E501 - - Combined total number of asks in the book # noqa: E501 - - :return: The ask_count of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._ask_count - - @ask_count.setter - def ask_count(self, ask_count): - """Sets the ask_count of this CryptoSnapshotTickerBook. - - Combined total number of asks in the book # noqa: E501 - - :param ask_count: The ask_count of this CryptoSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._ask_count = ask_count - - @property - def spread(self): - """Gets the spread of this CryptoSnapshotTickerBook. # noqa: E501 - - Difference between the best bid and the best ask price accross exchanges # noqa: E501 - - :return: The spread of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._spread - - @spread.setter - def spread(self, spread): - """Sets the spread of this CryptoSnapshotTickerBook. - - Difference between the best bid and the best ask price accross exchanges # noqa: E501 - - :param spread: The spread of this CryptoSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._spread = spread - - @property - def updated(self): - """Gets the updated of this CryptoSnapshotTickerBook. # noqa: E501 - - Last Updated timestamp # noqa: E501 - - :return: The updated of this CryptoSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this CryptoSnapshotTickerBook. - - Last Updated timestamp # noqa: E501 - - :param updated: The updated of this CryptoSnapshotTickerBook. # noqa: E501 - :type: int - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoSnapshotTickerBook, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoSnapshotTickerBook): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_tick.py b/polygon/rest/models/crypto_tick.py deleted file mode 100644 index a08982dc..00000000 --- a/polygon/rest/models/crypto_tick.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoTick(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'price': 'int', - 'size': 'int', - 'exchange': 'int', - 'conditions': 'list[int]', - 'timestamp': 'int' - } - - attribute_map = { - 'price': 'price', - 'size': 'size', - 'exchange': 'exchange', - 'conditions': 'conditions', - 'timestamp': 'timestamp' - } - - def __init__(self, price=None, size=None, exchange=None, conditions=None, timestamp=None): # noqa: E501 - """CryptoTick - a model defined in Swagger""" # noqa: E501 - self._price = None - self._size = None - self._exchange = None - self._conditions = None - self._timestamp = None - self.discriminator = None - self.price = price - self.size = size - self.exchange = exchange - self.conditions = conditions - self.timestamp = timestamp - - @property - def price(self): - """Gets the price of this CryptoTick. # noqa: E501 - - Trade Price # noqa: E501 - - :return: The price of this CryptoTick. # noqa: E501 - :rtype: int - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this CryptoTick. - - Trade Price # noqa: E501 - - :param price: The price of this CryptoTick. # noqa: E501 - :type: int - """ - if price is None: - raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 - - self._price = price - - @property - def size(self): - """Gets the size of this CryptoTick. # noqa: E501 - - Size of the trade # noqa: E501 - - :return: The size of this CryptoTick. # noqa: E501 - :rtype: int - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this CryptoTick. - - Size of the trade # noqa: E501 - - :param size: The size of this CryptoTick. # noqa: E501 - :type: int - """ - if size is None: - raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 - - self._size = size - - @property - def exchange(self): - """Gets the exchange of this CryptoTick. # noqa: E501 - - Exchange the trade occured on # noqa: E501 - - :return: The exchange of this CryptoTick. # noqa: E501 - :rtype: int - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this CryptoTick. - - Exchange the trade occured on # noqa: E501 - - :param exchange: The exchange of this CryptoTick. # noqa: E501 - :type: int - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def conditions(self): - """Gets the conditions of this CryptoTick. # noqa: E501 - - Conditions of this trade # noqa: E501 - - :return: The conditions of this CryptoTick. # noqa: E501 - :rtype: list[int] - """ - return self._conditions - - @conditions.setter - def conditions(self, conditions): - """Sets the conditions of this CryptoTick. - - Conditions of this trade # noqa: E501 - - :param conditions: The conditions of this CryptoTick. # noqa: E501 - :type: list[int] - """ - if conditions is None: - raise ValueError("Invalid value for `conditions`, must not be `None`") # noqa: E501 - - self._conditions = conditions - - @property - def timestamp(self): - """Gets the timestamp of this CryptoTick. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this CryptoTick. # noqa: E501 - :rtype: int - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this CryptoTick. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this CryptoTick. # noqa: E501 - :type: int - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoTick, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoTick): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/crypto_tick_json.py b/polygon/rest/models/crypto_tick_json.py deleted file mode 100644 index 7988cbb1..00000000 --- a/polygon/rest/models/crypto_tick_json.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class CryptoTickJson(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'p': 'int', - 's': 'int', - 'x': 'int', - 'c': 'list[int]', - 't': 'int' - } - - attribute_map = { - 'p': 'p', - 's': 's', - 'x': 'x', - 'c': 'c', - 't': 't' - } - - def __init__(self, p=None, s=None, x=None, c=None, t=None): # noqa: E501 - """CryptoTickJson - a model defined in Swagger""" # noqa: E501 - self._p = None - self._s = None - self._x = None - self._c = None - self._t = None - self.discriminator = None - self.p = p - self.s = s - self.x = x - self.c = c - self.t = t - - @property - def p(self): - """Gets the p of this CryptoTickJson. # noqa: E501 - - Trade Price # noqa: E501 - - :return: The p of this CryptoTickJson. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this CryptoTickJson. - - Trade Price # noqa: E501 - - :param p: The p of this CryptoTickJson. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def s(self): - """Gets the s of this CryptoTickJson. # noqa: E501 - - Size of the trade # noqa: E501 - - :return: The s of this CryptoTickJson. # noqa: E501 - :rtype: int - """ - return self._s - - @s.setter - def s(self, s): - """Sets the s of this CryptoTickJson. - - Size of the trade # noqa: E501 - - :param s: The s of this CryptoTickJson. # noqa: E501 - :type: int - """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 - - self._s = s - - @property - def x(self): - """Gets the x of this CryptoTickJson. # noqa: E501 - - Exchange the trade occured on # noqa: E501 - - :return: The x of this CryptoTickJson. # noqa: E501 - :rtype: int - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this CryptoTickJson. - - Exchange the trade occured on # noqa: E501 - - :param x: The x of this CryptoTickJson. # noqa: E501 - :type: int - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - @property - def c(self): - """Gets the c of this CryptoTickJson. # noqa: E501 - - Conditions of this trade # noqa: E501 - - :return: The c of this CryptoTickJson. # noqa: E501 - :rtype: list[int] - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this CryptoTickJson. - - Conditions of this trade # noqa: E501 - - :param c: The c of this CryptoTickJson. # noqa: E501 - :type: list[int] - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def t(self): - """Gets the t of this CryptoTickJson. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The t of this CryptoTickJson. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this CryptoTickJson. - - Timestamp of this trade # noqa: E501 - - :param t: The t of this CryptoTickJson. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(CryptoTickJson, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CryptoTickJson): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/dividend.py b/polygon/rest/models/dividend.py deleted file mode 100644 index 335d3e17..00000000 --- a/polygon/rest/models/dividend.py +++ /dev/null @@ -1,345 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Dividend(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbol': 'StockSymbol', - 'type': 'str', - 'ex_date': 'datetime', - 'payment_date': 'datetime', - 'record_date': 'datetime', - 'declared_date': 'datetime', - 'amount': 'float', - 'qualified': 'str', - 'flag': 'str' - } - - attribute_map = { - 'symbol': 'symbol', - 'type': 'type', - 'ex_date': 'exDate', - 'payment_date': 'paymentDate', - 'record_date': 'recordDate', - 'declared_date': 'declaredDate', - 'amount': 'amount', - 'qualified': 'qualified', - 'flag': 'flag' - } - - def __init__(self, symbol=None, type=None, ex_date=None, payment_date=None, record_date=None, declared_date=None, amount=None, qualified=None, flag=None): # noqa: E501 - """Dividend - a model defined in Swagger""" # noqa: E501 - self._symbol = None - self._type = None - self._ex_date = None - self._payment_date = None - self._record_date = None - self._declared_date = None - self._amount = None - self._qualified = None - self._flag = None - self.discriminator = None - self.symbol = symbol - self.type = type - self.ex_date = ex_date - if payment_date is not None: - self.payment_date = payment_date - if record_date is not None: - self.record_date = record_date - if declared_date is not None: - self.declared_date = declared_date - self.amount = amount - if qualified is not None: - self.qualified = qualified - if flag is not None: - self.flag = flag - - @property - def symbol(self): - """Gets the symbol of this Dividend. # noqa: E501 - - - :return: The symbol of this Dividend. # noqa: E501 - :rtype: StockSymbol - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this Dividend. - - - :param symbol: The symbol of this Dividend. # noqa: E501 - :type: StockSymbol - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def type(self): - """Gets the type of this Dividend. # noqa: E501 - - Refers to the dividend payment type
- Dividend income
- Interest income
- Stock dividend
- Short term capital gain
- Medium term capital gain
- Long term capital gain
- Unspecified term capital gain
# noqa: E501 - - :return: The type of this Dividend. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Dividend. - - Refers to the dividend payment type
- Dividend income
- Interest income
- Stock dividend
- Short term capital gain
- Medium term capital gain
- Long term capital gain
- Unspecified term capital gain
# noqa: E501 - - :param type: The type of this Dividend. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - - self._type = type - - @property - def ex_date(self): - """Gets the ex_date of this Dividend. # noqa: E501 - - Execution date of the trade # noqa: E501 - - :return: The ex_date of this Dividend. # noqa: E501 - :rtype: datetime - """ - return self._ex_date - - @ex_date.setter - def ex_date(self, ex_date): - """Sets the ex_date of this Dividend. - - Execution date of the trade # noqa: E501 - - :param ex_date: The ex_date of this Dividend. # noqa: E501 - :type: datetime - """ - if ex_date is None: - raise ValueError("Invalid value for `ex_date`, must not be `None`") # noqa: E501 - - self._ex_date = ex_date - - @property - def payment_date(self): - """Gets the payment_date of this Dividend. # noqa: E501 - - Payment date of the trade # noqa: E501 - - :return: The payment_date of this Dividend. # noqa: E501 - :rtype: datetime - """ - return self._payment_date - - @payment_date.setter - def payment_date(self, payment_date): - """Sets the payment_date of this Dividend. - - Payment date of the trade # noqa: E501 - - :param payment_date: The payment_date of this Dividend. # noqa: E501 - :type: datetime - """ - - self._payment_date = payment_date - - @property - def record_date(self): - """Gets the record_date of this Dividend. # noqa: E501 - - Record date of the trade # noqa: E501 - - :return: The record_date of this Dividend. # noqa: E501 - :rtype: datetime - """ - return self._record_date - - @record_date.setter - def record_date(self, record_date): - """Sets the record_date of this Dividend. - - Record date of the trade # noqa: E501 - - :param record_date: The record_date of this Dividend. # noqa: E501 - :type: datetime - """ - - self._record_date = record_date - - @property - def declared_date(self): - """Gets the declared_date of this Dividend. # noqa: E501 - - Declared date of the trade # noqa: E501 - - :return: The declared_date of this Dividend. # noqa: E501 - :rtype: datetime - """ - return self._declared_date - - @declared_date.setter - def declared_date(self, declared_date): - """Sets the declared_date of this Dividend. - - Declared date of the trade # noqa: E501 - - :param declared_date: The declared_date of this Dividend. # noqa: E501 - :type: datetime - """ - - self._declared_date = declared_date - - @property - def amount(self): - """Gets the amount of this Dividend. # noqa: E501 - - Amount of the dividend # noqa: E501 - - :return: The amount of this Dividend. # noqa: E501 - :rtype: float - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this Dividend. - - Amount of the dividend # noqa: E501 - - :param amount: The amount of this Dividend. # noqa: E501 - :type: float - """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - - self._amount = amount - - @property - def qualified(self): - """Gets the qualified of this Dividend. # noqa: E501 - - Refers to the dividend income type
- P = Partially qualified income
- Q = Qualified income
- N = Unqualified income
- null = N/A or unknown # noqa: E501 - - :return: The qualified of this Dividend. # noqa: E501 - :rtype: str - """ - return self._qualified - - @qualified.setter - def qualified(self, qualified): - """Sets the qualified of this Dividend. - - Refers to the dividend income type
- P = Partially qualified income
- Q = Qualified income
- N = Unqualified income
- null = N/A or unknown # noqa: E501 - - :param qualified: The qualified of this Dividend. # noqa: E501 - :type: str - """ - allowed_values = ["P", "Q", "N", "null"] # noqa: E501 - if qualified not in allowed_values: - raise ValueError( - "Invalid value for `qualified` ({0}), must be one of {1}" # noqa: E501 - .format(qualified, allowed_values) - ) - - self._qualified = qualified - - @property - def flag(self): - """Gets the flag of this Dividend. # noqa: E501 - - Refers to the dividend flag, if set
FI = Final dividend, div ends or instrument ends
LI = Liquidation, instrument liquidates
PR = Proceeds of a sale of rights or shares
RE = Redemption of rights
AC = Accrued dividend
AR = Payment in arrears
AD = Additional payment
EX = Extra payment
SP = Special dividend
YE = Year end
UR = Unknown rate
SU = Regular dividend is suspended # noqa: E501 - - :return: The flag of this Dividend. # noqa: E501 - :rtype: str - """ - return self._flag - - @flag.setter - def flag(self, flag): - """Sets the flag of this Dividend. - - Refers to the dividend flag, if set
FI = Final dividend, div ends or instrument ends
LI = Liquidation, instrument liquidates
PR = Proceeds of a sale of rights or shares
RE = Redemption of rights
AC = Accrued dividend
AR = Payment in arrears
AD = Additional payment
EX = Extra payment
SP = Special dividend
YE = Year end
UR = Unknown rate
SU = Regular dividend is suspended # noqa: E501 - - :param flag: The flag of this Dividend. # noqa: E501 - :type: str - """ - - self._flag = flag - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Dividend, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dividend): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/earning.py b/polygon/rest/models/earning.py deleted file mode 100644 index 553a6406..00000000 --- a/polygon/rest/models/earning.py +++ /dev/null @@ -1,458 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Earning(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbol': 'str', - 'eps_report_date': 'datetime', - 'eps_report_date_str': 'str', - 'fiscal_period': 'str', - 'fiscal_end_date': 'datetime', - 'actual_eps': 'float', - 'consensus_eps': 'float', - 'estimated_eps': 'float', - 'announce_time': 'str', - 'number_of_estimates': 'float', - 'eps_surprise_dollar': 'float', - 'year_ago': 'float', - 'year_ago_change_percent': 'float', - 'estimated_change_percent': 'float' - } - - attribute_map = { - 'symbol': 'symbol', - 'eps_report_date': 'EPSReportDate', - 'eps_report_date_str': 'EPSReportDateStr', - 'fiscal_period': 'fiscalPeriod', - 'fiscal_end_date': 'fiscalEndDate', - 'actual_eps': 'actualEPS', - 'consensus_eps': 'consensusEPS', - 'estimated_eps': 'estimatedEPS', - 'announce_time': 'announceTime', - 'number_of_estimates': 'numberOfEstimates', - 'eps_surprise_dollar': 'EPSSurpriseDollar', - 'year_ago': 'yearAgo', - 'year_ago_change_percent': 'yearAgoChangePercent', - 'estimated_change_percent': 'estimatedChangePercent' - } - - def __init__(self, symbol=None, eps_report_date=None, eps_report_date_str=None, fiscal_period=None, fiscal_end_date=None, actual_eps=None, consensus_eps=None, estimated_eps=None, announce_time=None, number_of_estimates=None, eps_surprise_dollar=None, year_ago=None, year_ago_change_percent=None, estimated_change_percent=None): # noqa: E501 - """Earning - a model defined in Swagger""" # noqa: E501 - self._symbol = None - self._eps_report_date = None - self._eps_report_date_str = None - self._fiscal_period = None - self._fiscal_end_date = None - self._actual_eps = None - self._consensus_eps = None - self._estimated_eps = None - self._announce_time = None - self._number_of_estimates = None - self._eps_surprise_dollar = None - self._year_ago = None - self._year_ago_change_percent = None - self._estimated_change_percent = None - self.discriminator = None - self.symbol = symbol - self.eps_report_date = eps_report_date - self.eps_report_date_str = eps_report_date_str - if fiscal_period is not None: - self.fiscal_period = fiscal_period - if fiscal_end_date is not None: - self.fiscal_end_date = fiscal_end_date - if actual_eps is not None: - self.actual_eps = actual_eps - if consensus_eps is not None: - self.consensus_eps = consensus_eps - if estimated_eps is not None: - self.estimated_eps = estimated_eps - if announce_time is not None: - self.announce_time = announce_time - if number_of_estimates is not None: - self.number_of_estimates = number_of_estimates - if eps_surprise_dollar is not None: - self.eps_surprise_dollar = eps_surprise_dollar - if year_ago is not None: - self.year_ago = year_ago - if year_ago_change_percent is not None: - self.year_ago_change_percent = year_ago_change_percent - if estimated_change_percent is not None: - self.estimated_change_percent = estimated_change_percent - - @property - def symbol(self): - """Gets the symbol of this Earning. # noqa: E501 - - Stock Symbol # noqa: E501 - - :return: The symbol of this Earning. # noqa: E501 - :rtype: str - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this Earning. - - Stock Symbol # noqa: E501 - - :param symbol: The symbol of this Earning. # noqa: E501 - :type: str - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def eps_report_date(self): - """Gets the eps_report_date of this Earning. # noqa: E501 - - Report Date # noqa: E501 - - :return: The eps_report_date of this Earning. # noqa: E501 - :rtype: datetime - """ - return self._eps_report_date - - @eps_report_date.setter - def eps_report_date(self, eps_report_date): - """Sets the eps_report_date of this Earning. - - Report Date # noqa: E501 - - :param eps_report_date: The eps_report_date of this Earning. # noqa: E501 - :type: datetime - """ - if eps_report_date is None: - raise ValueError("Invalid value for `eps_report_date`, must not be `None`") # noqa: E501 - - self._eps_report_date = eps_report_date - - @property - def eps_report_date_str(self): - """Gets the eps_report_date_str of this Earning. # noqa: E501 - - Report date as non date format # noqa: E501 - - :return: The eps_report_date_str of this Earning. # noqa: E501 - :rtype: str - """ - return self._eps_report_date_str - - @eps_report_date_str.setter - def eps_report_date_str(self, eps_report_date_str): - """Sets the eps_report_date_str of this Earning. - - Report date as non date format # noqa: E501 - - :param eps_report_date_str: The eps_report_date_str of this Earning. # noqa: E501 - :type: str - """ - if eps_report_date_str is None: - raise ValueError("Invalid value for `eps_report_date_str`, must not be `None`") # noqa: E501 - - self._eps_report_date_str = eps_report_date_str - - @property - def fiscal_period(self): - """Gets the fiscal_period of this Earning. # noqa: E501 - - - :return: The fiscal_period of this Earning. # noqa: E501 - :rtype: str - """ - return self._fiscal_period - - @fiscal_period.setter - def fiscal_period(self, fiscal_period): - """Sets the fiscal_period of this Earning. - - - :param fiscal_period: The fiscal_period of this Earning. # noqa: E501 - :type: str - """ - - self._fiscal_period = fiscal_period - - @property - def fiscal_end_date(self): - """Gets the fiscal_end_date of this Earning. # noqa: E501 - - - :return: The fiscal_end_date of this Earning. # noqa: E501 - :rtype: datetime - """ - return self._fiscal_end_date - - @fiscal_end_date.setter - def fiscal_end_date(self, fiscal_end_date): - """Sets the fiscal_end_date of this Earning. - - - :param fiscal_end_date: The fiscal_end_date of this Earning. # noqa: E501 - :type: datetime - """ - - self._fiscal_end_date = fiscal_end_date - - @property - def actual_eps(self): - """Gets the actual_eps of this Earning. # noqa: E501 - - - :return: The actual_eps of this Earning. # noqa: E501 - :rtype: float - """ - return self._actual_eps - - @actual_eps.setter - def actual_eps(self, actual_eps): - """Sets the actual_eps of this Earning. - - - :param actual_eps: The actual_eps of this Earning. # noqa: E501 - :type: float - """ - - self._actual_eps = actual_eps - - @property - def consensus_eps(self): - """Gets the consensus_eps of this Earning. # noqa: E501 - - - :return: The consensus_eps of this Earning. # noqa: E501 - :rtype: float - """ - return self._consensus_eps - - @consensus_eps.setter - def consensus_eps(self, consensus_eps): - """Sets the consensus_eps of this Earning. - - - :param consensus_eps: The consensus_eps of this Earning. # noqa: E501 - :type: float - """ - - self._consensus_eps = consensus_eps - - @property - def estimated_eps(self): - """Gets the estimated_eps of this Earning. # noqa: E501 - - - :return: The estimated_eps of this Earning. # noqa: E501 - :rtype: float - """ - return self._estimated_eps - - @estimated_eps.setter - def estimated_eps(self, estimated_eps): - """Sets the estimated_eps of this Earning. - - - :param estimated_eps: The estimated_eps of this Earning. # noqa: E501 - :type: float - """ - - self._estimated_eps = estimated_eps - - @property - def announce_time(self): - """Gets the announce_time of this Earning. # noqa: E501 - - - :return: The announce_time of this Earning. # noqa: E501 - :rtype: str - """ - return self._announce_time - - @announce_time.setter - def announce_time(self, announce_time): - """Sets the announce_time of this Earning. - - - :param announce_time: The announce_time of this Earning. # noqa: E501 - :type: str - """ - - self._announce_time = announce_time - - @property - def number_of_estimates(self): - """Gets the number_of_estimates of this Earning. # noqa: E501 - - - :return: The number_of_estimates of this Earning. # noqa: E501 - :rtype: float - """ - return self._number_of_estimates - - @number_of_estimates.setter - def number_of_estimates(self, number_of_estimates): - """Sets the number_of_estimates of this Earning. - - - :param number_of_estimates: The number_of_estimates of this Earning. # noqa: E501 - :type: float - """ - - self._number_of_estimates = number_of_estimates - - @property - def eps_surprise_dollar(self): - """Gets the eps_surprise_dollar of this Earning. # noqa: E501 - - - :return: The eps_surprise_dollar of this Earning. # noqa: E501 - :rtype: float - """ - return self._eps_surprise_dollar - - @eps_surprise_dollar.setter - def eps_surprise_dollar(self, eps_surprise_dollar): - """Sets the eps_surprise_dollar of this Earning. - - - :param eps_surprise_dollar: The eps_surprise_dollar of this Earning. # noqa: E501 - :type: float - """ - - self._eps_surprise_dollar = eps_surprise_dollar - - @property - def year_ago(self): - """Gets the year_ago of this Earning. # noqa: E501 - - - :return: The year_ago of this Earning. # noqa: E501 - :rtype: float - """ - return self._year_ago - - @year_ago.setter - def year_ago(self, year_ago): - """Sets the year_ago of this Earning. - - - :param year_ago: The year_ago of this Earning. # noqa: E501 - :type: float - """ - - self._year_ago = year_ago - - @property - def year_ago_change_percent(self): - """Gets the year_ago_change_percent of this Earning. # noqa: E501 - - - :return: The year_ago_change_percent of this Earning. # noqa: E501 - :rtype: float - """ - return self._year_ago_change_percent - - @year_ago_change_percent.setter - def year_ago_change_percent(self, year_ago_change_percent): - """Sets the year_ago_change_percent of this Earning. - - - :param year_ago_change_percent: The year_ago_change_percent of this Earning. # noqa: E501 - :type: float - """ - - self._year_ago_change_percent = year_ago_change_percent - - @property - def estimated_change_percent(self): - """Gets the estimated_change_percent of this Earning. # noqa: E501 - - - :return: The estimated_change_percent of this Earning. # noqa: E501 - :rtype: float - """ - return self._estimated_change_percent - - @estimated_change_percent.setter - def estimated_change_percent(self, estimated_change_percent): - """Sets the estimated_change_percent of this Earning. - - - :param estimated_change_percent: The estimated_change_percent of this Earning. # noqa: E501 - :type: float - """ - - self._estimated_change_percent = estimated_change_percent - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Earning, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Earning): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/error.py b/polygon/rest/models/error.py deleted file mode 100644 index 40df1c64..00000000 --- a/polygon/rest/models/error.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Error(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'code': 'int', - 'message': 'str', - 'fields': 'str' - } - - attribute_map = { - 'code': 'code', - 'message': 'message', - 'fields': 'fields' - } - - def __init__(self, code=None, message=None, fields=None): # noqa: E501 - """Error - a model defined in Swagger""" # noqa: E501 - self._code = None - self._message = None - self._fields = None - self.discriminator = None - if code is not None: - self.code = code - if message is not None: - self.message = message - if fields is not None: - self.fields = fields - - @property - def code(self): - """Gets the code of this Error. # noqa: E501 - - - :return: The code of this Error. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this Error. - - - :param code: The code of this Error. # noqa: E501 - :type: int - """ - - self._code = code - - @property - def message(self): - """Gets the message of this Error. # noqa: E501 - - - :return: The message of this Error. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this Error. - - - :param message: The message of this Error. # noqa: E501 - :type: str - """ - - self._message = message - - @property - def fields(self): - """Gets the fields of this Error. # noqa: E501 - - - :return: The fields of this Error. # noqa: E501 - :rtype: str - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this Error. - - - :param fields: The fields of this Error. # noqa: E501 - :type: str - """ - - self._fields = fields - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Error, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Error): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/exchange.py b/polygon/rest/models/exchange.py deleted file mode 100644 index fec7500d..00000000 --- a/polygon/rest/models/exchange.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Exchange(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'float', - 'type': 'str', - 'market': 'str', - 'mic': 'str', - 'name': 'str', - 'tape': 'str' - } - - attribute_map = { - 'id': 'id', - 'type': 'type', - 'market': 'market', - 'mic': 'mic', - 'name': 'name', - 'tape': 'tape' - } - - def __init__(self, id=None, type=None, market=None, mic=None, name=None, tape=None): # noqa: E501 - """Exchange - a model defined in Swagger""" # noqa: E501 - self._id = None - self._type = None - self._market = None - self._mic = None - self._name = None - self._tape = None - self.discriminator = None - self.id = id - self.type = type - self.market = market - self.mic = mic - self.name = name - self.tape = tape - - @property - def id(self): - """Gets the id of this Exchange. # noqa: E501 - - ID of the exchange # noqa: E501 - - :return: The id of this Exchange. # noqa: E501 - :rtype: float - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Exchange. - - ID of the exchange # noqa: E501 - - :param id: The id of this Exchange. # noqa: E501 - :type: float - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def type(self): - """Gets the type of this Exchange. # noqa: E501 - - The type of exchange this is.
- TRF = Trade Reporting Facility
- exchange = Reporting exchange on the tape # noqa: E501 - - :return: The type of this Exchange. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Exchange. - - The type of exchange this is.
- TRF = Trade Reporting Facility
- exchange = Reporting exchange on the tape # noqa: E501 - - :param type: The type of this Exchange. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["TRF", "exchange"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def market(self): - """Gets the market of this Exchange. # noqa: E501 - - Market data type this exchange contains # noqa: E501 - - :return: The market of this Exchange. # noqa: E501 - :rtype: str - """ - return self._market - - @market.setter - def market(self, market): - """Sets the market of this Exchange. - - Market data type this exchange contains # noqa: E501 - - :param market: The market of this Exchange. # noqa: E501 - :type: str - """ - if market is None: - raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 - allowed_values = ["equities", "indecies"] # noqa: E501 - if market not in allowed_values: - raise ValueError( - "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 - .format(market, allowed_values) - ) - - self._market = market - - @property - def mic(self): - """Gets the mic of this Exchange. # noqa: E501 - - Market Identification Code # noqa: E501 - - :return: The mic of this Exchange. # noqa: E501 - :rtype: str - """ - return self._mic - - @mic.setter - def mic(self, mic): - """Sets the mic of this Exchange. - - Market Identification Code # noqa: E501 - - :param mic: The mic of this Exchange. # noqa: E501 - :type: str - """ - if mic is None: - raise ValueError("Invalid value for `mic`, must not be `None`") # noqa: E501 - - self._mic = mic - - @property - def name(self): - """Gets the name of this Exchange. # noqa: E501 - - Name of the exchange # noqa: E501 - - :return: The name of this Exchange. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Exchange. - - Name of the exchange # noqa: E501 - - :param name: The name of this Exchange. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def tape(self): - """Gets the tape of this Exchange. # noqa: E501 - - Tape id of the exchange # noqa: E501 - - :return: The tape of this Exchange. # noqa: E501 - :rtype: str - """ - return self._tape - - @tape.setter - def tape(self, tape): - """Sets the tape of this Exchange. - - Tape id of the exchange # noqa: E501 - - :param tape: The tape of this Exchange. # noqa: E501 - :type: str - """ - if tape is None: - raise ValueError("Invalid value for `tape`, must not be `None`") # noqa: E501 - - self._tape = tape - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Exchange, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Exchange): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/financial.py b/polygon/rest/models/financial.py deleted file mode 100644 index b16279b2..00000000 --- a/polygon/rest/models/financial.py +++ /dev/null @@ -1,666 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Financial(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbol': 'str', - 'report_date': 'datetime', - 'report_date_str': 'str', - 'gross_profit': 'float', - 'cost_of_revenue': 'float', - 'operating_revenue': 'float', - 'total_revenue': 'float', - 'operating_income': 'float', - 'net_income': 'float', - 'research_and_development': 'float', - 'operating_expense': 'float', - 'current_assets': 'float', - 'total_assets': 'float', - 'total_liabilities': 'float', - 'current_cash': 'float', - 'current_debt': 'float', - 'total_cash': 'float', - 'total_debt': 'float', - 'shareholder_equity': 'float', - 'cash_change': 'float', - 'cash_flow': 'float', - 'operating_gains_losses': 'float' - } - - attribute_map = { - 'symbol': 'symbol', - 'report_date': 'reportDate', - 'report_date_str': 'reportDateStr', - 'gross_profit': 'grossProfit', - 'cost_of_revenue': 'costOfRevenue', - 'operating_revenue': 'operatingRevenue', - 'total_revenue': 'totalRevenue', - 'operating_income': 'operatingIncome', - 'net_income': 'netIncome', - 'research_and_development': 'researchAndDevelopment', - 'operating_expense': 'operatingExpense', - 'current_assets': 'currentAssets', - 'total_assets': 'totalAssets', - 'total_liabilities': 'totalLiabilities', - 'current_cash': 'currentCash', - 'current_debt': 'currentDebt', - 'total_cash': 'totalCash', - 'total_debt': 'totalDebt', - 'shareholder_equity': 'shareholderEquity', - 'cash_change': 'cashChange', - 'cash_flow': 'cashFlow', - 'operating_gains_losses': 'operatingGainsLosses' - } - - def __init__(self, symbol=None, report_date=None, report_date_str=None, gross_profit=None, cost_of_revenue=None, operating_revenue=None, total_revenue=None, operating_income=None, net_income=None, research_and_development=None, operating_expense=None, current_assets=None, total_assets=None, total_liabilities=None, current_cash=None, current_debt=None, total_cash=None, total_debt=None, shareholder_equity=None, cash_change=None, cash_flow=None, operating_gains_losses=None): # noqa: E501 - """Financial - a model defined in Swagger""" # noqa: E501 - self._symbol = None - self._report_date = None - self._report_date_str = None - self._gross_profit = None - self._cost_of_revenue = None - self._operating_revenue = None - self._total_revenue = None - self._operating_income = None - self._net_income = None - self._research_and_development = None - self._operating_expense = None - self._current_assets = None - self._total_assets = None - self._total_liabilities = None - self._current_cash = None - self._current_debt = None - self._total_cash = None - self._total_debt = None - self._shareholder_equity = None - self._cash_change = None - self._cash_flow = None - self._operating_gains_losses = None - self.discriminator = None - self.symbol = symbol - self.report_date = report_date - self.report_date_str = report_date_str - if gross_profit is not None: - self.gross_profit = gross_profit - if cost_of_revenue is not None: - self.cost_of_revenue = cost_of_revenue - if operating_revenue is not None: - self.operating_revenue = operating_revenue - if total_revenue is not None: - self.total_revenue = total_revenue - if operating_income is not None: - self.operating_income = operating_income - if net_income is not None: - self.net_income = net_income - if research_and_development is not None: - self.research_and_development = research_and_development - if operating_expense is not None: - self.operating_expense = operating_expense - if current_assets is not None: - self.current_assets = current_assets - if total_assets is not None: - self.total_assets = total_assets - if total_liabilities is not None: - self.total_liabilities = total_liabilities - if current_cash is not None: - self.current_cash = current_cash - if current_debt is not None: - self.current_debt = current_debt - if total_cash is not None: - self.total_cash = total_cash - if total_debt is not None: - self.total_debt = total_debt - if shareholder_equity is not None: - self.shareholder_equity = shareholder_equity - if cash_change is not None: - self.cash_change = cash_change - if cash_flow is not None: - self.cash_flow = cash_flow - if operating_gains_losses is not None: - self.operating_gains_losses = operating_gains_losses - - @property - def symbol(self): - """Gets the symbol of this Financial. # noqa: E501 - - Stock Symbol # noqa: E501 - - :return: The symbol of this Financial. # noqa: E501 - :rtype: str - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this Financial. - - Stock Symbol # noqa: E501 - - :param symbol: The symbol of this Financial. # noqa: E501 - :type: str - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def report_date(self): - """Gets the report_date of this Financial. # noqa: E501 - - Report Date # noqa: E501 - - :return: The report_date of this Financial. # noqa: E501 - :rtype: datetime - """ - return self._report_date - - @report_date.setter - def report_date(self, report_date): - """Sets the report_date of this Financial. - - Report Date # noqa: E501 - - :param report_date: The report_date of this Financial. # noqa: E501 - :type: datetime - """ - if report_date is None: - raise ValueError("Invalid value for `report_date`, must not be `None`") # noqa: E501 - - self._report_date = report_date - - @property - def report_date_str(self): - """Gets the report_date_str of this Financial. # noqa: E501 - - Report date as non date format # noqa: E501 - - :return: The report_date_str of this Financial. # noqa: E501 - :rtype: str - """ - return self._report_date_str - - @report_date_str.setter - def report_date_str(self, report_date_str): - """Sets the report_date_str of this Financial. - - Report date as non date format # noqa: E501 - - :param report_date_str: The report_date_str of this Financial. # noqa: E501 - :type: str - """ - if report_date_str is None: - raise ValueError("Invalid value for `report_date_str`, must not be `None`") # noqa: E501 - - self._report_date_str = report_date_str - - @property - def gross_profit(self): - """Gets the gross_profit of this Financial. # noqa: E501 - - - :return: The gross_profit of this Financial. # noqa: E501 - :rtype: float - """ - return self._gross_profit - - @gross_profit.setter - def gross_profit(self, gross_profit): - """Sets the gross_profit of this Financial. - - - :param gross_profit: The gross_profit of this Financial. # noqa: E501 - :type: float - """ - - self._gross_profit = gross_profit - - @property - def cost_of_revenue(self): - """Gets the cost_of_revenue of this Financial. # noqa: E501 - - - :return: The cost_of_revenue of this Financial. # noqa: E501 - :rtype: float - """ - return self._cost_of_revenue - - @cost_of_revenue.setter - def cost_of_revenue(self, cost_of_revenue): - """Sets the cost_of_revenue of this Financial. - - - :param cost_of_revenue: The cost_of_revenue of this Financial. # noqa: E501 - :type: float - """ - - self._cost_of_revenue = cost_of_revenue - - @property - def operating_revenue(self): - """Gets the operating_revenue of this Financial. # noqa: E501 - - - :return: The operating_revenue of this Financial. # noqa: E501 - :rtype: float - """ - return self._operating_revenue - - @operating_revenue.setter - def operating_revenue(self, operating_revenue): - """Sets the operating_revenue of this Financial. - - - :param operating_revenue: The operating_revenue of this Financial. # noqa: E501 - :type: float - """ - - self._operating_revenue = operating_revenue - - @property - def total_revenue(self): - """Gets the total_revenue of this Financial. # noqa: E501 - - - :return: The total_revenue of this Financial. # noqa: E501 - :rtype: float - """ - return self._total_revenue - - @total_revenue.setter - def total_revenue(self, total_revenue): - """Sets the total_revenue of this Financial. - - - :param total_revenue: The total_revenue of this Financial. # noqa: E501 - :type: float - """ - - self._total_revenue = total_revenue - - @property - def operating_income(self): - """Gets the operating_income of this Financial. # noqa: E501 - - - :return: The operating_income of this Financial. # noqa: E501 - :rtype: float - """ - return self._operating_income - - @operating_income.setter - def operating_income(self, operating_income): - """Sets the operating_income of this Financial. - - - :param operating_income: The operating_income of this Financial. # noqa: E501 - :type: float - """ - - self._operating_income = operating_income - - @property - def net_income(self): - """Gets the net_income of this Financial. # noqa: E501 - - - :return: The net_income of this Financial. # noqa: E501 - :rtype: float - """ - return self._net_income - - @net_income.setter - def net_income(self, net_income): - """Sets the net_income of this Financial. - - - :param net_income: The net_income of this Financial. # noqa: E501 - :type: float - """ - - self._net_income = net_income - - @property - def research_and_development(self): - """Gets the research_and_development of this Financial. # noqa: E501 - - - :return: The research_and_development of this Financial. # noqa: E501 - :rtype: float - """ - return self._research_and_development - - @research_and_development.setter - def research_and_development(self, research_and_development): - """Sets the research_and_development of this Financial. - - - :param research_and_development: The research_and_development of this Financial. # noqa: E501 - :type: float - """ - - self._research_and_development = research_and_development - - @property - def operating_expense(self): - """Gets the operating_expense of this Financial. # noqa: E501 - - - :return: The operating_expense of this Financial. # noqa: E501 - :rtype: float - """ - return self._operating_expense - - @operating_expense.setter - def operating_expense(self, operating_expense): - """Sets the operating_expense of this Financial. - - - :param operating_expense: The operating_expense of this Financial. # noqa: E501 - :type: float - """ - - self._operating_expense = operating_expense - - @property - def current_assets(self): - """Gets the current_assets of this Financial. # noqa: E501 - - - :return: The current_assets of this Financial. # noqa: E501 - :rtype: float - """ - return self._current_assets - - @current_assets.setter - def current_assets(self, current_assets): - """Sets the current_assets of this Financial. - - - :param current_assets: The current_assets of this Financial. # noqa: E501 - :type: float - """ - - self._current_assets = current_assets - - @property - def total_assets(self): - """Gets the total_assets of this Financial. # noqa: E501 - - - :return: The total_assets of this Financial. # noqa: E501 - :rtype: float - """ - return self._total_assets - - @total_assets.setter - def total_assets(self, total_assets): - """Sets the total_assets of this Financial. - - - :param total_assets: The total_assets of this Financial. # noqa: E501 - :type: float - """ - - self._total_assets = total_assets - - @property - def total_liabilities(self): - """Gets the total_liabilities of this Financial. # noqa: E501 - - - :return: The total_liabilities of this Financial. # noqa: E501 - :rtype: float - """ - return self._total_liabilities - - @total_liabilities.setter - def total_liabilities(self, total_liabilities): - """Sets the total_liabilities of this Financial. - - - :param total_liabilities: The total_liabilities of this Financial. # noqa: E501 - :type: float - """ - - self._total_liabilities = total_liabilities - - @property - def current_cash(self): - """Gets the current_cash of this Financial. # noqa: E501 - - - :return: The current_cash of this Financial. # noqa: E501 - :rtype: float - """ - return self._current_cash - - @current_cash.setter - def current_cash(self, current_cash): - """Sets the current_cash of this Financial. - - - :param current_cash: The current_cash of this Financial. # noqa: E501 - :type: float - """ - - self._current_cash = current_cash - - @property - def current_debt(self): - """Gets the current_debt of this Financial. # noqa: E501 - - - :return: The current_debt of this Financial. # noqa: E501 - :rtype: float - """ - return self._current_debt - - @current_debt.setter - def current_debt(self, current_debt): - """Sets the current_debt of this Financial. - - - :param current_debt: The current_debt of this Financial. # noqa: E501 - :type: float - """ - - self._current_debt = current_debt - - @property - def total_cash(self): - """Gets the total_cash of this Financial. # noqa: E501 - - - :return: The total_cash of this Financial. # noqa: E501 - :rtype: float - """ - return self._total_cash - - @total_cash.setter - def total_cash(self, total_cash): - """Sets the total_cash of this Financial. - - - :param total_cash: The total_cash of this Financial. # noqa: E501 - :type: float - """ - - self._total_cash = total_cash - - @property - def total_debt(self): - """Gets the total_debt of this Financial. # noqa: E501 - - - :return: The total_debt of this Financial. # noqa: E501 - :rtype: float - """ - return self._total_debt - - @total_debt.setter - def total_debt(self, total_debt): - """Sets the total_debt of this Financial. - - - :param total_debt: The total_debt of this Financial. # noqa: E501 - :type: float - """ - - self._total_debt = total_debt - - @property - def shareholder_equity(self): - """Gets the shareholder_equity of this Financial. # noqa: E501 - - - :return: The shareholder_equity of this Financial. # noqa: E501 - :rtype: float - """ - return self._shareholder_equity - - @shareholder_equity.setter - def shareholder_equity(self, shareholder_equity): - """Sets the shareholder_equity of this Financial. - - - :param shareholder_equity: The shareholder_equity of this Financial. # noqa: E501 - :type: float - """ - - self._shareholder_equity = shareholder_equity - - @property - def cash_change(self): - """Gets the cash_change of this Financial. # noqa: E501 - - - :return: The cash_change of this Financial. # noqa: E501 - :rtype: float - """ - return self._cash_change - - @cash_change.setter - def cash_change(self, cash_change): - """Sets the cash_change of this Financial. - - - :param cash_change: The cash_change of this Financial. # noqa: E501 - :type: float - """ - - self._cash_change = cash_change - - @property - def cash_flow(self): - """Gets the cash_flow of this Financial. # noqa: E501 - - - :return: The cash_flow of this Financial. # noqa: E501 - :rtype: float - """ - return self._cash_flow - - @cash_flow.setter - def cash_flow(self, cash_flow): - """Sets the cash_flow of this Financial. - - - :param cash_flow: The cash_flow of this Financial. # noqa: E501 - :type: float - """ - - self._cash_flow = cash_flow - - @property - def operating_gains_losses(self): - """Gets the operating_gains_losses of this Financial. # noqa: E501 - - - :return: The operating_gains_losses of this Financial. # noqa: E501 - :rtype: float - """ - return self._operating_gains_losses - - @operating_gains_losses.setter - def operating_gains_losses(self, operating_gains_losses): - """Sets the operating_gains_losses of this Financial. - - - :param operating_gains_losses: The operating_gains_losses of this Financial. # noqa: E501 - :type: float - """ - - self._operating_gains_losses = operating_gains_losses - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Financial, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Financial): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/financials.py b/polygon/rest/models/financials.py deleted file mode 100644 index be7c53c1..00000000 --- a/polygon/rest/models/financials.py +++ /dev/null @@ -1,2954 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Financials(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'TickerSymbol', - 'period': 'str', - 'calendar_date': 'datetime', - 'report_period': 'datetime', - 'updated': 'datetime', - 'accumulated_other_comprehensive_income': 'int', - 'assets': 'int', - 'assets_average': 'int', - 'assets_current': 'int', - 'asset_turnover': 'int', - 'assets_non_current': 'int', - 'book_value_per_share': 'int', - 'capital_expenditure': 'int', - 'cash_and_equivalents': 'int', - 'cash_and_equivalents_usd': 'int', - 'cost_of_revenue': 'int', - 'consolidated_income': 'int', - 'current_ratio': 'int', - 'debt_to_equity_ratio': 'int', - 'debt': 'int', - 'debt_current': 'int', - 'debt_non_current': 'int', - 'debt_usd': 'int', - 'deferred_revenue': 'int', - 'depreciation_amortization_and_accretion': 'int', - 'deposits': 'int', - 'dividend_yield': 'int', - 'dividends_per_basic_common_share': 'int', - 'earning_before_interest_taxes': 'int', - 'earnings_before_interest_taxes_depreciation_amortization': 'int', - 'ebitda_margin': 'int', - 'earnings_before_interest_taxes_depreciation_amortization_usd': 'int', - 'earning_before_interest_taxes_usd': 'int', - 'earnings_before_tax': 'int', - 'earnings_per_basic_share': 'int', - 'earnings_per_diluted_share': 'int', - 'earnings_per_basic_share_usd': 'int', - 'shareholders_equity': 'int', - 'average_equity': 'int', - 'shareholders_equity_usd': 'int', - 'enterprise_value': 'int', - 'enterprise_value_over_ebit': 'int', - 'enterprise_value_over_ebitda': 'int', - 'free_cash_flow': 'int', - 'free_cash_flow_per_share': 'int', - 'foreign_currency_usd_exchange_rate': 'int', - 'gross_profit': 'int', - 'gross_margin': 'int', - 'goodwill_and_intangible_assets': 'int', - 'interest_expense': 'int', - 'invested_capital': 'int', - 'invested_capital_average': 'int', - 'inventory': 'int', - 'investments': 'int', - 'investments_current': 'int', - 'investments_non_current': 'int', - 'total_liabilities': 'int', - 'current_liabilities': 'int', - 'liabilities_non_current': 'int', - 'market_capitalization': 'int', - 'net_cash_flow': 'int', - 'net_cash_flow_business_acquisitions_disposals': 'int', - 'issuance_equity_shares': 'int', - 'issuance_debt_securities': 'int', - 'payment_dividends_other_cash_distributions': 'int', - 'net_cash_flow_from_financing': 'int', - 'net_cash_flow_from_investing': 'int', - 'net_cash_flow_investment_acquisitions_disposals': 'int', - 'net_cash_flow_from_operations': 'int', - 'effect_of_exchange_rate_changes_on_cash': 'int', - 'net_income': 'int', - 'net_income_common_stock': 'int', - 'net_income_common_stock_usd': 'int', - 'net_loss_income_from_discontinued_operations': 'int', - 'net_income_to_non_controlling_interests': 'int', - 'profit_margin': 'int', - 'operating_expenses': 'int', - 'operating_income': 'int', - 'trade_and_non_trade_payables': 'int', - 'payout_ratio': 'int', - 'price_to_book_value': 'int', - 'price_earnings': 'int', - 'price_to_earnings_ratio': 'int', - 'property_plant_equipment_net': 'int', - 'preferred_dividends_income_statement_impact': 'int', - 'share_price_adjusted_close': 'int', - 'price_sales': 'int', - 'price_to_sales_ratio': 'int', - 'trade_and_non_trade_receivables': 'int', - 'accumulated_retained_earnings_deficit': 'int', - 'revenues': 'int', - 'revenues_usd': 'int', - 'research_and_development_expense': 'int', - 'return_on_average_assets': 'int', - 'return_on_average_equity': 'int', - 'return_on_invested_capital': 'int', - 'return_on_sales': 'int', - 'share_based_compensation': 'int', - 'selling_general_and_administrative_expense': 'int', - 'share_factor': 'int', - 'shares': 'int', - 'weighted_average_shares': 'int', - 'weighted_average_shares_diluted': 'int', - 'sales_per_share': 'int', - 'tangible_asset_value': 'int', - 'tax_assets': 'int', - 'income_tax_expense': 'int', - 'tax_liabilities': 'int', - 'tangible_assets_book_value_per_share': 'int', - 'working_capital': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'period': 'period', - 'calendar_date': 'calendarDate', - 'report_period': 'reportPeriod', - 'updated': 'updated', - 'accumulated_other_comprehensive_income': 'accumulatedOtherComprehensiveIncome', - 'assets': 'assets', - 'assets_average': 'assetsAverage', - 'assets_current': 'assetsCurrent', - 'asset_turnover': 'assetTurnover', - 'assets_non_current': 'assetsNonCurrent', - 'book_value_per_share': 'bookValuePerShare', - 'capital_expenditure': 'capitalExpenditure', - 'cash_and_equivalents': 'cashAndEquivalents', - 'cash_and_equivalents_usd': 'cashAndEquivalentsUSD', - 'cost_of_revenue': 'costOfRevenue', - 'consolidated_income': 'consolidatedIncome', - 'current_ratio': 'currentRatio', - 'debt_to_equity_ratio': 'debtToEquityRatio', - 'debt': 'debt', - 'debt_current': 'debtCurrent', - 'debt_non_current': 'debtNonCurrent', - 'debt_usd': 'debtUSD', - 'deferred_revenue': 'deferredRevenue', - 'depreciation_amortization_and_accretion': 'depreciationAmortizationAndAccretion', - 'deposits': 'deposits', - 'dividend_yield': 'dividendYield', - 'dividends_per_basic_common_share': 'dividendsPerBasicCommonShare', - 'earning_before_interest_taxes': 'earningBeforeInterestTaxes', - 'earnings_before_interest_taxes_depreciation_amortization': 'earningsBeforeInterestTaxesDepreciationAmortization', - 'ebitda_margin': 'EBITDAMargin', - 'earnings_before_interest_taxes_depreciation_amortization_usd': 'earningsBeforeInterestTaxesDepreciationAmortizationUSD', - 'earning_before_interest_taxes_usd': 'earningBeforeInterestTaxesUSD', - 'earnings_before_tax': 'earningsBeforeTax', - 'earnings_per_basic_share': 'earningsPerBasicShare', - 'earnings_per_diluted_share': 'earningsPerDilutedShare', - 'earnings_per_basic_share_usd': 'earningsPerBasicShareUSD', - 'shareholders_equity': 'shareholdersEquity', - 'average_equity': 'averageEquity', - 'shareholders_equity_usd': 'shareholdersEquityUSD', - 'enterprise_value': 'enterpriseValue', - 'enterprise_value_over_ebit': 'enterpriseValueOverEBIT', - 'enterprise_value_over_ebitda': 'enterpriseValueOverEBITDA', - 'free_cash_flow': 'freeCashFlow', - 'free_cash_flow_per_share': 'freeCashFlowPerShare', - 'foreign_currency_usd_exchange_rate': 'foreignCurrencyUSDExchangeRate', - 'gross_profit': 'grossProfit', - 'gross_margin': 'grossMargin', - 'goodwill_and_intangible_assets': 'goodwillAndIntangibleAssets', - 'interest_expense': 'interestExpense', - 'invested_capital': 'investedCapital', - 'invested_capital_average': 'investedCapitalAverage', - 'inventory': 'inventory', - 'investments': 'investments', - 'investments_current': 'investmentsCurrent', - 'investments_non_current': 'investmentsNonCurrent', - 'total_liabilities': 'totalLiabilities', - 'current_liabilities': 'currentLiabilities', - 'liabilities_non_current': 'liabilitiesNonCurrent', - 'market_capitalization': 'marketCapitalization', - 'net_cash_flow': 'netCashFlow', - 'net_cash_flow_business_acquisitions_disposals': 'netCashFlowBusinessAcquisitionsDisposals', - 'issuance_equity_shares': 'issuanceEquityShares', - 'issuance_debt_securities': 'issuanceDebtSecurities', - 'payment_dividends_other_cash_distributions': 'paymentDividendsOtherCashDistributions', - 'net_cash_flow_from_financing': 'netCashFlowFromFinancing', - 'net_cash_flow_from_investing': 'netCashFlowFromInvesting', - 'net_cash_flow_investment_acquisitions_disposals': 'netCashFlowInvestmentAcquisitionsDisposals', - 'net_cash_flow_from_operations': 'netCashFlowFromOperations', - 'effect_of_exchange_rate_changes_on_cash': 'effectOfExchangeRateChangesOnCash', - 'net_income': 'netIncome', - 'net_income_common_stock': 'netIncomeCommonStock', - 'net_income_common_stock_usd': 'netIncomeCommonStockUSD', - 'net_loss_income_from_discontinued_operations': 'netLossIncomeFromDiscontinuedOperations', - 'net_income_to_non_controlling_interests': 'netIncomeToNonControllingInterests', - 'profit_margin': 'profitMargin', - 'operating_expenses': 'operatingExpenses', - 'operating_income': 'operatingIncome', - 'trade_and_non_trade_payables': 'tradeAndNonTradePayables', - 'payout_ratio': 'payoutRatio', - 'price_to_book_value': 'priceToBookValue', - 'price_earnings': 'priceEarnings', - 'price_to_earnings_ratio': 'priceToEarningsRatio', - 'property_plant_equipment_net': 'propertyPlantEquipmentNet', - 'preferred_dividends_income_statement_impact': 'preferredDividendsIncomeStatementImpact', - 'share_price_adjusted_close': 'sharePriceAdjustedClose', - 'price_sales': 'priceSales', - 'price_to_sales_ratio': 'priceToSalesRatio', - 'trade_and_non_trade_receivables': 'tradeAndNonTradeReceivables', - 'accumulated_retained_earnings_deficit': 'accumulatedRetainedEarningsDeficit', - 'revenues': 'revenues', - 'revenues_usd': 'revenuesUSD', - 'research_and_development_expense': 'researchAndDevelopmentExpense', - 'return_on_average_assets': 'returnOnAverageAssets', - 'return_on_average_equity': 'returnOnAverageEquity', - 'return_on_invested_capital': 'returnOnInvestedCapital', - 'return_on_sales': 'returnOnSales', - 'share_based_compensation': 'shareBasedCompensation', - 'selling_general_and_administrative_expense': 'sellingGeneralAndAdministrativeExpense', - 'share_factor': 'shareFactor', - 'shares': 'shares', - 'weighted_average_shares': 'weightedAverageShares', - 'weighted_average_shares_diluted': 'weightedAverageSharesDiluted', - 'sales_per_share': 'salesPerShare', - 'tangible_asset_value': 'tangibleAssetValue', - 'tax_assets': 'taxAssets', - 'income_tax_expense': 'incomeTaxExpense', - 'tax_liabilities': 'taxLiabilities', - 'tangible_assets_book_value_per_share': 'tangibleAssetsBookValuePerShare', - 'working_capital': 'workingCapital' - } - - def __init__(self, ticker=None, period=None, calendar_date=None, report_period=None, updated=None, accumulated_other_comprehensive_income=None, assets=None, assets_average=None, assets_current=None, asset_turnover=None, assets_non_current=None, book_value_per_share=None, capital_expenditure=None, cash_and_equivalents=None, cash_and_equivalents_usd=None, cost_of_revenue=None, consolidated_income=None, current_ratio=None, debt_to_equity_ratio=None, debt=None, debt_current=None, debt_non_current=None, debt_usd=None, deferred_revenue=None, depreciation_amortization_and_accretion=None, deposits=None, dividend_yield=None, dividends_per_basic_common_share=None, earning_before_interest_taxes=None, earnings_before_interest_taxes_depreciation_amortization=None, ebitda_margin=None, earnings_before_interest_taxes_depreciation_amortization_usd=None, earning_before_interest_taxes_usd=None, earnings_before_tax=None, earnings_per_basic_share=None, earnings_per_diluted_share=None, earnings_per_basic_share_usd=None, shareholders_equity=None, average_equity=None, shareholders_equity_usd=None, enterprise_value=None, enterprise_value_over_ebit=None, enterprise_value_over_ebitda=None, free_cash_flow=None, free_cash_flow_per_share=None, foreign_currency_usd_exchange_rate=None, gross_profit=None, gross_margin=None, goodwill_and_intangible_assets=None, interest_expense=None, invested_capital=None, invested_capital_average=None, inventory=None, investments=None, investments_current=None, investments_non_current=None, total_liabilities=None, current_liabilities=None, liabilities_non_current=None, market_capitalization=None, net_cash_flow=None, net_cash_flow_business_acquisitions_disposals=None, issuance_equity_shares=None, issuance_debt_securities=None, payment_dividends_other_cash_distributions=None, net_cash_flow_from_financing=None, net_cash_flow_from_investing=None, net_cash_flow_investment_acquisitions_disposals=None, net_cash_flow_from_operations=None, effect_of_exchange_rate_changes_on_cash=None, net_income=None, net_income_common_stock=None, net_income_common_stock_usd=None, net_loss_income_from_discontinued_operations=None, net_income_to_non_controlling_interests=None, profit_margin=None, operating_expenses=None, operating_income=None, trade_and_non_trade_payables=None, payout_ratio=None, price_to_book_value=None, price_earnings=None, price_to_earnings_ratio=None, property_plant_equipment_net=None, preferred_dividends_income_statement_impact=None, share_price_adjusted_close=None, price_sales=None, price_to_sales_ratio=None, trade_and_non_trade_receivables=None, accumulated_retained_earnings_deficit=None, revenues=None, revenues_usd=None, research_and_development_expense=None, return_on_average_assets=None, return_on_average_equity=None, return_on_invested_capital=None, return_on_sales=None, share_based_compensation=None, selling_general_and_administrative_expense=None, share_factor=None, shares=None, weighted_average_shares=None, weighted_average_shares_diluted=None, sales_per_share=None, tangible_asset_value=None, tax_assets=None, income_tax_expense=None, tax_liabilities=None, tangible_assets_book_value_per_share=None, working_capital=None): # noqa: E501 - """Financials - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._period = None - self._calendar_date = None - self._report_period = None - self._updated = None - self._accumulated_other_comprehensive_income = None - self._assets = None - self._assets_average = None - self._assets_current = None - self._asset_turnover = None - self._assets_non_current = None - self._book_value_per_share = None - self._capital_expenditure = None - self._cash_and_equivalents = None - self._cash_and_equivalents_usd = None - self._cost_of_revenue = None - self._consolidated_income = None - self._current_ratio = None - self._debt_to_equity_ratio = None - self._debt = None - self._debt_current = None - self._debt_non_current = None - self._debt_usd = None - self._deferred_revenue = None - self._depreciation_amortization_and_accretion = None - self._deposits = None - self._dividend_yield = None - self._dividends_per_basic_common_share = None - self._earning_before_interest_taxes = None - self._earnings_before_interest_taxes_depreciation_amortization = None - self._ebitda_margin = None - self._earnings_before_interest_taxes_depreciation_amortization_usd = None - self._earning_before_interest_taxes_usd = None - self._earnings_before_tax = None - self._earnings_per_basic_share = None - self._earnings_per_diluted_share = None - self._earnings_per_basic_share_usd = None - self._shareholders_equity = None - self._average_equity = None - self._shareholders_equity_usd = None - self._enterprise_value = None - self._enterprise_value_over_ebit = None - self._enterprise_value_over_ebitda = None - self._free_cash_flow = None - self._free_cash_flow_per_share = None - self._foreign_currency_usd_exchange_rate = None - self._gross_profit = None - self._gross_margin = None - self._goodwill_and_intangible_assets = None - self._interest_expense = None - self._invested_capital = None - self._invested_capital_average = None - self._inventory = None - self._investments = None - self._investments_current = None - self._investments_non_current = None - self._total_liabilities = None - self._current_liabilities = None - self._liabilities_non_current = None - self._market_capitalization = None - self._net_cash_flow = None - self._net_cash_flow_business_acquisitions_disposals = None - self._issuance_equity_shares = None - self._issuance_debt_securities = None - self._payment_dividends_other_cash_distributions = None - self._net_cash_flow_from_financing = None - self._net_cash_flow_from_investing = None - self._net_cash_flow_investment_acquisitions_disposals = None - self._net_cash_flow_from_operations = None - self._effect_of_exchange_rate_changes_on_cash = None - self._net_income = None - self._net_income_common_stock = None - self._net_income_common_stock_usd = None - self._net_loss_income_from_discontinued_operations = None - self._net_income_to_non_controlling_interests = None - self._profit_margin = None - self._operating_expenses = None - self._operating_income = None - self._trade_and_non_trade_payables = None - self._payout_ratio = None - self._price_to_book_value = None - self._price_earnings = None - self._price_to_earnings_ratio = None - self._property_plant_equipment_net = None - self._preferred_dividends_income_statement_impact = None - self._share_price_adjusted_close = None - self._price_sales = None - self._price_to_sales_ratio = None - self._trade_and_non_trade_receivables = None - self._accumulated_retained_earnings_deficit = None - self._revenues = None - self._revenues_usd = None - self._research_and_development_expense = None - self._return_on_average_assets = None - self._return_on_average_equity = None - self._return_on_invested_capital = None - self._return_on_sales = None - self._share_based_compensation = None - self._selling_general_and_administrative_expense = None - self._share_factor = None - self._shares = None - self._weighted_average_shares = None - self._weighted_average_shares_diluted = None - self._sales_per_share = None - self._tangible_asset_value = None - self._tax_assets = None - self._income_tax_expense = None - self._tax_liabilities = None - self._tangible_assets_book_value_per_share = None - self._working_capital = None - self.discriminator = None - self.ticker = ticker - if period is not None: - self.period = period - if calendar_date is not None: - self.calendar_date = calendar_date - if report_period is not None: - self.report_period = report_period - if updated is not None: - self.updated = updated - if accumulated_other_comprehensive_income is not None: - self.accumulated_other_comprehensive_income = accumulated_other_comprehensive_income - if assets is not None: - self.assets = assets - if assets_average is not None: - self.assets_average = assets_average - if assets_current is not None: - self.assets_current = assets_current - if asset_turnover is not None: - self.asset_turnover = asset_turnover - if assets_non_current is not None: - self.assets_non_current = assets_non_current - if book_value_per_share is not None: - self.book_value_per_share = book_value_per_share - if capital_expenditure is not None: - self.capital_expenditure = capital_expenditure - if cash_and_equivalents is not None: - self.cash_and_equivalents = cash_and_equivalents - if cash_and_equivalents_usd is not None: - self.cash_and_equivalents_usd = cash_and_equivalents_usd - if cost_of_revenue is not None: - self.cost_of_revenue = cost_of_revenue - if consolidated_income is not None: - self.consolidated_income = consolidated_income - if current_ratio is not None: - self.current_ratio = current_ratio - if debt_to_equity_ratio is not None: - self.debt_to_equity_ratio = debt_to_equity_ratio - if debt is not None: - self.debt = debt - if debt_current is not None: - self.debt_current = debt_current - if debt_non_current is not None: - self.debt_non_current = debt_non_current - if debt_usd is not None: - self.debt_usd = debt_usd - if deferred_revenue is not None: - self.deferred_revenue = deferred_revenue - if depreciation_amortization_and_accretion is not None: - self.depreciation_amortization_and_accretion = depreciation_amortization_and_accretion - if deposits is not None: - self.deposits = deposits - if dividend_yield is not None: - self.dividend_yield = dividend_yield - if dividends_per_basic_common_share is not None: - self.dividends_per_basic_common_share = dividends_per_basic_common_share - if earning_before_interest_taxes is not None: - self.earning_before_interest_taxes = earning_before_interest_taxes - if earnings_before_interest_taxes_depreciation_amortization is not None: - self.earnings_before_interest_taxes_depreciation_amortization = earnings_before_interest_taxes_depreciation_amortization - if ebitda_margin is not None: - self.ebitda_margin = ebitda_margin - if earnings_before_interest_taxes_depreciation_amortization_usd is not None: - self.earnings_before_interest_taxes_depreciation_amortization_usd = earnings_before_interest_taxes_depreciation_amortization_usd - if earning_before_interest_taxes_usd is not None: - self.earning_before_interest_taxes_usd = earning_before_interest_taxes_usd - if earnings_before_tax is not None: - self.earnings_before_tax = earnings_before_tax - if earnings_per_basic_share is not None: - self.earnings_per_basic_share = earnings_per_basic_share - if earnings_per_diluted_share is not None: - self.earnings_per_diluted_share = earnings_per_diluted_share - if earnings_per_basic_share_usd is not None: - self.earnings_per_basic_share_usd = earnings_per_basic_share_usd - if shareholders_equity is not None: - self.shareholders_equity = shareholders_equity - if average_equity is not None: - self.average_equity = average_equity - if shareholders_equity_usd is not None: - self.shareholders_equity_usd = shareholders_equity_usd - if enterprise_value is not None: - self.enterprise_value = enterprise_value - if enterprise_value_over_ebit is not None: - self.enterprise_value_over_ebit = enterprise_value_over_ebit - if enterprise_value_over_ebitda is not None: - self.enterprise_value_over_ebitda = enterprise_value_over_ebitda - if free_cash_flow is not None: - self.free_cash_flow = free_cash_flow - if free_cash_flow_per_share is not None: - self.free_cash_flow_per_share = free_cash_flow_per_share - if foreign_currency_usd_exchange_rate is not None: - self.foreign_currency_usd_exchange_rate = foreign_currency_usd_exchange_rate - if gross_profit is not None: - self.gross_profit = gross_profit - if gross_margin is not None: - self.gross_margin = gross_margin - if goodwill_and_intangible_assets is not None: - self.goodwill_and_intangible_assets = goodwill_and_intangible_assets - if interest_expense is not None: - self.interest_expense = interest_expense - if invested_capital is not None: - self.invested_capital = invested_capital - if invested_capital_average is not None: - self.invested_capital_average = invested_capital_average - if inventory is not None: - self.inventory = inventory - if investments is not None: - self.investments = investments - if investments_current is not None: - self.investments_current = investments_current - if investments_non_current is not None: - self.investments_non_current = investments_non_current - if total_liabilities is not None: - self.total_liabilities = total_liabilities - if current_liabilities is not None: - self.current_liabilities = current_liabilities - if liabilities_non_current is not None: - self.liabilities_non_current = liabilities_non_current - if market_capitalization is not None: - self.market_capitalization = market_capitalization - if net_cash_flow is not None: - self.net_cash_flow = net_cash_flow - if net_cash_flow_business_acquisitions_disposals is not None: - self.net_cash_flow_business_acquisitions_disposals = net_cash_flow_business_acquisitions_disposals - if issuance_equity_shares is not None: - self.issuance_equity_shares = issuance_equity_shares - if issuance_debt_securities is not None: - self.issuance_debt_securities = issuance_debt_securities - if payment_dividends_other_cash_distributions is not None: - self.payment_dividends_other_cash_distributions = payment_dividends_other_cash_distributions - if net_cash_flow_from_financing is not None: - self.net_cash_flow_from_financing = net_cash_flow_from_financing - if net_cash_flow_from_investing is not None: - self.net_cash_flow_from_investing = net_cash_flow_from_investing - if net_cash_flow_investment_acquisitions_disposals is not None: - self.net_cash_flow_investment_acquisitions_disposals = net_cash_flow_investment_acquisitions_disposals - if net_cash_flow_from_operations is not None: - self.net_cash_flow_from_operations = net_cash_flow_from_operations - if effect_of_exchange_rate_changes_on_cash is not None: - self.effect_of_exchange_rate_changes_on_cash = effect_of_exchange_rate_changes_on_cash - if net_income is not None: - self.net_income = net_income - if net_income_common_stock is not None: - self.net_income_common_stock = net_income_common_stock - if net_income_common_stock_usd is not None: - self.net_income_common_stock_usd = net_income_common_stock_usd - if net_loss_income_from_discontinued_operations is not None: - self.net_loss_income_from_discontinued_operations = net_loss_income_from_discontinued_operations - if net_income_to_non_controlling_interests is not None: - self.net_income_to_non_controlling_interests = net_income_to_non_controlling_interests - if profit_margin is not None: - self.profit_margin = profit_margin - if operating_expenses is not None: - self.operating_expenses = operating_expenses - if operating_income is not None: - self.operating_income = operating_income - if trade_and_non_trade_payables is not None: - self.trade_and_non_trade_payables = trade_and_non_trade_payables - if payout_ratio is not None: - self.payout_ratio = payout_ratio - if price_to_book_value is not None: - self.price_to_book_value = price_to_book_value - if price_earnings is not None: - self.price_earnings = price_earnings - if price_to_earnings_ratio is not None: - self.price_to_earnings_ratio = price_to_earnings_ratio - if property_plant_equipment_net is not None: - self.property_plant_equipment_net = property_plant_equipment_net - if preferred_dividends_income_statement_impact is not None: - self.preferred_dividends_income_statement_impact = preferred_dividends_income_statement_impact - if share_price_adjusted_close is not None: - self.share_price_adjusted_close = share_price_adjusted_close - if price_sales is not None: - self.price_sales = price_sales - if price_to_sales_ratio is not None: - self.price_to_sales_ratio = price_to_sales_ratio - if trade_and_non_trade_receivables is not None: - self.trade_and_non_trade_receivables = trade_and_non_trade_receivables - if accumulated_retained_earnings_deficit is not None: - self.accumulated_retained_earnings_deficit = accumulated_retained_earnings_deficit - if revenues is not None: - self.revenues = revenues - if revenues_usd is not None: - self.revenues_usd = revenues_usd - if research_and_development_expense is not None: - self.research_and_development_expense = research_and_development_expense - if return_on_average_assets is not None: - self.return_on_average_assets = return_on_average_assets - if return_on_average_equity is not None: - self.return_on_average_equity = return_on_average_equity - if return_on_invested_capital is not None: - self.return_on_invested_capital = return_on_invested_capital - if return_on_sales is not None: - self.return_on_sales = return_on_sales - if share_based_compensation is not None: - self.share_based_compensation = share_based_compensation - if selling_general_and_administrative_expense is not None: - self.selling_general_and_administrative_expense = selling_general_and_administrative_expense - if share_factor is not None: - self.share_factor = share_factor - if shares is not None: - self.shares = shares - if weighted_average_shares is not None: - self.weighted_average_shares = weighted_average_shares - if weighted_average_shares_diluted is not None: - self.weighted_average_shares_diluted = weighted_average_shares_diluted - if sales_per_share is not None: - self.sales_per_share = sales_per_share - if tangible_asset_value is not None: - self.tangible_asset_value = tangible_asset_value - if tax_assets is not None: - self.tax_assets = tax_assets - if income_tax_expense is not None: - self.income_tax_expense = income_tax_expense - if tax_liabilities is not None: - self.tax_liabilities = tax_liabilities - if tangible_assets_book_value_per_share is not None: - self.tangible_assets_book_value_per_share = tangible_assets_book_value_per_share - if working_capital is not None: - self.working_capital = working_capital - - @property - def ticker(self): - """Gets the ticker of this Financials. # noqa: E501 - - - :return: The ticker of this Financials. # noqa: E501 - :rtype: TickerSymbol - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this Financials. - - - :param ticker: The ticker of this Financials. # noqa: E501 - :type: TickerSymbol - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def period(self): - """Gets the period of this Financials. # noqa: E501 - - Reporting period. # noqa: E501 - - :return: The period of this Financials. # noqa: E501 - :rtype: str - """ - return self._period - - @period.setter - def period(self, period): - """Sets the period of this Financials. - - Reporting period. # noqa: E501 - - :param period: The period of this Financials. # noqa: E501 - :type: str - """ - allowed_values = ["Q", "T", "QA", "TA", "Y", "YA"] # noqa: E501 - if period not in allowed_values: - raise ValueError( - "Invalid value for `period` ({0}), must be one of {1}" # noqa: E501 - .format(period, allowed_values) - ) - - self._period = period - - @property - def calendar_date(self): - """Gets the calendar_date of this Financials. # noqa: E501 - - - :return: The calendar_date of this Financials. # noqa: E501 - :rtype: datetime - """ - return self._calendar_date - - @calendar_date.setter - def calendar_date(self, calendar_date): - """Sets the calendar_date of this Financials. - - - :param calendar_date: The calendar_date of this Financials. # noqa: E501 - :type: datetime - """ - - self._calendar_date = calendar_date - - @property - def report_period(self): - """Gets the report_period of this Financials. # noqa: E501 - - - :return: The report_period of this Financials. # noqa: E501 - :rtype: datetime - """ - return self._report_period - - @report_period.setter - def report_period(self, report_period): - """Sets the report_period of this Financials. - - - :param report_period: The report_period of this Financials. # noqa: E501 - :type: datetime - """ - - self._report_period = report_period - - @property - def updated(self): - """Gets the updated of this Financials. # noqa: E501 - - - :return: The updated of this Financials. # noqa: E501 - :rtype: datetime - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this Financials. - - - :param updated: The updated of this Financials. # noqa: E501 - :type: datetime - """ - - self._updated = updated - - @property - def accumulated_other_comprehensive_income(self): - """Gets the accumulated_other_comprehensive_income of this Financials. # noqa: E501 - - - :return: The accumulated_other_comprehensive_income of this Financials. # noqa: E501 - :rtype: int - """ - return self._accumulated_other_comprehensive_income - - @accumulated_other_comprehensive_income.setter - def accumulated_other_comprehensive_income(self, accumulated_other_comprehensive_income): - """Sets the accumulated_other_comprehensive_income of this Financials. - - - :param accumulated_other_comprehensive_income: The accumulated_other_comprehensive_income of this Financials. # noqa: E501 - :type: int - """ - - self._accumulated_other_comprehensive_income = accumulated_other_comprehensive_income - - @property - def assets(self): - """Gets the assets of this Financials. # noqa: E501 - - - :return: The assets of this Financials. # noqa: E501 - :rtype: int - """ - return self._assets - - @assets.setter - def assets(self, assets): - """Sets the assets of this Financials. - - - :param assets: The assets of this Financials. # noqa: E501 - :type: int - """ - - self._assets = assets - - @property - def assets_average(self): - """Gets the assets_average of this Financials. # noqa: E501 - - - :return: The assets_average of this Financials. # noqa: E501 - :rtype: int - """ - return self._assets_average - - @assets_average.setter - def assets_average(self, assets_average): - """Sets the assets_average of this Financials. - - - :param assets_average: The assets_average of this Financials. # noqa: E501 - :type: int - """ - - self._assets_average = assets_average - - @property - def assets_current(self): - """Gets the assets_current of this Financials. # noqa: E501 - - - :return: The assets_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._assets_current - - @assets_current.setter - def assets_current(self, assets_current): - """Sets the assets_current of this Financials. - - - :param assets_current: The assets_current of this Financials. # noqa: E501 - :type: int - """ - - self._assets_current = assets_current - - @property - def asset_turnover(self): - """Gets the asset_turnover of this Financials. # noqa: E501 - - - :return: The asset_turnover of this Financials. # noqa: E501 - :rtype: int - """ - return self._asset_turnover - - @asset_turnover.setter - def asset_turnover(self, asset_turnover): - """Sets the asset_turnover of this Financials. - - - :param asset_turnover: The asset_turnover of this Financials. # noqa: E501 - :type: int - """ - - self._asset_turnover = asset_turnover - - @property - def assets_non_current(self): - """Gets the assets_non_current of this Financials. # noqa: E501 - - - :return: The assets_non_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._assets_non_current - - @assets_non_current.setter - def assets_non_current(self, assets_non_current): - """Sets the assets_non_current of this Financials. - - - :param assets_non_current: The assets_non_current of this Financials. # noqa: E501 - :type: int - """ - - self._assets_non_current = assets_non_current - - @property - def book_value_per_share(self): - """Gets the book_value_per_share of this Financials. # noqa: E501 - - - :return: The book_value_per_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._book_value_per_share - - @book_value_per_share.setter - def book_value_per_share(self, book_value_per_share): - """Sets the book_value_per_share of this Financials. - - - :param book_value_per_share: The book_value_per_share of this Financials. # noqa: E501 - :type: int - """ - - self._book_value_per_share = book_value_per_share - - @property - def capital_expenditure(self): - """Gets the capital_expenditure of this Financials. # noqa: E501 - - - :return: The capital_expenditure of this Financials. # noqa: E501 - :rtype: int - """ - return self._capital_expenditure - - @capital_expenditure.setter - def capital_expenditure(self, capital_expenditure): - """Sets the capital_expenditure of this Financials. - - - :param capital_expenditure: The capital_expenditure of this Financials. # noqa: E501 - :type: int - """ - - self._capital_expenditure = capital_expenditure - - @property - def cash_and_equivalents(self): - """Gets the cash_and_equivalents of this Financials. # noqa: E501 - - - :return: The cash_and_equivalents of this Financials. # noqa: E501 - :rtype: int - """ - return self._cash_and_equivalents - - @cash_and_equivalents.setter - def cash_and_equivalents(self, cash_and_equivalents): - """Sets the cash_and_equivalents of this Financials. - - - :param cash_and_equivalents: The cash_and_equivalents of this Financials. # noqa: E501 - :type: int - """ - - self._cash_and_equivalents = cash_and_equivalents - - @property - def cash_and_equivalents_usd(self): - """Gets the cash_and_equivalents_usd of this Financials. # noqa: E501 - - - :return: The cash_and_equivalents_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._cash_and_equivalents_usd - - @cash_and_equivalents_usd.setter - def cash_and_equivalents_usd(self, cash_and_equivalents_usd): - """Sets the cash_and_equivalents_usd of this Financials. - - - :param cash_and_equivalents_usd: The cash_and_equivalents_usd of this Financials. # noqa: E501 - :type: int - """ - - self._cash_and_equivalents_usd = cash_and_equivalents_usd - - @property - def cost_of_revenue(self): - """Gets the cost_of_revenue of this Financials. # noqa: E501 - - - :return: The cost_of_revenue of this Financials. # noqa: E501 - :rtype: int - """ - return self._cost_of_revenue - - @cost_of_revenue.setter - def cost_of_revenue(self, cost_of_revenue): - """Sets the cost_of_revenue of this Financials. - - - :param cost_of_revenue: The cost_of_revenue of this Financials. # noqa: E501 - :type: int - """ - - self._cost_of_revenue = cost_of_revenue - - @property - def consolidated_income(self): - """Gets the consolidated_income of this Financials. # noqa: E501 - - - :return: The consolidated_income of this Financials. # noqa: E501 - :rtype: int - """ - return self._consolidated_income - - @consolidated_income.setter - def consolidated_income(self, consolidated_income): - """Sets the consolidated_income of this Financials. - - - :param consolidated_income: The consolidated_income of this Financials. # noqa: E501 - :type: int - """ - - self._consolidated_income = consolidated_income - - @property - def current_ratio(self): - """Gets the current_ratio of this Financials. # noqa: E501 - - - :return: The current_ratio of this Financials. # noqa: E501 - :rtype: int - """ - return self._current_ratio - - @current_ratio.setter - def current_ratio(self, current_ratio): - """Sets the current_ratio of this Financials. - - - :param current_ratio: The current_ratio of this Financials. # noqa: E501 - :type: int - """ - - self._current_ratio = current_ratio - - @property - def debt_to_equity_ratio(self): - """Gets the debt_to_equity_ratio of this Financials. # noqa: E501 - - - :return: The debt_to_equity_ratio of this Financials. # noqa: E501 - :rtype: int - """ - return self._debt_to_equity_ratio - - @debt_to_equity_ratio.setter - def debt_to_equity_ratio(self, debt_to_equity_ratio): - """Sets the debt_to_equity_ratio of this Financials. - - - :param debt_to_equity_ratio: The debt_to_equity_ratio of this Financials. # noqa: E501 - :type: int - """ - - self._debt_to_equity_ratio = debt_to_equity_ratio - - @property - def debt(self): - """Gets the debt of this Financials. # noqa: E501 - - - :return: The debt of this Financials. # noqa: E501 - :rtype: int - """ - return self._debt - - @debt.setter - def debt(self, debt): - """Sets the debt of this Financials. - - - :param debt: The debt of this Financials. # noqa: E501 - :type: int - """ - - self._debt = debt - - @property - def debt_current(self): - """Gets the debt_current of this Financials. # noqa: E501 - - - :return: The debt_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._debt_current - - @debt_current.setter - def debt_current(self, debt_current): - """Sets the debt_current of this Financials. - - - :param debt_current: The debt_current of this Financials. # noqa: E501 - :type: int - """ - - self._debt_current = debt_current - - @property - def debt_non_current(self): - """Gets the debt_non_current of this Financials. # noqa: E501 - - - :return: The debt_non_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._debt_non_current - - @debt_non_current.setter - def debt_non_current(self, debt_non_current): - """Sets the debt_non_current of this Financials. - - - :param debt_non_current: The debt_non_current of this Financials. # noqa: E501 - :type: int - """ - - self._debt_non_current = debt_non_current - - @property - def debt_usd(self): - """Gets the debt_usd of this Financials. # noqa: E501 - - - :return: The debt_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._debt_usd - - @debt_usd.setter - def debt_usd(self, debt_usd): - """Sets the debt_usd of this Financials. - - - :param debt_usd: The debt_usd of this Financials. # noqa: E501 - :type: int - """ - - self._debt_usd = debt_usd - - @property - def deferred_revenue(self): - """Gets the deferred_revenue of this Financials. # noqa: E501 - - - :return: The deferred_revenue of this Financials. # noqa: E501 - :rtype: int - """ - return self._deferred_revenue - - @deferred_revenue.setter - def deferred_revenue(self, deferred_revenue): - """Sets the deferred_revenue of this Financials. - - - :param deferred_revenue: The deferred_revenue of this Financials. # noqa: E501 - :type: int - """ - - self._deferred_revenue = deferred_revenue - - @property - def depreciation_amortization_and_accretion(self): - """Gets the depreciation_amortization_and_accretion of this Financials. # noqa: E501 - - - :return: The depreciation_amortization_and_accretion of this Financials. # noqa: E501 - :rtype: int - """ - return self._depreciation_amortization_and_accretion - - @depreciation_amortization_and_accretion.setter - def depreciation_amortization_and_accretion(self, depreciation_amortization_and_accretion): - """Sets the depreciation_amortization_and_accretion of this Financials. - - - :param depreciation_amortization_and_accretion: The depreciation_amortization_and_accretion of this Financials. # noqa: E501 - :type: int - """ - - self._depreciation_amortization_and_accretion = depreciation_amortization_and_accretion - - @property - def deposits(self): - """Gets the deposits of this Financials. # noqa: E501 - - - :return: The deposits of this Financials. # noqa: E501 - :rtype: int - """ - return self._deposits - - @deposits.setter - def deposits(self, deposits): - """Sets the deposits of this Financials. - - - :param deposits: The deposits of this Financials. # noqa: E501 - :type: int - """ - - self._deposits = deposits - - @property - def dividend_yield(self): - """Gets the dividend_yield of this Financials. # noqa: E501 - - - :return: The dividend_yield of this Financials. # noqa: E501 - :rtype: int - """ - return self._dividend_yield - - @dividend_yield.setter - def dividend_yield(self, dividend_yield): - """Sets the dividend_yield of this Financials. - - - :param dividend_yield: The dividend_yield of this Financials. # noqa: E501 - :type: int - """ - - self._dividend_yield = dividend_yield - - @property - def dividends_per_basic_common_share(self): - """Gets the dividends_per_basic_common_share of this Financials. # noqa: E501 - - - :return: The dividends_per_basic_common_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._dividends_per_basic_common_share - - @dividends_per_basic_common_share.setter - def dividends_per_basic_common_share(self, dividends_per_basic_common_share): - """Sets the dividends_per_basic_common_share of this Financials. - - - :param dividends_per_basic_common_share: The dividends_per_basic_common_share of this Financials. # noqa: E501 - :type: int - """ - - self._dividends_per_basic_common_share = dividends_per_basic_common_share - - @property - def earning_before_interest_taxes(self): - """Gets the earning_before_interest_taxes of this Financials. # noqa: E501 - - - :return: The earning_before_interest_taxes of this Financials. # noqa: E501 - :rtype: int - """ - return self._earning_before_interest_taxes - - @earning_before_interest_taxes.setter - def earning_before_interest_taxes(self, earning_before_interest_taxes): - """Sets the earning_before_interest_taxes of this Financials. - - - :param earning_before_interest_taxes: The earning_before_interest_taxes of this Financials. # noqa: E501 - :type: int - """ - - self._earning_before_interest_taxes = earning_before_interest_taxes - - @property - def earnings_before_interest_taxes_depreciation_amortization(self): - """Gets the earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 - - - :return: The earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_before_interest_taxes_depreciation_amortization - - @earnings_before_interest_taxes_depreciation_amortization.setter - def earnings_before_interest_taxes_depreciation_amortization(self, earnings_before_interest_taxes_depreciation_amortization): - """Sets the earnings_before_interest_taxes_depreciation_amortization of this Financials. - - - :param earnings_before_interest_taxes_depreciation_amortization: The earnings_before_interest_taxes_depreciation_amortization of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_before_interest_taxes_depreciation_amortization = earnings_before_interest_taxes_depreciation_amortization - - @property - def ebitda_margin(self): - """Gets the ebitda_margin of this Financials. # noqa: E501 - - - :return: The ebitda_margin of this Financials. # noqa: E501 - :rtype: int - """ - return self._ebitda_margin - - @ebitda_margin.setter - def ebitda_margin(self, ebitda_margin): - """Sets the ebitda_margin of this Financials. - - - :param ebitda_margin: The ebitda_margin of this Financials. # noqa: E501 - :type: int - """ - - self._ebitda_margin = ebitda_margin - - @property - def earnings_before_interest_taxes_depreciation_amortization_usd(self): - """Gets the earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 - - - :return: The earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_before_interest_taxes_depreciation_amortization_usd - - @earnings_before_interest_taxes_depreciation_amortization_usd.setter - def earnings_before_interest_taxes_depreciation_amortization_usd(self, earnings_before_interest_taxes_depreciation_amortization_usd): - """Sets the earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. - - - :param earnings_before_interest_taxes_depreciation_amortization_usd: The earnings_before_interest_taxes_depreciation_amortization_usd of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_before_interest_taxes_depreciation_amortization_usd = earnings_before_interest_taxes_depreciation_amortization_usd - - @property - def earning_before_interest_taxes_usd(self): - """Gets the earning_before_interest_taxes_usd of this Financials. # noqa: E501 - - - :return: The earning_before_interest_taxes_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._earning_before_interest_taxes_usd - - @earning_before_interest_taxes_usd.setter - def earning_before_interest_taxes_usd(self, earning_before_interest_taxes_usd): - """Sets the earning_before_interest_taxes_usd of this Financials. - - - :param earning_before_interest_taxes_usd: The earning_before_interest_taxes_usd of this Financials. # noqa: E501 - :type: int - """ - - self._earning_before_interest_taxes_usd = earning_before_interest_taxes_usd - - @property - def earnings_before_tax(self): - """Gets the earnings_before_tax of this Financials. # noqa: E501 - - - :return: The earnings_before_tax of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_before_tax - - @earnings_before_tax.setter - def earnings_before_tax(self, earnings_before_tax): - """Sets the earnings_before_tax of this Financials. - - - :param earnings_before_tax: The earnings_before_tax of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_before_tax = earnings_before_tax - - @property - def earnings_per_basic_share(self): - """Gets the earnings_per_basic_share of this Financials. # noqa: E501 - - - :return: The earnings_per_basic_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_per_basic_share - - @earnings_per_basic_share.setter - def earnings_per_basic_share(self, earnings_per_basic_share): - """Sets the earnings_per_basic_share of this Financials. - - - :param earnings_per_basic_share: The earnings_per_basic_share of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_per_basic_share = earnings_per_basic_share - - @property - def earnings_per_diluted_share(self): - """Gets the earnings_per_diluted_share of this Financials. # noqa: E501 - - - :return: The earnings_per_diluted_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_per_diluted_share - - @earnings_per_diluted_share.setter - def earnings_per_diluted_share(self, earnings_per_diluted_share): - """Sets the earnings_per_diluted_share of this Financials. - - - :param earnings_per_diluted_share: The earnings_per_diluted_share of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_per_diluted_share = earnings_per_diluted_share - - @property - def earnings_per_basic_share_usd(self): - """Gets the earnings_per_basic_share_usd of this Financials. # noqa: E501 - - - :return: The earnings_per_basic_share_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._earnings_per_basic_share_usd - - @earnings_per_basic_share_usd.setter - def earnings_per_basic_share_usd(self, earnings_per_basic_share_usd): - """Sets the earnings_per_basic_share_usd of this Financials. - - - :param earnings_per_basic_share_usd: The earnings_per_basic_share_usd of this Financials. # noqa: E501 - :type: int - """ - - self._earnings_per_basic_share_usd = earnings_per_basic_share_usd - - @property - def shareholders_equity(self): - """Gets the shareholders_equity of this Financials. # noqa: E501 - - - :return: The shareholders_equity of this Financials. # noqa: E501 - :rtype: int - """ - return self._shareholders_equity - - @shareholders_equity.setter - def shareholders_equity(self, shareholders_equity): - """Sets the shareholders_equity of this Financials. - - - :param shareholders_equity: The shareholders_equity of this Financials. # noqa: E501 - :type: int - """ - - self._shareholders_equity = shareholders_equity - - @property - def average_equity(self): - """Gets the average_equity of this Financials. # noqa: E501 - - - :return: The average_equity of this Financials. # noqa: E501 - :rtype: int - """ - return self._average_equity - - @average_equity.setter - def average_equity(self, average_equity): - """Sets the average_equity of this Financials. - - - :param average_equity: The average_equity of this Financials. # noqa: E501 - :type: int - """ - - self._average_equity = average_equity - - @property - def shareholders_equity_usd(self): - """Gets the shareholders_equity_usd of this Financials. # noqa: E501 - - - :return: The shareholders_equity_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._shareholders_equity_usd - - @shareholders_equity_usd.setter - def shareholders_equity_usd(self, shareholders_equity_usd): - """Sets the shareholders_equity_usd of this Financials. - - - :param shareholders_equity_usd: The shareholders_equity_usd of this Financials. # noqa: E501 - :type: int - """ - - self._shareholders_equity_usd = shareholders_equity_usd - - @property - def enterprise_value(self): - """Gets the enterprise_value of this Financials. # noqa: E501 - - - :return: The enterprise_value of this Financials. # noqa: E501 - :rtype: int - """ - return self._enterprise_value - - @enterprise_value.setter - def enterprise_value(self, enterprise_value): - """Sets the enterprise_value of this Financials. - - - :param enterprise_value: The enterprise_value of this Financials. # noqa: E501 - :type: int - """ - - self._enterprise_value = enterprise_value - - @property - def enterprise_value_over_ebit(self): - """Gets the enterprise_value_over_ebit of this Financials. # noqa: E501 - - - :return: The enterprise_value_over_ebit of this Financials. # noqa: E501 - :rtype: int - """ - return self._enterprise_value_over_ebit - - @enterprise_value_over_ebit.setter - def enterprise_value_over_ebit(self, enterprise_value_over_ebit): - """Sets the enterprise_value_over_ebit of this Financials. - - - :param enterprise_value_over_ebit: The enterprise_value_over_ebit of this Financials. # noqa: E501 - :type: int - """ - - self._enterprise_value_over_ebit = enterprise_value_over_ebit - - @property - def enterprise_value_over_ebitda(self): - """Gets the enterprise_value_over_ebitda of this Financials. # noqa: E501 - - - :return: The enterprise_value_over_ebitda of this Financials. # noqa: E501 - :rtype: int - """ - return self._enterprise_value_over_ebitda - - @enterprise_value_over_ebitda.setter - def enterprise_value_over_ebitda(self, enterprise_value_over_ebitda): - """Sets the enterprise_value_over_ebitda of this Financials. - - - :param enterprise_value_over_ebitda: The enterprise_value_over_ebitda of this Financials. # noqa: E501 - :type: int - """ - - self._enterprise_value_over_ebitda = enterprise_value_over_ebitda - - @property - def free_cash_flow(self): - """Gets the free_cash_flow of this Financials. # noqa: E501 - - - :return: The free_cash_flow of this Financials. # noqa: E501 - :rtype: int - """ - return self._free_cash_flow - - @free_cash_flow.setter - def free_cash_flow(self, free_cash_flow): - """Sets the free_cash_flow of this Financials. - - - :param free_cash_flow: The free_cash_flow of this Financials. # noqa: E501 - :type: int - """ - - self._free_cash_flow = free_cash_flow - - @property - def free_cash_flow_per_share(self): - """Gets the free_cash_flow_per_share of this Financials. # noqa: E501 - - - :return: The free_cash_flow_per_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._free_cash_flow_per_share - - @free_cash_flow_per_share.setter - def free_cash_flow_per_share(self, free_cash_flow_per_share): - """Sets the free_cash_flow_per_share of this Financials. - - - :param free_cash_flow_per_share: The free_cash_flow_per_share of this Financials. # noqa: E501 - :type: int - """ - - self._free_cash_flow_per_share = free_cash_flow_per_share - - @property - def foreign_currency_usd_exchange_rate(self): - """Gets the foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 - - - :return: The foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 - :rtype: int - """ - return self._foreign_currency_usd_exchange_rate - - @foreign_currency_usd_exchange_rate.setter - def foreign_currency_usd_exchange_rate(self, foreign_currency_usd_exchange_rate): - """Sets the foreign_currency_usd_exchange_rate of this Financials. - - - :param foreign_currency_usd_exchange_rate: The foreign_currency_usd_exchange_rate of this Financials. # noqa: E501 - :type: int - """ - - self._foreign_currency_usd_exchange_rate = foreign_currency_usd_exchange_rate - - @property - def gross_profit(self): - """Gets the gross_profit of this Financials. # noqa: E501 - - - :return: The gross_profit of this Financials. # noqa: E501 - :rtype: int - """ - return self._gross_profit - - @gross_profit.setter - def gross_profit(self, gross_profit): - """Sets the gross_profit of this Financials. - - - :param gross_profit: The gross_profit of this Financials. # noqa: E501 - :type: int - """ - - self._gross_profit = gross_profit - - @property - def gross_margin(self): - """Gets the gross_margin of this Financials. # noqa: E501 - - - :return: The gross_margin of this Financials. # noqa: E501 - :rtype: int - """ - return self._gross_margin - - @gross_margin.setter - def gross_margin(self, gross_margin): - """Sets the gross_margin of this Financials. - - - :param gross_margin: The gross_margin of this Financials. # noqa: E501 - :type: int - """ - - self._gross_margin = gross_margin - - @property - def goodwill_and_intangible_assets(self): - """Gets the goodwill_and_intangible_assets of this Financials. # noqa: E501 - - - :return: The goodwill_and_intangible_assets of this Financials. # noqa: E501 - :rtype: int - """ - return self._goodwill_and_intangible_assets - - @goodwill_and_intangible_assets.setter - def goodwill_and_intangible_assets(self, goodwill_and_intangible_assets): - """Sets the goodwill_and_intangible_assets of this Financials. - - - :param goodwill_and_intangible_assets: The goodwill_and_intangible_assets of this Financials. # noqa: E501 - :type: int - """ - - self._goodwill_and_intangible_assets = goodwill_and_intangible_assets - - @property - def interest_expense(self): - """Gets the interest_expense of this Financials. # noqa: E501 - - - :return: The interest_expense of this Financials. # noqa: E501 - :rtype: int - """ - return self._interest_expense - - @interest_expense.setter - def interest_expense(self, interest_expense): - """Sets the interest_expense of this Financials. - - - :param interest_expense: The interest_expense of this Financials. # noqa: E501 - :type: int - """ - - self._interest_expense = interest_expense - - @property - def invested_capital(self): - """Gets the invested_capital of this Financials. # noqa: E501 - - - :return: The invested_capital of this Financials. # noqa: E501 - :rtype: int - """ - return self._invested_capital - - @invested_capital.setter - def invested_capital(self, invested_capital): - """Sets the invested_capital of this Financials. - - - :param invested_capital: The invested_capital of this Financials. # noqa: E501 - :type: int - """ - - self._invested_capital = invested_capital - - @property - def invested_capital_average(self): - """Gets the invested_capital_average of this Financials. # noqa: E501 - - - :return: The invested_capital_average of this Financials. # noqa: E501 - :rtype: int - """ - return self._invested_capital_average - - @invested_capital_average.setter - def invested_capital_average(self, invested_capital_average): - """Sets the invested_capital_average of this Financials. - - - :param invested_capital_average: The invested_capital_average of this Financials. # noqa: E501 - :type: int - """ - - self._invested_capital_average = invested_capital_average - - @property - def inventory(self): - """Gets the inventory of this Financials. # noqa: E501 - - - :return: The inventory of this Financials. # noqa: E501 - :rtype: int - """ - return self._inventory - - @inventory.setter - def inventory(self, inventory): - """Sets the inventory of this Financials. - - - :param inventory: The inventory of this Financials. # noqa: E501 - :type: int - """ - - self._inventory = inventory - - @property - def investments(self): - """Gets the investments of this Financials. # noqa: E501 - - - :return: The investments of this Financials. # noqa: E501 - :rtype: int - """ - return self._investments - - @investments.setter - def investments(self, investments): - """Sets the investments of this Financials. - - - :param investments: The investments of this Financials. # noqa: E501 - :type: int - """ - - self._investments = investments - - @property - def investments_current(self): - """Gets the investments_current of this Financials. # noqa: E501 - - - :return: The investments_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._investments_current - - @investments_current.setter - def investments_current(self, investments_current): - """Sets the investments_current of this Financials. - - - :param investments_current: The investments_current of this Financials. # noqa: E501 - :type: int - """ - - self._investments_current = investments_current - - @property - def investments_non_current(self): - """Gets the investments_non_current of this Financials. # noqa: E501 - - - :return: The investments_non_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._investments_non_current - - @investments_non_current.setter - def investments_non_current(self, investments_non_current): - """Sets the investments_non_current of this Financials. - - - :param investments_non_current: The investments_non_current of this Financials. # noqa: E501 - :type: int - """ - - self._investments_non_current = investments_non_current - - @property - def total_liabilities(self): - """Gets the total_liabilities of this Financials. # noqa: E501 - - - :return: The total_liabilities of this Financials. # noqa: E501 - :rtype: int - """ - return self._total_liabilities - - @total_liabilities.setter - def total_liabilities(self, total_liabilities): - """Sets the total_liabilities of this Financials. - - - :param total_liabilities: The total_liabilities of this Financials. # noqa: E501 - :type: int - """ - - self._total_liabilities = total_liabilities - - @property - def current_liabilities(self): - """Gets the current_liabilities of this Financials. # noqa: E501 - - - :return: The current_liabilities of this Financials. # noqa: E501 - :rtype: int - """ - return self._current_liabilities - - @current_liabilities.setter - def current_liabilities(self, current_liabilities): - """Sets the current_liabilities of this Financials. - - - :param current_liabilities: The current_liabilities of this Financials. # noqa: E501 - :type: int - """ - - self._current_liabilities = current_liabilities - - @property - def liabilities_non_current(self): - """Gets the liabilities_non_current of this Financials. # noqa: E501 - - - :return: The liabilities_non_current of this Financials. # noqa: E501 - :rtype: int - """ - return self._liabilities_non_current - - @liabilities_non_current.setter - def liabilities_non_current(self, liabilities_non_current): - """Sets the liabilities_non_current of this Financials. - - - :param liabilities_non_current: The liabilities_non_current of this Financials. # noqa: E501 - :type: int - """ - - self._liabilities_non_current = liabilities_non_current - - @property - def market_capitalization(self): - """Gets the market_capitalization of this Financials. # noqa: E501 - - - :return: The market_capitalization of this Financials. # noqa: E501 - :rtype: int - """ - return self._market_capitalization - - @market_capitalization.setter - def market_capitalization(self, market_capitalization): - """Sets the market_capitalization of this Financials. - - - :param market_capitalization: The market_capitalization of this Financials. # noqa: E501 - :type: int - """ - - self._market_capitalization = market_capitalization - - @property - def net_cash_flow(self): - """Gets the net_cash_flow of this Financials. # noqa: E501 - - - :return: The net_cash_flow of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow - - @net_cash_flow.setter - def net_cash_flow(self, net_cash_flow): - """Sets the net_cash_flow of this Financials. - - - :param net_cash_flow: The net_cash_flow of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow = net_cash_flow - - @property - def net_cash_flow_business_acquisitions_disposals(self): - """Gets the net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 - - - :return: The net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow_business_acquisitions_disposals - - @net_cash_flow_business_acquisitions_disposals.setter - def net_cash_flow_business_acquisitions_disposals(self, net_cash_flow_business_acquisitions_disposals): - """Sets the net_cash_flow_business_acquisitions_disposals of this Financials. - - - :param net_cash_flow_business_acquisitions_disposals: The net_cash_flow_business_acquisitions_disposals of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow_business_acquisitions_disposals = net_cash_flow_business_acquisitions_disposals - - @property - def issuance_equity_shares(self): - """Gets the issuance_equity_shares of this Financials. # noqa: E501 - - - :return: The issuance_equity_shares of this Financials. # noqa: E501 - :rtype: int - """ - return self._issuance_equity_shares - - @issuance_equity_shares.setter - def issuance_equity_shares(self, issuance_equity_shares): - """Sets the issuance_equity_shares of this Financials. - - - :param issuance_equity_shares: The issuance_equity_shares of this Financials. # noqa: E501 - :type: int - """ - - self._issuance_equity_shares = issuance_equity_shares - - @property - def issuance_debt_securities(self): - """Gets the issuance_debt_securities of this Financials. # noqa: E501 - - - :return: The issuance_debt_securities of this Financials. # noqa: E501 - :rtype: int - """ - return self._issuance_debt_securities - - @issuance_debt_securities.setter - def issuance_debt_securities(self, issuance_debt_securities): - """Sets the issuance_debt_securities of this Financials. - - - :param issuance_debt_securities: The issuance_debt_securities of this Financials. # noqa: E501 - :type: int - """ - - self._issuance_debt_securities = issuance_debt_securities - - @property - def payment_dividends_other_cash_distributions(self): - """Gets the payment_dividends_other_cash_distributions of this Financials. # noqa: E501 - - - :return: The payment_dividends_other_cash_distributions of this Financials. # noqa: E501 - :rtype: int - """ - return self._payment_dividends_other_cash_distributions - - @payment_dividends_other_cash_distributions.setter - def payment_dividends_other_cash_distributions(self, payment_dividends_other_cash_distributions): - """Sets the payment_dividends_other_cash_distributions of this Financials. - - - :param payment_dividends_other_cash_distributions: The payment_dividends_other_cash_distributions of this Financials. # noqa: E501 - :type: int - """ - - self._payment_dividends_other_cash_distributions = payment_dividends_other_cash_distributions - - @property - def net_cash_flow_from_financing(self): - """Gets the net_cash_flow_from_financing of this Financials. # noqa: E501 - - - :return: The net_cash_flow_from_financing of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow_from_financing - - @net_cash_flow_from_financing.setter - def net_cash_flow_from_financing(self, net_cash_flow_from_financing): - """Sets the net_cash_flow_from_financing of this Financials. - - - :param net_cash_flow_from_financing: The net_cash_flow_from_financing of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow_from_financing = net_cash_flow_from_financing - - @property - def net_cash_flow_from_investing(self): - """Gets the net_cash_flow_from_investing of this Financials. # noqa: E501 - - - :return: The net_cash_flow_from_investing of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow_from_investing - - @net_cash_flow_from_investing.setter - def net_cash_flow_from_investing(self, net_cash_flow_from_investing): - """Sets the net_cash_flow_from_investing of this Financials. - - - :param net_cash_flow_from_investing: The net_cash_flow_from_investing of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow_from_investing = net_cash_flow_from_investing - - @property - def net_cash_flow_investment_acquisitions_disposals(self): - """Gets the net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 - - - :return: The net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow_investment_acquisitions_disposals - - @net_cash_flow_investment_acquisitions_disposals.setter - def net_cash_flow_investment_acquisitions_disposals(self, net_cash_flow_investment_acquisitions_disposals): - """Sets the net_cash_flow_investment_acquisitions_disposals of this Financials. - - - :param net_cash_flow_investment_acquisitions_disposals: The net_cash_flow_investment_acquisitions_disposals of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow_investment_acquisitions_disposals = net_cash_flow_investment_acquisitions_disposals - - @property - def net_cash_flow_from_operations(self): - """Gets the net_cash_flow_from_operations of this Financials. # noqa: E501 - - - :return: The net_cash_flow_from_operations of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_cash_flow_from_operations - - @net_cash_flow_from_operations.setter - def net_cash_flow_from_operations(self, net_cash_flow_from_operations): - """Sets the net_cash_flow_from_operations of this Financials. - - - :param net_cash_flow_from_operations: The net_cash_flow_from_operations of this Financials. # noqa: E501 - :type: int - """ - - self._net_cash_flow_from_operations = net_cash_flow_from_operations - - @property - def effect_of_exchange_rate_changes_on_cash(self): - """Gets the effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 - - - :return: The effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 - :rtype: int - """ - return self._effect_of_exchange_rate_changes_on_cash - - @effect_of_exchange_rate_changes_on_cash.setter - def effect_of_exchange_rate_changes_on_cash(self, effect_of_exchange_rate_changes_on_cash): - """Sets the effect_of_exchange_rate_changes_on_cash of this Financials. - - - :param effect_of_exchange_rate_changes_on_cash: The effect_of_exchange_rate_changes_on_cash of this Financials. # noqa: E501 - :type: int - """ - - self._effect_of_exchange_rate_changes_on_cash = effect_of_exchange_rate_changes_on_cash - - @property - def net_income(self): - """Gets the net_income of this Financials. # noqa: E501 - - - :return: The net_income of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_income - - @net_income.setter - def net_income(self, net_income): - """Sets the net_income of this Financials. - - - :param net_income: The net_income of this Financials. # noqa: E501 - :type: int - """ - - self._net_income = net_income - - @property - def net_income_common_stock(self): - """Gets the net_income_common_stock of this Financials. # noqa: E501 - - - :return: The net_income_common_stock of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_income_common_stock - - @net_income_common_stock.setter - def net_income_common_stock(self, net_income_common_stock): - """Sets the net_income_common_stock of this Financials. - - - :param net_income_common_stock: The net_income_common_stock of this Financials. # noqa: E501 - :type: int - """ - - self._net_income_common_stock = net_income_common_stock - - @property - def net_income_common_stock_usd(self): - """Gets the net_income_common_stock_usd of this Financials. # noqa: E501 - - - :return: The net_income_common_stock_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_income_common_stock_usd - - @net_income_common_stock_usd.setter - def net_income_common_stock_usd(self, net_income_common_stock_usd): - """Sets the net_income_common_stock_usd of this Financials. - - - :param net_income_common_stock_usd: The net_income_common_stock_usd of this Financials. # noqa: E501 - :type: int - """ - - self._net_income_common_stock_usd = net_income_common_stock_usd - - @property - def net_loss_income_from_discontinued_operations(self): - """Gets the net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 - - - :return: The net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_loss_income_from_discontinued_operations - - @net_loss_income_from_discontinued_operations.setter - def net_loss_income_from_discontinued_operations(self, net_loss_income_from_discontinued_operations): - """Sets the net_loss_income_from_discontinued_operations of this Financials. - - - :param net_loss_income_from_discontinued_operations: The net_loss_income_from_discontinued_operations of this Financials. # noqa: E501 - :type: int - """ - - self._net_loss_income_from_discontinued_operations = net_loss_income_from_discontinued_operations - - @property - def net_income_to_non_controlling_interests(self): - """Gets the net_income_to_non_controlling_interests of this Financials. # noqa: E501 - - - :return: The net_income_to_non_controlling_interests of this Financials. # noqa: E501 - :rtype: int - """ - return self._net_income_to_non_controlling_interests - - @net_income_to_non_controlling_interests.setter - def net_income_to_non_controlling_interests(self, net_income_to_non_controlling_interests): - """Sets the net_income_to_non_controlling_interests of this Financials. - - - :param net_income_to_non_controlling_interests: The net_income_to_non_controlling_interests of this Financials. # noqa: E501 - :type: int - """ - - self._net_income_to_non_controlling_interests = net_income_to_non_controlling_interests - - @property - def profit_margin(self): - """Gets the profit_margin of this Financials. # noqa: E501 - - - :return: The profit_margin of this Financials. # noqa: E501 - :rtype: int - """ - return self._profit_margin - - @profit_margin.setter - def profit_margin(self, profit_margin): - """Sets the profit_margin of this Financials. - - - :param profit_margin: The profit_margin of this Financials. # noqa: E501 - :type: int - """ - - self._profit_margin = profit_margin - - @property - def operating_expenses(self): - """Gets the operating_expenses of this Financials. # noqa: E501 - - - :return: The operating_expenses of this Financials. # noqa: E501 - :rtype: int - """ - return self._operating_expenses - - @operating_expenses.setter - def operating_expenses(self, operating_expenses): - """Sets the operating_expenses of this Financials. - - - :param operating_expenses: The operating_expenses of this Financials. # noqa: E501 - :type: int - """ - - self._operating_expenses = operating_expenses - - @property - def operating_income(self): - """Gets the operating_income of this Financials. # noqa: E501 - - - :return: The operating_income of this Financials. # noqa: E501 - :rtype: int - """ - return self._operating_income - - @operating_income.setter - def operating_income(self, operating_income): - """Sets the operating_income of this Financials. - - - :param operating_income: The operating_income of this Financials. # noqa: E501 - :type: int - """ - - self._operating_income = operating_income - - @property - def trade_and_non_trade_payables(self): - """Gets the trade_and_non_trade_payables of this Financials. # noqa: E501 - - - :return: The trade_and_non_trade_payables of this Financials. # noqa: E501 - :rtype: int - """ - return self._trade_and_non_trade_payables - - @trade_and_non_trade_payables.setter - def trade_and_non_trade_payables(self, trade_and_non_trade_payables): - """Sets the trade_and_non_trade_payables of this Financials. - - - :param trade_and_non_trade_payables: The trade_and_non_trade_payables of this Financials. # noqa: E501 - :type: int - """ - - self._trade_and_non_trade_payables = trade_and_non_trade_payables - - @property - def payout_ratio(self): - """Gets the payout_ratio of this Financials. # noqa: E501 - - - :return: The payout_ratio of this Financials. # noqa: E501 - :rtype: int - """ - return self._payout_ratio - - @payout_ratio.setter - def payout_ratio(self, payout_ratio): - """Sets the payout_ratio of this Financials. - - - :param payout_ratio: The payout_ratio of this Financials. # noqa: E501 - :type: int - """ - - self._payout_ratio = payout_ratio - - @property - def price_to_book_value(self): - """Gets the price_to_book_value of this Financials. # noqa: E501 - - - :return: The price_to_book_value of this Financials. # noqa: E501 - :rtype: int - """ - return self._price_to_book_value - - @price_to_book_value.setter - def price_to_book_value(self, price_to_book_value): - """Sets the price_to_book_value of this Financials. - - - :param price_to_book_value: The price_to_book_value of this Financials. # noqa: E501 - :type: int - """ - - self._price_to_book_value = price_to_book_value - - @property - def price_earnings(self): - """Gets the price_earnings of this Financials. # noqa: E501 - - - :return: The price_earnings of this Financials. # noqa: E501 - :rtype: int - """ - return self._price_earnings - - @price_earnings.setter - def price_earnings(self, price_earnings): - """Sets the price_earnings of this Financials. - - - :param price_earnings: The price_earnings of this Financials. # noqa: E501 - :type: int - """ - - self._price_earnings = price_earnings - - @property - def price_to_earnings_ratio(self): - """Gets the price_to_earnings_ratio of this Financials. # noqa: E501 - - - :return: The price_to_earnings_ratio of this Financials. # noqa: E501 - :rtype: int - """ - return self._price_to_earnings_ratio - - @price_to_earnings_ratio.setter - def price_to_earnings_ratio(self, price_to_earnings_ratio): - """Sets the price_to_earnings_ratio of this Financials. - - - :param price_to_earnings_ratio: The price_to_earnings_ratio of this Financials. # noqa: E501 - :type: int - """ - - self._price_to_earnings_ratio = price_to_earnings_ratio - - @property - def property_plant_equipment_net(self): - """Gets the property_plant_equipment_net of this Financials. # noqa: E501 - - - :return: The property_plant_equipment_net of this Financials. # noqa: E501 - :rtype: int - """ - return self._property_plant_equipment_net - - @property_plant_equipment_net.setter - def property_plant_equipment_net(self, property_plant_equipment_net): - """Sets the property_plant_equipment_net of this Financials. - - - :param property_plant_equipment_net: The property_plant_equipment_net of this Financials. # noqa: E501 - :type: int - """ - - self._property_plant_equipment_net = property_plant_equipment_net - - @property - def preferred_dividends_income_statement_impact(self): - """Gets the preferred_dividends_income_statement_impact of this Financials. # noqa: E501 - - - :return: The preferred_dividends_income_statement_impact of this Financials. # noqa: E501 - :rtype: int - """ - return self._preferred_dividends_income_statement_impact - - @preferred_dividends_income_statement_impact.setter - def preferred_dividends_income_statement_impact(self, preferred_dividends_income_statement_impact): - """Sets the preferred_dividends_income_statement_impact of this Financials. - - - :param preferred_dividends_income_statement_impact: The preferred_dividends_income_statement_impact of this Financials. # noqa: E501 - :type: int - """ - - self._preferred_dividends_income_statement_impact = preferred_dividends_income_statement_impact - - @property - def share_price_adjusted_close(self): - """Gets the share_price_adjusted_close of this Financials. # noqa: E501 - - - :return: The share_price_adjusted_close of this Financials. # noqa: E501 - :rtype: int - """ - return self._share_price_adjusted_close - - @share_price_adjusted_close.setter - def share_price_adjusted_close(self, share_price_adjusted_close): - """Sets the share_price_adjusted_close of this Financials. - - - :param share_price_adjusted_close: The share_price_adjusted_close of this Financials. # noqa: E501 - :type: int - """ - - self._share_price_adjusted_close = share_price_adjusted_close - - @property - def price_sales(self): - """Gets the price_sales of this Financials. # noqa: E501 - - - :return: The price_sales of this Financials. # noqa: E501 - :rtype: int - """ - return self._price_sales - - @price_sales.setter - def price_sales(self, price_sales): - """Sets the price_sales of this Financials. - - - :param price_sales: The price_sales of this Financials. # noqa: E501 - :type: int - """ - - self._price_sales = price_sales - - @property - def price_to_sales_ratio(self): - """Gets the price_to_sales_ratio of this Financials. # noqa: E501 - - - :return: The price_to_sales_ratio of this Financials. # noqa: E501 - :rtype: int - """ - return self._price_to_sales_ratio - - @price_to_sales_ratio.setter - def price_to_sales_ratio(self, price_to_sales_ratio): - """Sets the price_to_sales_ratio of this Financials. - - - :param price_to_sales_ratio: The price_to_sales_ratio of this Financials. # noqa: E501 - :type: int - """ - - self._price_to_sales_ratio = price_to_sales_ratio - - @property - def trade_and_non_trade_receivables(self): - """Gets the trade_and_non_trade_receivables of this Financials. # noqa: E501 - - - :return: The trade_and_non_trade_receivables of this Financials. # noqa: E501 - :rtype: int - """ - return self._trade_and_non_trade_receivables - - @trade_and_non_trade_receivables.setter - def trade_and_non_trade_receivables(self, trade_and_non_trade_receivables): - """Sets the trade_and_non_trade_receivables of this Financials. - - - :param trade_and_non_trade_receivables: The trade_and_non_trade_receivables of this Financials. # noqa: E501 - :type: int - """ - - self._trade_and_non_trade_receivables = trade_and_non_trade_receivables - - @property - def accumulated_retained_earnings_deficit(self): - """Gets the accumulated_retained_earnings_deficit of this Financials. # noqa: E501 - - - :return: The accumulated_retained_earnings_deficit of this Financials. # noqa: E501 - :rtype: int - """ - return self._accumulated_retained_earnings_deficit - - @accumulated_retained_earnings_deficit.setter - def accumulated_retained_earnings_deficit(self, accumulated_retained_earnings_deficit): - """Sets the accumulated_retained_earnings_deficit of this Financials. - - - :param accumulated_retained_earnings_deficit: The accumulated_retained_earnings_deficit of this Financials. # noqa: E501 - :type: int - """ - - self._accumulated_retained_earnings_deficit = accumulated_retained_earnings_deficit - - @property - def revenues(self): - """Gets the revenues of this Financials. # noqa: E501 - - - :return: The revenues of this Financials. # noqa: E501 - :rtype: int - """ - return self._revenues - - @revenues.setter - def revenues(self, revenues): - """Sets the revenues of this Financials. - - - :param revenues: The revenues of this Financials. # noqa: E501 - :type: int - """ - - self._revenues = revenues - - @property - def revenues_usd(self): - """Gets the revenues_usd of this Financials. # noqa: E501 - - - :return: The revenues_usd of this Financials. # noqa: E501 - :rtype: int - """ - return self._revenues_usd - - @revenues_usd.setter - def revenues_usd(self, revenues_usd): - """Sets the revenues_usd of this Financials. - - - :param revenues_usd: The revenues_usd of this Financials. # noqa: E501 - :type: int - """ - - self._revenues_usd = revenues_usd - - @property - def research_and_development_expense(self): - """Gets the research_and_development_expense of this Financials. # noqa: E501 - - - :return: The research_and_development_expense of this Financials. # noqa: E501 - :rtype: int - """ - return self._research_and_development_expense - - @research_and_development_expense.setter - def research_and_development_expense(self, research_and_development_expense): - """Sets the research_and_development_expense of this Financials. - - - :param research_and_development_expense: The research_and_development_expense of this Financials. # noqa: E501 - :type: int - """ - - self._research_and_development_expense = research_and_development_expense - - @property - def return_on_average_assets(self): - """Gets the return_on_average_assets of this Financials. # noqa: E501 - - - :return: The return_on_average_assets of this Financials. # noqa: E501 - :rtype: int - """ - return self._return_on_average_assets - - @return_on_average_assets.setter - def return_on_average_assets(self, return_on_average_assets): - """Sets the return_on_average_assets of this Financials. - - - :param return_on_average_assets: The return_on_average_assets of this Financials. # noqa: E501 - :type: int - """ - - self._return_on_average_assets = return_on_average_assets - - @property - def return_on_average_equity(self): - """Gets the return_on_average_equity of this Financials. # noqa: E501 - - - :return: The return_on_average_equity of this Financials. # noqa: E501 - :rtype: int - """ - return self._return_on_average_equity - - @return_on_average_equity.setter - def return_on_average_equity(self, return_on_average_equity): - """Sets the return_on_average_equity of this Financials. - - - :param return_on_average_equity: The return_on_average_equity of this Financials. # noqa: E501 - :type: int - """ - - self._return_on_average_equity = return_on_average_equity - - @property - def return_on_invested_capital(self): - """Gets the return_on_invested_capital of this Financials. # noqa: E501 - - - :return: The return_on_invested_capital of this Financials. # noqa: E501 - :rtype: int - """ - return self._return_on_invested_capital - - @return_on_invested_capital.setter - def return_on_invested_capital(self, return_on_invested_capital): - """Sets the return_on_invested_capital of this Financials. - - - :param return_on_invested_capital: The return_on_invested_capital of this Financials. # noqa: E501 - :type: int - """ - - self._return_on_invested_capital = return_on_invested_capital - - @property - def return_on_sales(self): - """Gets the return_on_sales of this Financials. # noqa: E501 - - - :return: The return_on_sales of this Financials. # noqa: E501 - :rtype: int - """ - return self._return_on_sales - - @return_on_sales.setter - def return_on_sales(self, return_on_sales): - """Sets the return_on_sales of this Financials. - - - :param return_on_sales: The return_on_sales of this Financials. # noqa: E501 - :type: int - """ - - self._return_on_sales = return_on_sales - - @property - def share_based_compensation(self): - """Gets the share_based_compensation of this Financials. # noqa: E501 - - - :return: The share_based_compensation of this Financials. # noqa: E501 - :rtype: int - """ - return self._share_based_compensation - - @share_based_compensation.setter - def share_based_compensation(self, share_based_compensation): - """Sets the share_based_compensation of this Financials. - - - :param share_based_compensation: The share_based_compensation of this Financials. # noqa: E501 - :type: int - """ - - self._share_based_compensation = share_based_compensation - - @property - def selling_general_and_administrative_expense(self): - """Gets the selling_general_and_administrative_expense of this Financials. # noqa: E501 - - - :return: The selling_general_and_administrative_expense of this Financials. # noqa: E501 - :rtype: int - """ - return self._selling_general_and_administrative_expense - - @selling_general_and_administrative_expense.setter - def selling_general_and_administrative_expense(self, selling_general_and_administrative_expense): - """Sets the selling_general_and_administrative_expense of this Financials. - - - :param selling_general_and_administrative_expense: The selling_general_and_administrative_expense of this Financials. # noqa: E501 - :type: int - """ - - self._selling_general_and_administrative_expense = selling_general_and_administrative_expense - - @property - def share_factor(self): - """Gets the share_factor of this Financials. # noqa: E501 - - - :return: The share_factor of this Financials. # noqa: E501 - :rtype: int - """ - return self._share_factor - - @share_factor.setter - def share_factor(self, share_factor): - """Sets the share_factor of this Financials. - - - :param share_factor: The share_factor of this Financials. # noqa: E501 - :type: int - """ - - self._share_factor = share_factor - - @property - def shares(self): - """Gets the shares of this Financials. # noqa: E501 - - - :return: The shares of this Financials. # noqa: E501 - :rtype: int - """ - return self._shares - - @shares.setter - def shares(self, shares): - """Sets the shares of this Financials. - - - :param shares: The shares of this Financials. # noqa: E501 - :type: int - """ - - self._shares = shares - - @property - def weighted_average_shares(self): - """Gets the weighted_average_shares of this Financials. # noqa: E501 - - - :return: The weighted_average_shares of this Financials. # noqa: E501 - :rtype: int - """ - return self._weighted_average_shares - - @weighted_average_shares.setter - def weighted_average_shares(self, weighted_average_shares): - """Sets the weighted_average_shares of this Financials. - - - :param weighted_average_shares: The weighted_average_shares of this Financials. # noqa: E501 - :type: int - """ - - self._weighted_average_shares = weighted_average_shares - - @property - def weighted_average_shares_diluted(self): - """Gets the weighted_average_shares_diluted of this Financials. # noqa: E501 - - - :return: The weighted_average_shares_diluted of this Financials. # noqa: E501 - :rtype: int - """ - return self._weighted_average_shares_diluted - - @weighted_average_shares_diluted.setter - def weighted_average_shares_diluted(self, weighted_average_shares_diluted): - """Sets the weighted_average_shares_diluted of this Financials. - - - :param weighted_average_shares_diluted: The weighted_average_shares_diluted of this Financials. # noqa: E501 - :type: int - """ - - self._weighted_average_shares_diluted = weighted_average_shares_diluted - - @property - def sales_per_share(self): - """Gets the sales_per_share of this Financials. # noqa: E501 - - - :return: The sales_per_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._sales_per_share - - @sales_per_share.setter - def sales_per_share(self, sales_per_share): - """Sets the sales_per_share of this Financials. - - - :param sales_per_share: The sales_per_share of this Financials. # noqa: E501 - :type: int - """ - - self._sales_per_share = sales_per_share - - @property - def tangible_asset_value(self): - """Gets the tangible_asset_value of this Financials. # noqa: E501 - - - :return: The tangible_asset_value of this Financials. # noqa: E501 - :rtype: int - """ - return self._tangible_asset_value - - @tangible_asset_value.setter - def tangible_asset_value(self, tangible_asset_value): - """Sets the tangible_asset_value of this Financials. - - - :param tangible_asset_value: The tangible_asset_value of this Financials. # noqa: E501 - :type: int - """ - - self._tangible_asset_value = tangible_asset_value - - @property - def tax_assets(self): - """Gets the tax_assets of this Financials. # noqa: E501 - - - :return: The tax_assets of this Financials. # noqa: E501 - :rtype: int - """ - return self._tax_assets - - @tax_assets.setter - def tax_assets(self, tax_assets): - """Sets the tax_assets of this Financials. - - - :param tax_assets: The tax_assets of this Financials. # noqa: E501 - :type: int - """ - - self._tax_assets = tax_assets - - @property - def income_tax_expense(self): - """Gets the income_tax_expense of this Financials. # noqa: E501 - - - :return: The income_tax_expense of this Financials. # noqa: E501 - :rtype: int - """ - return self._income_tax_expense - - @income_tax_expense.setter - def income_tax_expense(self, income_tax_expense): - """Sets the income_tax_expense of this Financials. - - - :param income_tax_expense: The income_tax_expense of this Financials. # noqa: E501 - :type: int - """ - - self._income_tax_expense = income_tax_expense - - @property - def tax_liabilities(self): - """Gets the tax_liabilities of this Financials. # noqa: E501 - - - :return: The tax_liabilities of this Financials. # noqa: E501 - :rtype: int - """ - return self._tax_liabilities - - @tax_liabilities.setter - def tax_liabilities(self, tax_liabilities): - """Sets the tax_liabilities of this Financials. - - - :param tax_liabilities: The tax_liabilities of this Financials. # noqa: E501 - :type: int - """ - - self._tax_liabilities = tax_liabilities - - @property - def tangible_assets_book_value_per_share(self): - """Gets the tangible_assets_book_value_per_share of this Financials. # noqa: E501 - - - :return: The tangible_assets_book_value_per_share of this Financials. # noqa: E501 - :rtype: int - """ - return self._tangible_assets_book_value_per_share - - @tangible_assets_book_value_per_share.setter - def tangible_assets_book_value_per_share(self, tangible_assets_book_value_per_share): - """Sets the tangible_assets_book_value_per_share of this Financials. - - - :param tangible_assets_book_value_per_share: The tangible_assets_book_value_per_share of this Financials. # noqa: E501 - :type: int - """ - - self._tangible_assets_book_value_per_share = tangible_assets_book_value_per_share - - @property - def working_capital(self): - """Gets the working_capital of this Financials. # noqa: E501 - - - :return: The working_capital of this Financials. # noqa: E501 - :rtype: int - """ - return self._working_capital - - @working_capital.setter - def working_capital(self, working_capital): - """Sets the working_capital of this Financials. - - - :param working_capital: The working_capital of this Financials. # noqa: E501 - :type: int - """ - - self._working_capital = working_capital - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Financials, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Financials): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/forex.py b/polygon/rest/models/forex.py deleted file mode 100644 index 22972e3f..00000000 --- a/polygon/rest/models/forex.py +++ /dev/null @@ -1,172 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Forex(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'a': 'int', - 'b': 'int', - 't': 'int' - } - - attribute_map = { - 'a': 'a', - 'b': 'b', - 't': 't' - } - - def __init__(self, a=None, b=None, t=None): # noqa: E501 - """Forex - a model defined in Swagger""" # noqa: E501 - self._a = None - self._b = None - self._t = None - self.discriminator = None - self.a = a - self.b = b - self.t = t - - @property - def a(self): - """Gets the a of this Forex. # noqa: E501 - - Ask price # noqa: E501 - - :return: The a of this Forex. # noqa: E501 - :rtype: int - """ - return self._a - - @a.setter - def a(self, a): - """Sets the a of this Forex. - - Ask price # noqa: E501 - - :param a: The a of this Forex. # noqa: E501 - :type: int - """ - if a is None: - raise ValueError("Invalid value for `a`, must not be `None`") # noqa: E501 - - self._a = a - - @property - def b(self): - """Gets the b of this Forex. # noqa: E501 - - Bid price # noqa: E501 - - :return: The b of this Forex. # noqa: E501 - :rtype: int - """ - return self._b - - @b.setter - def b(self, b): - """Sets the b of this Forex. - - Bid price # noqa: E501 - - :param b: The b of this Forex. # noqa: E501 - :type: int - """ - if b is None: - raise ValueError("Invalid value for `b`, must not be `None`") # noqa: E501 - - self._b = b - - @property - def t(self): - """Gets the t of this Forex. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The t of this Forex. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this Forex. - - Timestamp of this trade # noqa: E501 - - :param t: The t of this Forex. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Forex, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Forex): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/forex_aggregate.py b/polygon/rest/models/forex_aggregate.py deleted file mode 100644 index 76520d90..00000000 --- a/polygon/rest/models/forex_aggregate.py +++ /dev/null @@ -1,259 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class ForexAggregate(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'o': 'int', - 'c': 'int', - 'l': 'int', - 'h': 'int', - 'v': 'int', - 't': 'int' - } - - attribute_map = { - 'o': 'o', - 'c': 'c', - 'l': 'l', - 'h': 'h', - 'v': 'v', - 't': 't' - } - - def __init__(self, o=None, c=None, l=None, h=None, v=None, t=None): # noqa: E501 - """ForexAggregate - a model defined in Swagger""" # noqa: E501 - self._o = None - self._c = None - self._l = None - self._h = None - self._v = None - self._t = None - self.discriminator = None - self.o = o - self.c = c - self.l = l - self.h = h - self.v = v - self.t = t - - @property - def o(self): - """Gets the o of this ForexAggregate. # noqa: E501 - - Open price # noqa: E501 - - :return: The o of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this ForexAggregate. - - Open price # noqa: E501 - - :param o: The o of this ForexAggregate. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def c(self): - """Gets the c of this ForexAggregate. # noqa: E501 - - Close price # noqa: E501 - - :return: The c of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this ForexAggregate. - - Close price # noqa: E501 - - :param c: The c of this ForexAggregate. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def l(self): - """Gets the l of this ForexAggregate. # noqa: E501 - - Low price # noqa: E501 - - :return: The l of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this ForexAggregate. - - Low price # noqa: E501 - - :param l: The l of this ForexAggregate. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def h(self): - """Gets the h of this ForexAggregate. # noqa: E501 - - High price # noqa: E501 - - :return: The h of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this ForexAggregate. - - High price # noqa: E501 - - :param h: The h of this ForexAggregate. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def v(self): - """Gets the v of this ForexAggregate. # noqa: E501 - - Volume of all trades ( Number of bid/asks during this timespan ) # noqa: E501 - - :return: The v of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this ForexAggregate. - - Volume of all trades ( Number of bid/asks during this timespan ) # noqa: E501 - - :param v: The v of this ForexAggregate. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - @property - def t(self): - """Gets the t of this ForexAggregate. # noqa: E501 - - Timestamp of this aggregation # noqa: E501 - - :return: The t of this ForexAggregate. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this ForexAggregate. - - Timestamp of this aggregation # noqa: E501 - - :param t: The t of this ForexAggregate. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ForexAggregate, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ForexAggregate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/forex_snapshot_agg.py b/polygon/rest/models/forex_snapshot_agg.py deleted file mode 100644 index 2ec988aa..00000000 --- a/polygon/rest/models/forex_snapshot_agg.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class ForexSnapshotAgg(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'c': 'int', - 'h': 'int', - 'l': 'int', - 'o': 'int', - 'v': 'int' - } - - attribute_map = { - 'c': 'c', - 'h': 'h', - 'l': 'l', - 'o': 'o', - 'v': 'v' - } - - def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 - """ForexSnapshotAgg - a model defined in Swagger""" # noqa: E501 - self._c = None - self._h = None - self._l = None - self._o = None - self._v = None - self.discriminator = None - self.c = c - self.h = h - self.l = l - self.o = o - self.v = v - - @property - def c(self): - """Gets the c of this ForexSnapshotAgg. # noqa: E501 - - Close price # noqa: E501 - - :return: The c of this ForexSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this ForexSnapshotAgg. - - Close price # noqa: E501 - - :param c: The c of this ForexSnapshotAgg. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def h(self): - """Gets the h of this ForexSnapshotAgg. # noqa: E501 - - High price # noqa: E501 - - :return: The h of this ForexSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this ForexSnapshotAgg. - - High price # noqa: E501 - - :param h: The h of this ForexSnapshotAgg. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def l(self): - """Gets the l of this ForexSnapshotAgg. # noqa: E501 - - Low price # noqa: E501 - - :return: The l of this ForexSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this ForexSnapshotAgg. - - Low price # noqa: E501 - - :param l: The l of this ForexSnapshotAgg. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def o(self): - """Gets the o of this ForexSnapshotAgg. # noqa: E501 - - Open price # noqa: E501 - - :return: The o of this ForexSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this ForexSnapshotAgg. - - Open price # noqa: E501 - - :param o: The o of this ForexSnapshotAgg. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def v(self): - """Gets the v of this ForexSnapshotAgg. # noqa: E501 - - Volume # noqa: E501 - - :return: The v of this ForexSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this ForexSnapshotAgg. - - Volume # noqa: E501 - - :param v: The v of this ForexSnapshotAgg. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ForexSnapshotAgg, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ForexSnapshotAgg): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/forex_snapshot_ticker.py b/polygon/rest/models/forex_snapshot_ticker.py deleted file mode 100644 index ff6589c5..00000000 --- a/polygon/rest/models/forex_snapshot_ticker.py +++ /dev/null @@ -1,309 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class ForexSnapshotTicker(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'day': 'ForexSnapshotAgg', - 'last_trade': 'Forex', - 'min': 'ForexSnapshotAgg', - 'prev_day': 'ForexSnapshotAgg', - 'todays_change': 'int', - 'todays_change_perc': 'int', - 'updated': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'day': 'day', - 'last_trade': 'lastTrade', - 'min': 'min', - 'prev_day': 'prevDay', - 'todays_change': 'todaysChange', - 'todays_change_perc': 'todaysChangePerc', - 'updated': 'updated' - } - - def __init__(self, ticker=None, day=None, last_trade=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 - """ForexSnapshotTicker - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._day = None - self._last_trade = None - self._min = None - self._prev_day = None - self._todays_change = None - self._todays_change_perc = None - self._updated = None - self.discriminator = None - self.ticker = ticker - self.day = day - self.last_trade = last_trade - self.min = min - self.prev_day = prev_day - self.todays_change = todays_change - self.todays_change_perc = todays_change_perc - self.updated = updated - - @property - def ticker(self): - """Gets the ticker of this ForexSnapshotTicker. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The ticker of this ForexSnapshotTicker. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this ForexSnapshotTicker. - - Ticker of the object # noqa: E501 - - :param ticker: The ticker of this ForexSnapshotTicker. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def day(self): - """Gets the day of this ForexSnapshotTicker. # noqa: E501 - - - :return: The day of this ForexSnapshotTicker. # noqa: E501 - :rtype: ForexSnapshotAgg - """ - return self._day - - @day.setter - def day(self, day): - """Sets the day of this ForexSnapshotTicker. - - - :param day: The day of this ForexSnapshotTicker. # noqa: E501 - :type: ForexSnapshotAgg - """ - if day is None: - raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 - - self._day = day - - @property - def last_trade(self): - """Gets the last_trade of this ForexSnapshotTicker. # noqa: E501 - - - :return: The last_trade of this ForexSnapshotTicker. # noqa: E501 - :rtype: Forex - """ - return self._last_trade - - @last_trade.setter - def last_trade(self, last_trade): - """Sets the last_trade of this ForexSnapshotTicker. - - - :param last_trade: The last_trade of this ForexSnapshotTicker. # noqa: E501 - :type: Forex - """ - if last_trade is None: - raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 - - self._last_trade = last_trade - - @property - def min(self): - """Gets the min of this ForexSnapshotTicker. # noqa: E501 - - - :return: The min of this ForexSnapshotTicker. # noqa: E501 - :rtype: ForexSnapshotAgg - """ - return self._min - - @min.setter - def min(self, min): - """Sets the min of this ForexSnapshotTicker. - - - :param min: The min of this ForexSnapshotTicker. # noqa: E501 - :type: ForexSnapshotAgg - """ - if min is None: - raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 - - self._min = min - - @property - def prev_day(self): - """Gets the prev_day of this ForexSnapshotTicker. # noqa: E501 - - - :return: The prev_day of this ForexSnapshotTicker. # noqa: E501 - :rtype: ForexSnapshotAgg - """ - return self._prev_day - - @prev_day.setter - def prev_day(self, prev_day): - """Sets the prev_day of this ForexSnapshotTicker. - - - :param prev_day: The prev_day of this ForexSnapshotTicker. # noqa: E501 - :type: ForexSnapshotAgg - """ - if prev_day is None: - raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 - - self._prev_day = prev_day - - @property - def todays_change(self): - """Gets the todays_change of this ForexSnapshotTicker. # noqa: E501 - - Value of the change from previous day # noqa: E501 - - :return: The todays_change of this ForexSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change - - @todays_change.setter - def todays_change(self, todays_change): - """Sets the todays_change of this ForexSnapshotTicker. - - Value of the change from previous day # noqa: E501 - - :param todays_change: The todays_change of this ForexSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change is None: - raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 - - self._todays_change = todays_change - - @property - def todays_change_perc(self): - """Gets the todays_change_perc of this ForexSnapshotTicker. # noqa: E501 - - Percentage change since previous day # noqa: E501 - - :return: The todays_change_perc of this ForexSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change_perc - - @todays_change_perc.setter - def todays_change_perc(self, todays_change_perc): - """Sets the todays_change_perc of this ForexSnapshotTicker. - - Percentage change since previous day # noqa: E501 - - :param todays_change_perc: The todays_change_perc of this ForexSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change_perc is None: - raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 - - self._todays_change_perc = todays_change_perc - - @property - def updated(self): - """Gets the updated of this ForexSnapshotTicker. # noqa: E501 - - Last Updated timestamp # noqa: E501 - - :return: The updated of this ForexSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this ForexSnapshotTicker. - - Last Updated timestamp # noqa: E501 - - :param updated: The updated of this ForexSnapshotTicker. # noqa: E501 - :type: int - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ForexSnapshotTicker, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ForexSnapshotTicker): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/hist_trade.py b/polygon/rest/models/hist_trade.py deleted file mode 100644 index 64be5402..00000000 --- a/polygon/rest/models/hist_trade.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class HistTrade(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'condition1': 'int', - 'condition2': 'int', - 'condition3': 'int', - 'condition4': 'int', - 'exchange': 'str', - 'price': 'int', - 'size': 'int', - 'timestamp': 'str' - } - - attribute_map = { - 'condition1': 'condition1', - 'condition2': 'condition2', - 'condition3': 'condition3', - 'condition4': 'condition4', - 'exchange': 'exchange', - 'price': 'price', - 'size': 'size', - 'timestamp': 'timestamp' - } - - def __init__(self, condition1=None, condition2=None, condition3=None, condition4=None, exchange=None, price=None, size=None, timestamp=None): # noqa: E501 - """HistTrade - a model defined in Swagger""" # noqa: E501 - self._condition1 = None - self._condition2 = None - self._condition3 = None - self._condition4 = None - self._exchange = None - self._price = None - self._size = None - self._timestamp = None - self.discriminator = None - self.condition1 = condition1 - self.condition2 = condition2 - self.condition3 = condition3 - self.condition4 = condition4 - self.exchange = exchange - self.price = price - self.size = size - self.timestamp = timestamp - - @property - def condition1(self): - """Gets the condition1 of this HistTrade. # noqa: E501 - - Condition 1 of this trade # noqa: E501 - - :return: The condition1 of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._condition1 - - @condition1.setter - def condition1(self, condition1): - """Sets the condition1 of this HistTrade. - - Condition 1 of this trade # noqa: E501 - - :param condition1: The condition1 of this HistTrade. # noqa: E501 - :type: int - """ - if condition1 is None: - raise ValueError("Invalid value for `condition1`, must not be `None`") # noqa: E501 - - self._condition1 = condition1 - - @property - def condition2(self): - """Gets the condition2 of this HistTrade. # noqa: E501 - - Condition 2 of this trade # noqa: E501 - - :return: The condition2 of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._condition2 - - @condition2.setter - def condition2(self, condition2): - """Sets the condition2 of this HistTrade. - - Condition 2 of this trade # noqa: E501 - - :param condition2: The condition2 of this HistTrade. # noqa: E501 - :type: int - """ - if condition2 is None: - raise ValueError("Invalid value for `condition2`, must not be `None`") # noqa: E501 - - self._condition2 = condition2 - - @property - def condition3(self): - """Gets the condition3 of this HistTrade. # noqa: E501 - - Condition 3 of this trade # noqa: E501 - - :return: The condition3 of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._condition3 - - @condition3.setter - def condition3(self, condition3): - """Sets the condition3 of this HistTrade. - - Condition 3 of this trade # noqa: E501 - - :param condition3: The condition3 of this HistTrade. # noqa: E501 - :type: int - """ - if condition3 is None: - raise ValueError("Invalid value for `condition3`, must not be `None`") # noqa: E501 - - self._condition3 = condition3 - - @property - def condition4(self): - """Gets the condition4 of this HistTrade. # noqa: E501 - - Condition 4 of this trade # noqa: E501 - - :return: The condition4 of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._condition4 - - @condition4.setter - def condition4(self, condition4): - """Sets the condition4 of this HistTrade. - - Condition 4 of this trade # noqa: E501 - - :param condition4: The condition4 of this HistTrade. # noqa: E501 - :type: int - """ - if condition4 is None: - raise ValueError("Invalid value for `condition4`, must not be `None`") # noqa: E501 - - self._condition4 = condition4 - - @property - def exchange(self): - """Gets the exchange of this HistTrade. # noqa: E501 - - The exchange this trade happened on # noqa: E501 - - :return: The exchange of this HistTrade. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this HistTrade. - - The exchange this trade happened on # noqa: E501 - - :param exchange: The exchange of this HistTrade. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def price(self): - """Gets the price of this HistTrade. # noqa: E501 - - Price of the trade # noqa: E501 - - :return: The price of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this HistTrade. - - Price of the trade # noqa: E501 - - :param price: The price of this HistTrade. # noqa: E501 - :type: int - """ - if price is None: - raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 - - self._price = price - - @property - def size(self): - """Gets the size of this HistTrade. # noqa: E501 - - Size of the trade # noqa: E501 - - :return: The size of this HistTrade. # noqa: E501 - :rtype: int - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this HistTrade. - - Size of the trade # noqa: E501 - - :param size: The size of this HistTrade. # noqa: E501 - :type: int - """ - if size is None: - raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 - - self._size = size - - @property - def timestamp(self): - """Gets the timestamp of this HistTrade. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this HistTrade. # noqa: E501 - :rtype: str - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this HistTrade. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this HistTrade. # noqa: E501 - :type: str - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(HistTrade, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HistTrade): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/last_forex_quote.py b/polygon/rest/models/last_forex_quote.py deleted file mode 100644 index 962b0f91..00000000 --- a/polygon/rest/models/last_forex_quote.py +++ /dev/null @@ -1,201 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class LastForexQuote(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ask': 'int', - 'bid': 'int', - 'exchange': 'int', - 'timestamp': 'int' - } - - attribute_map = { - 'ask': 'ask', - 'bid': 'bid', - 'exchange': 'exchange', - 'timestamp': 'timestamp' - } - - def __init__(self, ask=None, bid=None, exchange=None, timestamp=None): # noqa: E501 - """LastForexQuote - a model defined in Swagger""" # noqa: E501 - self._ask = None - self._bid = None - self._exchange = None - self._timestamp = None - self.discriminator = None - self.ask = ask - self.bid = bid - self.exchange = exchange - self.timestamp = timestamp - - @property - def ask(self): - """Gets the ask of this LastForexQuote. # noqa: E501 - - Ask Price # noqa: E501 - - :return: The ask of this LastForexQuote. # noqa: E501 - :rtype: int - """ - return self._ask - - @ask.setter - def ask(self, ask): - """Sets the ask of this LastForexQuote. - - Ask Price # noqa: E501 - - :param ask: The ask of this LastForexQuote. # noqa: E501 - :type: int - """ - if ask is None: - raise ValueError("Invalid value for `ask`, must not be `None`") # noqa: E501 - - self._ask = ask - - @property - def bid(self): - """Gets the bid of this LastForexQuote. # noqa: E501 - - Bid Price # noqa: E501 - - :return: The bid of this LastForexQuote. # noqa: E501 - :rtype: int - """ - return self._bid - - @bid.setter - def bid(self, bid): - """Sets the bid of this LastForexQuote. - - Bid Price # noqa: E501 - - :param bid: The bid of this LastForexQuote. # noqa: E501 - :type: int - """ - if bid is None: - raise ValueError("Invalid value for `bid`, must not be `None`") # noqa: E501 - - self._bid = bid - - @property - def exchange(self): - """Gets the exchange of this LastForexQuote. # noqa: E501 - - Exchange this trade happened on # noqa: E501 - - :return: The exchange of this LastForexQuote. # noqa: E501 - :rtype: int - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this LastForexQuote. - - Exchange this trade happened on # noqa: E501 - - :param exchange: The exchange of this LastForexQuote. # noqa: E501 - :type: int - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def timestamp(self): - """Gets the timestamp of this LastForexQuote. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this LastForexQuote. # noqa: E501 - :rtype: int - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this LastForexQuote. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this LastForexQuote. # noqa: E501 - :type: int - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(LastForexQuote, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LastForexQuote): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/last_forex_trade.py b/polygon/rest/models/last_forex_trade.py deleted file mode 100644 index 57eef4b3..00000000 --- a/polygon/rest/models/last_forex_trade.py +++ /dev/null @@ -1,172 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class LastForexTrade(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'price': 'int', - 'exchange': 'int', - 'timestamp': 'int' - } - - attribute_map = { - 'price': 'price', - 'exchange': 'exchange', - 'timestamp': 'timestamp' - } - - def __init__(self, price=None, exchange=None, timestamp=None): # noqa: E501 - """LastForexTrade - a model defined in Swagger""" # noqa: E501 - self._price = None - self._exchange = None - self._timestamp = None - self.discriminator = None - self.price = price - self.exchange = exchange - self.timestamp = timestamp - - @property - def price(self): - """Gets the price of this LastForexTrade. # noqa: E501 - - Price of the trade # noqa: E501 - - :return: The price of this LastForexTrade. # noqa: E501 - :rtype: int - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this LastForexTrade. - - Price of the trade # noqa: E501 - - :param price: The price of this LastForexTrade. # noqa: E501 - :type: int - """ - if price is None: - raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 - - self._price = price - - @property - def exchange(self): - """Gets the exchange of this LastForexTrade. # noqa: E501 - - Exchange this trade happened on # noqa: E501 - - :return: The exchange of this LastForexTrade. # noqa: E501 - :rtype: int - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this LastForexTrade. - - Exchange this trade happened on # noqa: E501 - - :param exchange: The exchange of this LastForexTrade. # noqa: E501 - :type: int - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def timestamp(self): - """Gets the timestamp of this LastForexTrade. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this LastForexTrade. # noqa: E501 - :rtype: int - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this LastForexTrade. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this LastForexTrade. # noqa: E501 - :type: int - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(LastForexTrade, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LastForexTrade): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/last_quote.py b/polygon/rest/models/last_quote.py deleted file mode 100644 index 3b3e1eee..00000000 --- a/polygon/rest/models/last_quote.py +++ /dev/null @@ -1,288 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class LastQuote(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'askprice': 'int', - 'asksize': 'int', - 'askexchange': 'int', - 'bidprice': 'int', - 'bidsize': 'int', - 'bidexchange': 'int', - 'timestamp': 'int' - } - - attribute_map = { - 'askprice': 'askprice', - 'asksize': 'asksize', - 'askexchange': 'askexchange', - 'bidprice': 'bidprice', - 'bidsize': 'bidsize', - 'bidexchange': 'bidexchange', - 'timestamp': 'timestamp' - } - - def __init__(self, askprice=None, asksize=None, askexchange=None, bidprice=None, bidsize=None, bidexchange=None, timestamp=None): # noqa: E501 - """LastQuote - a model defined in Swagger""" # noqa: E501 - self._askprice = None - self._asksize = None - self._askexchange = None - self._bidprice = None - self._bidsize = None - self._bidexchange = None - self._timestamp = None - self.discriminator = None - self.askprice = askprice - self.asksize = asksize - self.askexchange = askexchange - self.bidprice = bidprice - self.bidsize = bidsize - self.bidexchange = bidexchange - self.timestamp = timestamp - - @property - def askprice(self): - """Gets the askprice of this LastQuote. # noqa: E501 - - Ask Price # noqa: E501 - - :return: The askprice of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._askprice - - @askprice.setter - def askprice(self, askprice): - """Sets the askprice of this LastQuote. - - Ask Price # noqa: E501 - - :param askprice: The askprice of this LastQuote. # noqa: E501 - :type: int - """ - if askprice is None: - raise ValueError("Invalid value for `askprice`, must not be `None`") # noqa: E501 - - self._askprice = askprice - - @property - def asksize(self): - """Gets the asksize of this LastQuote. # noqa: E501 - - Ask Size # noqa: E501 - - :return: The asksize of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._asksize - - @asksize.setter - def asksize(self, asksize): - """Sets the asksize of this LastQuote. - - Ask Size # noqa: E501 - - :param asksize: The asksize of this LastQuote. # noqa: E501 - :type: int - """ - if asksize is None: - raise ValueError("Invalid value for `asksize`, must not be `None`") # noqa: E501 - - self._asksize = asksize - - @property - def askexchange(self): - """Gets the askexchange of this LastQuote. # noqa: E501 - - Exchange the ask happened on # noqa: E501 - - :return: The askexchange of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._askexchange - - @askexchange.setter - def askexchange(self, askexchange): - """Sets the askexchange of this LastQuote. - - Exchange the ask happened on # noqa: E501 - - :param askexchange: The askexchange of this LastQuote. # noqa: E501 - :type: int - """ - if askexchange is None: - raise ValueError("Invalid value for `askexchange`, must not be `None`") # noqa: E501 - - self._askexchange = askexchange - - @property - def bidprice(self): - """Gets the bidprice of this LastQuote. # noqa: E501 - - Bid Price # noqa: E501 - - :return: The bidprice of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._bidprice - - @bidprice.setter - def bidprice(self, bidprice): - """Sets the bidprice of this LastQuote. - - Bid Price # noqa: E501 - - :param bidprice: The bidprice of this LastQuote. # noqa: E501 - :type: int - """ - if bidprice is None: - raise ValueError("Invalid value for `bidprice`, must not be `None`") # noqa: E501 - - self._bidprice = bidprice - - @property - def bidsize(self): - """Gets the bidsize of this LastQuote. # noqa: E501 - - Bid Size # noqa: E501 - - :return: The bidsize of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._bidsize - - @bidsize.setter - def bidsize(self, bidsize): - """Sets the bidsize of this LastQuote. - - Bid Size # noqa: E501 - - :param bidsize: The bidsize of this LastQuote. # noqa: E501 - :type: int - """ - if bidsize is None: - raise ValueError("Invalid value for `bidsize`, must not be `None`") # noqa: E501 - - self._bidsize = bidsize - - @property - def bidexchange(self): - """Gets the bidexchange of this LastQuote. # noqa: E501 - - Exchange the bid happened on # noqa: E501 - - :return: The bidexchange of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._bidexchange - - @bidexchange.setter - def bidexchange(self, bidexchange): - """Sets the bidexchange of this LastQuote. - - Exchange the bid happened on # noqa: E501 - - :param bidexchange: The bidexchange of this LastQuote. # noqa: E501 - :type: int - """ - if bidexchange is None: - raise ValueError("Invalid value for `bidexchange`, must not be `None`") # noqa: E501 - - self._bidexchange = bidexchange - - @property - def timestamp(self): - """Gets the timestamp of this LastQuote. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this LastQuote. # noqa: E501 - :rtype: int - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this LastQuote. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this LastQuote. # noqa: E501 - :type: int - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(LastQuote, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LastQuote): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/last_trade.py b/polygon/rest/models/last_trade.py deleted file mode 100644 index 24243c30..00000000 --- a/polygon/rest/models/last_trade.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class LastTrade(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'price': 'int', - 'size': 'int', - 'exchange': 'int', - 'cond1': 'int', - 'cond2': 'int', - 'cond3': 'int', - 'cond4': 'int', - 'timestamp': 'int' - } - - attribute_map = { - 'price': 'price', - 'size': 'size', - 'exchange': 'exchange', - 'cond1': 'cond1', - 'cond2': 'cond2', - 'cond3': 'cond3', - 'cond4': 'cond4', - 'timestamp': 'timestamp' - } - - def __init__(self, price=None, size=None, exchange=None, cond1=None, cond2=None, cond3=None, cond4=None, timestamp=None): # noqa: E501 - """LastTrade - a model defined in Swagger""" # noqa: E501 - self._price = None - self._size = None - self._exchange = None - self._cond1 = None - self._cond2 = None - self._cond3 = None - self._cond4 = None - self._timestamp = None - self.discriminator = None - self.price = price - self.size = size - self.exchange = exchange - self.cond1 = cond1 - self.cond2 = cond2 - self.cond3 = cond3 - self.cond4 = cond4 - self.timestamp = timestamp - - @property - def price(self): - """Gets the price of this LastTrade. # noqa: E501 - - Price of the trade # noqa: E501 - - :return: The price of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this LastTrade. - - Price of the trade # noqa: E501 - - :param price: The price of this LastTrade. # noqa: E501 - :type: int - """ - if price is None: - raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 - - self._price = price - - @property - def size(self): - """Gets the size of this LastTrade. # noqa: E501 - - Size of this trade # noqa: E501 - - :return: The size of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this LastTrade. - - Size of this trade # noqa: E501 - - :param size: The size of this LastTrade. # noqa: E501 - :type: int - """ - if size is None: - raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 - - self._size = size - - @property - def exchange(self): - """Gets the exchange of this LastTrade. # noqa: E501 - - Exchange this trade happened on # noqa: E501 - - :return: The exchange of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this LastTrade. - - Exchange this trade happened on # noqa: E501 - - :param exchange: The exchange of this LastTrade. # noqa: E501 - :type: int - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - - @property - def cond1(self): - """Gets the cond1 of this LastTrade. # noqa: E501 - - Condition 1 of the trade # noqa: E501 - - :return: The cond1 of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._cond1 - - @cond1.setter - def cond1(self, cond1): - """Sets the cond1 of this LastTrade. - - Condition 1 of the trade # noqa: E501 - - :param cond1: The cond1 of this LastTrade. # noqa: E501 - :type: int - """ - if cond1 is None: - raise ValueError("Invalid value for `cond1`, must not be `None`") # noqa: E501 - - self._cond1 = cond1 - - @property - def cond2(self): - """Gets the cond2 of this LastTrade. # noqa: E501 - - Condition 2 of the trade # noqa: E501 - - :return: The cond2 of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._cond2 - - @cond2.setter - def cond2(self, cond2): - """Sets the cond2 of this LastTrade. - - Condition 2 of the trade # noqa: E501 - - :param cond2: The cond2 of this LastTrade. # noqa: E501 - :type: int - """ - if cond2 is None: - raise ValueError("Invalid value for `cond2`, must not be `None`") # noqa: E501 - - self._cond2 = cond2 - - @property - def cond3(self): - """Gets the cond3 of this LastTrade. # noqa: E501 - - Condition 3 of the trade # noqa: E501 - - :return: The cond3 of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._cond3 - - @cond3.setter - def cond3(self, cond3): - """Sets the cond3 of this LastTrade. - - Condition 3 of the trade # noqa: E501 - - :param cond3: The cond3 of this LastTrade. # noqa: E501 - :type: int - """ - if cond3 is None: - raise ValueError("Invalid value for `cond3`, must not be `None`") # noqa: E501 - - self._cond3 = cond3 - - @property - def cond4(self): - """Gets the cond4 of this LastTrade. # noqa: E501 - - Condition 4 of the trade # noqa: E501 - - :return: The cond4 of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._cond4 - - @cond4.setter - def cond4(self, cond4): - """Sets the cond4 of this LastTrade. - - Condition 4 of the trade # noqa: E501 - - :param cond4: The cond4 of this LastTrade. # noqa: E501 - :type: int - """ - if cond4 is None: - raise ValueError("Invalid value for `cond4`, must not be `None`") # noqa: E501 - - self._cond4 = cond4 - - @property - def timestamp(self): - """Gets the timestamp of this LastTrade. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The timestamp of this LastTrade. # noqa: E501 - :rtype: int - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this LastTrade. - - Timestamp of this trade # noqa: E501 - - :param timestamp: The timestamp of this LastTrade. # noqa: E501 - :type: int - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(LastTrade, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LastTrade): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/market_holiday.py b/polygon/rest/models/market_holiday.py deleted file mode 100644 index 97164cf6..00000000 --- a/polygon/rest/models/market_holiday.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class MarketHoliday(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'exchange': 'str', - 'name': 'str', - 'status': 'str', - '_date': 'datetime', - 'open': 'datetime', - 'close': 'datetime' - } - - attribute_map = { - 'exchange': 'exchange', - 'name': 'name', - 'status': 'status', - '_date': 'date', - 'open': 'open', - 'close': 'close' - } - - def __init__(self, exchange=None, name=None, status=None, _date=None, open=None, close=None): # noqa: E501 - """MarketHoliday - a model defined in Swagger""" # noqa: E501 - self._exchange = None - self._name = None - self._status = None - self.__date = None - self._open = None - self._close = None - self.discriminator = None - self.exchange = exchange - self.name = name - self.status = status - self._date = _date - if open is not None: - self.open = open - if close is not None: - self.close = close - - @property - def exchange(self): - """Gets the exchange of this MarketHoliday. # noqa: E501 - - Which market this record is for # noqa: E501 - - :return: The exchange of this MarketHoliday. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this MarketHoliday. - - Which market this record is for # noqa: E501 - - :param exchange: The exchange of this MarketHoliday. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - allowed_values = ["NYSE", "NASDAQ", "OTC"] # noqa: E501 - if exchange not in allowed_values: - raise ValueError( - "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 - .format(exchange, allowed_values) - ) - - self._exchange = exchange - - @property - def name(self): - """Gets the name of this MarketHoliday. # noqa: E501 - - Human readable description of the holiday # noqa: E501 - - :return: The name of this MarketHoliday. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this MarketHoliday. - - Human readable description of the holiday # noqa: E501 - - :param name: The name of this MarketHoliday. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def status(self): - """Gets the status of this MarketHoliday. # noqa: E501 - - Status of the market on this holiday # noqa: E501 - - :return: The status of this MarketHoliday. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this MarketHoliday. - - Status of the market on this holiday # noqa: E501 - - :param status: The status of this MarketHoliday. # noqa: E501 - :type: str - """ - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - allowed_values = ["closed", "early-close", "late-close", "early-open", "late-open"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def _date(self): - """Gets the _date of this MarketHoliday. # noqa: E501 - - Date of this holiday # noqa: E501 - - :return: The _date of this MarketHoliday. # noqa: E501 - :rtype: datetime - """ - return self.__date - - @_date.setter - def _date(self, _date): - """Sets the _date of this MarketHoliday. - - Date of this holiday # noqa: E501 - - :param _date: The _date of this MarketHoliday. # noqa: E501 - :type: datetime - """ - if _date is None: - raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 - - self.__date = _date - - @property - def open(self): - """Gets the open of this MarketHoliday. # noqa: E501 - - Market open time on this holiday ( if it's not closed ) # noqa: E501 - - :return: The open of this MarketHoliday. # noqa: E501 - :rtype: datetime - """ - return self._open - - @open.setter - def open(self, open): - """Sets the open of this MarketHoliday. - - Market open time on this holiday ( if it's not closed ) # noqa: E501 - - :param open: The open of this MarketHoliday. # noqa: E501 - :type: datetime - """ - - self._open = open - - @property - def close(self): - """Gets the close of this MarketHoliday. # noqa: E501 - - Market close time on this holiday ( if it's not closed ) # noqa: E501 - - :return: The close of this MarketHoliday. # noqa: E501 - :rtype: datetime - """ - return self._close - - @close.setter - def close(self, close): - """Sets the close of this MarketHoliday. - - Market close time on this holiday ( if it's not closed ) # noqa: E501 - - :param close: The close of this MarketHoliday. # noqa: E501 - :type: datetime - """ - - self._close = close - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MarketHoliday, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MarketHoliday): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/market_status.py b/polygon/rest/models/market_status.py deleted file mode 100644 index c10f3f5a..00000000 --- a/polygon/rest/models/market_status.py +++ /dev/null @@ -1,202 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class MarketStatus(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'market': 'str', - 'server_time': 'datetime', - 'exchanges': 'object', - 'currencies': 'object' - } - - attribute_map = { - 'market': 'market', - 'server_time': 'serverTime', - 'exchanges': 'exchanges', - 'currencies': 'currencies' - } - - def __init__(self, market=None, server_time=None, exchanges=None, currencies=None): # noqa: E501 - """MarketStatus - a model defined in Swagger""" # noqa: E501 - self._market = None - self._server_time = None - self._exchanges = None - self._currencies = None - self.discriminator = None - self.market = market - self.server_time = server_time - self.exchanges = exchanges - if currencies is not None: - self.currencies = currencies - - @property - def market(self): - """Gets the market of this MarketStatus. # noqa: E501 - - Status of the market as a whole # noqa: E501 - - :return: The market of this MarketStatus. # noqa: E501 - :rtype: str - """ - return self._market - - @market.setter - def market(self, market): - """Sets the market of this MarketStatus. - - Status of the market as a whole # noqa: E501 - - :param market: The market of this MarketStatus. # noqa: E501 - :type: str - """ - if market is None: - raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 - allowed_values = ["open", "closed", "extended-hours"] # noqa: E501 - if market not in allowed_values: - raise ValueError( - "Invalid value for `market` ({0}), must be one of {1}" # noqa: E501 - .format(market, allowed_values) - ) - - self._market = market - - @property - def server_time(self): - """Gets the server_time of this MarketStatus. # noqa: E501 - - Current time of the server # noqa: E501 - - :return: The server_time of this MarketStatus. # noqa: E501 - :rtype: datetime - """ - return self._server_time - - @server_time.setter - def server_time(self, server_time): - """Sets the server_time of this MarketStatus. - - Current time of the server # noqa: E501 - - :param server_time: The server_time of this MarketStatus. # noqa: E501 - :type: datetime - """ - if server_time is None: - raise ValueError("Invalid value for `server_time`, must not be `None`") # noqa: E501 - - self._server_time = server_time - - @property - def exchanges(self): - """Gets the exchanges of this MarketStatus. # noqa: E501 - - - :return: The exchanges of this MarketStatus. # noqa: E501 - :rtype: object - """ - return self._exchanges - - @exchanges.setter - def exchanges(self, exchanges): - """Sets the exchanges of this MarketStatus. - - - :param exchanges: The exchanges of this MarketStatus. # noqa: E501 - :type: object - """ - if exchanges is None: - raise ValueError("Invalid value for `exchanges`, must not be `None`") # noqa: E501 - - self._exchanges = exchanges - - @property - def currencies(self): - """Gets the currencies of this MarketStatus. # noqa: E501 - - - :return: The currencies of this MarketStatus. # noqa: E501 - :rtype: object - """ - return self._currencies - - @currencies.setter - def currencies(self, currencies): - """Sets the currencies of this MarketStatus. - - - :param currencies: The currencies of this MarketStatus. # noqa: E501 - :type: object - """ - - self._currencies = currencies - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MarketStatus, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MarketStatus): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/news.py b/polygon/rest/models/news.py deleted file mode 100644 index 125fd72c..00000000 --- a/polygon/rest/models/news.py +++ /dev/null @@ -1,311 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class News(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbols': 'list[StockSymbol]', - 'title': 'str', - 'url': 'str', - 'source': 'str', - 'summary': 'str', - 'image': 'str', - 'timestamp': 'datetime', - 'keywords': 'list[object]' - } - - attribute_map = { - 'symbols': 'symbols', - 'title': 'title', - 'url': 'url', - 'source': 'source', - 'summary': 'summary', - 'image': 'image', - 'timestamp': 'timestamp', - 'keywords': 'keywords' - } - - def __init__(self, symbols=None, title=None, url=None, source=None, summary=None, image=None, timestamp=None, keywords=None): # noqa: E501 - """News - a model defined in Swagger""" # noqa: E501 - self._symbols = None - self._title = None - self._url = None - self._source = None - self._summary = None - self._image = None - self._timestamp = None - self._keywords = None - self.discriminator = None - self.symbols = symbols - self.title = title - self.url = url - self.source = source - self.summary = summary - if image is not None: - self.image = image - self.timestamp = timestamp - if keywords is not None: - self.keywords = keywords - - @property - def symbols(self): - """Gets the symbols of this News. # noqa: E501 - - - :return: The symbols of this News. # noqa: E501 - :rtype: list[StockSymbol] - """ - return self._symbols - - @symbols.setter - def symbols(self, symbols): - """Sets the symbols of this News. - - - :param symbols: The symbols of this News. # noqa: E501 - :type: list[StockSymbol] - """ - if symbols is None: - raise ValueError("Invalid value for `symbols`, must not be `None`") # noqa: E501 - - self._symbols = symbols - - @property - def title(self): - """Gets the title of this News. # noqa: E501 - - Name of the article # noqa: E501 - - :return: The title of this News. # noqa: E501 - :rtype: str - """ - return self._title - - @title.setter - def title(self, title): - """Sets the title of this News. - - Name of the article # noqa: E501 - - :param title: The title of this News. # noqa: E501 - :type: str - """ - if title is None: - raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 - - self._title = title - - @property - def url(self): - """Gets the url of this News. # noqa: E501 - - URL of this article # noqa: E501 - - :return: The url of this News. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this News. - - URL of this article # noqa: E501 - - :param url: The url of this News. # noqa: E501 - :type: str - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def source(self): - """Gets the source of this News. # noqa: E501 - - Source of this article # noqa: E501 - - :return: The source of this News. # noqa: E501 - :rtype: str - """ - return self._source - - @source.setter - def source(self, source): - """Sets the source of this News. - - Source of this article # noqa: E501 - - :param source: The source of this News. # noqa: E501 - :type: str - """ - if source is None: - raise ValueError("Invalid value for `source`, must not be `None`") # noqa: E501 - - self._source = source - - @property - def summary(self): - """Gets the summary of this News. # noqa: E501 - - Short summary of the article # noqa: E501 - - :return: The summary of this News. # noqa: E501 - :rtype: str - """ - return self._summary - - @summary.setter - def summary(self, summary): - """Sets the summary of this News. - - Short summary of the article # noqa: E501 - - :param summary: The summary of this News. # noqa: E501 - :type: str - """ - if summary is None: - raise ValueError("Invalid value for `summary`, must not be `None`") # noqa: E501 - - self._summary = summary - - @property - def image(self): - """Gets the image of this News. # noqa: E501 - - URL of the image for this article, if found # noqa: E501 - - :return: The image of this News. # noqa: E501 - :rtype: str - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this News. - - URL of the image for this article, if found # noqa: E501 - - :param image: The image of this News. # noqa: E501 - :type: str - """ - - self._image = image - - @property - def timestamp(self): - """Gets the timestamp of this News. # noqa: E501 - - Timestamp of the article # noqa: E501 - - :return: The timestamp of this News. # noqa: E501 - :rtype: datetime - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this News. - - Timestamp of the article # noqa: E501 - - :param timestamp: The timestamp of this News. # noqa: E501 - :type: datetime - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - @property - def keywords(self): - """Gets the keywords of this News. # noqa: E501 - - - :return: The keywords of this News. # noqa: E501 - :rtype: list[object] - """ - return self._keywords - - @keywords.setter - def keywords(self, keywords): - """Sets the keywords of this News. - - - :param keywords: The keywords of this News. # noqa: E501 - :type: list[object] - """ - - self._keywords = keywords - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(News, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, News): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/not_found.py b/polygon/rest/models/not_found.py deleted file mode 100644 index 7cbb6a0a..00000000 --- a/polygon/rest/models/not_found.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class NotFound(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str' - } - - attribute_map = { - 'message': 'message' - } - - def __init__(self, message=None): # noqa: E501 - """NotFound - a model defined in Swagger""" # noqa: E501 - self._message = None - self.discriminator = None - if message is not None: - self.message = message - - @property - def message(self): - """Gets the message of this NotFound. # noqa: E501 - - - :return: The message of this NotFound. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this NotFound. - - - :param message: The message of this NotFound. # noqa: E501 - :type: str - """ - - self._message = message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(NotFound, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NotFound): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/quote.py b/polygon/rest/models/quote.py deleted file mode 100644 index 00d634cf..00000000 --- a/polygon/rest/models/quote.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Quote(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'c': 'int', - 'b_e': 'str', - 'a_e': 'str', - 'a_p': 'int', - 'b_p': 'int', - 'b_s': 'int', - 'a_s': 'int', - 't': 'int' - } - - attribute_map = { - 'c': 'c', - 'b_e': 'bE', - 'a_e': 'aE', - 'a_p': 'aP', - 'b_p': 'bP', - 'b_s': 'bS', - 'a_s': 'aS', - 't': 't' - } - - def __init__(self, c=None, b_e=None, a_e=None, a_p=None, b_p=None, b_s=None, a_s=None, t=None): # noqa: E501 - """Quote - a model defined in Swagger""" # noqa: E501 - self._c = None - self._b_e = None - self._a_e = None - self._a_p = None - self._b_p = None - self._b_s = None - self._a_s = None - self._t = None - self.discriminator = None - self.c = c - self.b_e = b_e - self.a_e = a_e - self.a_p = a_p - self.b_p = b_p - self.b_s = b_s - self.a_s = a_s - self.t = t - - @property - def c(self): - """Gets the c of this Quote. # noqa: E501 - - Condition of this quote # noqa: E501 - - :return: The c of this Quote. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this Quote. - - Condition of this quote # noqa: E501 - - :param c: The c of this Quote. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def b_e(self): - """Gets the b_e of this Quote. # noqa: E501 - - Bid Exchange # noqa: E501 - - :return: The b_e of this Quote. # noqa: E501 - :rtype: str - """ - return self._b_e - - @b_e.setter - def b_e(self, b_e): - """Sets the b_e of this Quote. - - Bid Exchange # noqa: E501 - - :param b_e: The b_e of this Quote. # noqa: E501 - :type: str - """ - if b_e is None: - raise ValueError("Invalid value for `b_e`, must not be `None`") # noqa: E501 - - self._b_e = b_e - - @property - def a_e(self): - """Gets the a_e of this Quote. # noqa: E501 - - Ask Exchange # noqa: E501 - - :return: The a_e of this Quote. # noqa: E501 - :rtype: str - """ - return self._a_e - - @a_e.setter - def a_e(self, a_e): - """Sets the a_e of this Quote. - - Ask Exchange # noqa: E501 - - :param a_e: The a_e of this Quote. # noqa: E501 - :type: str - """ - if a_e is None: - raise ValueError("Invalid value for `a_e`, must not be `None`") # noqa: E501 - - self._a_e = a_e - - @property - def a_p(self): - """Gets the a_p of this Quote. # noqa: E501 - - Ask Price # noqa: E501 - - :return: The a_p of this Quote. # noqa: E501 - :rtype: int - """ - return self._a_p - - @a_p.setter - def a_p(self, a_p): - """Sets the a_p of this Quote. - - Ask Price # noqa: E501 - - :param a_p: The a_p of this Quote. # noqa: E501 - :type: int - """ - if a_p is None: - raise ValueError("Invalid value for `a_p`, must not be `None`") # noqa: E501 - - self._a_p = a_p - - @property - def b_p(self): - """Gets the b_p of this Quote. # noqa: E501 - - Bid Price # noqa: E501 - - :return: The b_p of this Quote. # noqa: E501 - :rtype: int - """ - return self._b_p - - @b_p.setter - def b_p(self, b_p): - """Sets the b_p of this Quote. - - Bid Price # noqa: E501 - - :param b_p: The b_p of this Quote. # noqa: E501 - :type: int - """ - if b_p is None: - raise ValueError("Invalid value for `b_p`, must not be `None`") # noqa: E501 - - self._b_p = b_p - - @property - def b_s(self): - """Gets the b_s of this Quote. # noqa: E501 - - Bid Size # noqa: E501 - - :return: The b_s of this Quote. # noqa: E501 - :rtype: int - """ - return self._b_s - - @b_s.setter - def b_s(self, b_s): - """Sets the b_s of this Quote. - - Bid Size # noqa: E501 - - :param b_s: The b_s of this Quote. # noqa: E501 - :type: int - """ - if b_s is None: - raise ValueError("Invalid value for `b_s`, must not be `None`") # noqa: E501 - - self._b_s = b_s - - @property - def a_s(self): - """Gets the a_s of this Quote. # noqa: E501 - - Ask Size # noqa: E501 - - :return: The a_s of this Quote. # noqa: E501 - :rtype: int - """ - return self._a_s - - @a_s.setter - def a_s(self, a_s): - """Sets the a_s of this Quote. - - Ask Size # noqa: E501 - - :param a_s: The a_s of this Quote. # noqa: E501 - :type: int - """ - if a_s is None: - raise ValueError("Invalid value for `a_s`, must not be `None`") # noqa: E501 - - self._a_s = a_s - - @property - def t(self): - """Gets the t of this Quote. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The t of this Quote. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this Quote. - - Timestamp of this trade # noqa: E501 - - :param t: The t of this Quote. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Quote, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Quote): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/rating_section.py b/polygon/rest/models/rating_section.py deleted file mode 100644 index 0e3dc7b9..00000000 --- a/polygon/rest/models/rating_section.py +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class RatingSection(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'current': 'float', - 'month1': 'float', - 'month2': 'float', - 'month3': 'float', - 'month4': 'float', - 'month5': 'float' - } - - attribute_map = { - 'current': 'current', - 'month1': 'month1', - 'month2': 'month2', - 'month3': 'month3', - 'month4': 'month4', - 'month5': 'month5' - } - - def __init__(self, current=None, month1=None, month2=None, month3=None, month4=None, month5=None): # noqa: E501 - """RatingSection - a model defined in Swagger""" # noqa: E501 - self._current = None - self._month1 = None - self._month2 = None - self._month3 = None - self._month4 = None - self._month5 = None - self.discriminator = None - self.current = current - self.month1 = month1 - self.month2 = month2 - self.month3 = month3 - if month4 is not None: - self.month4 = month4 - if month5 is not None: - self.month5 = month5 - - @property - def current(self): - """Gets the current of this RatingSection. # noqa: E501 - - Analyst Rating at current month # noqa: E501 - - :return: The current of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._current - - @current.setter - def current(self, current): - """Sets the current of this RatingSection. - - Analyst Rating at current month # noqa: E501 - - :param current: The current of this RatingSection. # noqa: E501 - :type: float - """ - if current is None: - raise ValueError("Invalid value for `current`, must not be `None`") # noqa: E501 - - self._current = current - - @property - def month1(self): - """Gets the month1 of this RatingSection. # noqa: E501 - - Analyst Ratings at 1 month in the future # noqa: E501 - - :return: The month1 of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._month1 - - @month1.setter - def month1(self, month1): - """Sets the month1 of this RatingSection. - - Analyst Ratings at 1 month in the future # noqa: E501 - - :param month1: The month1 of this RatingSection. # noqa: E501 - :type: float - """ - if month1 is None: - raise ValueError("Invalid value for `month1`, must not be `None`") # noqa: E501 - - self._month1 = month1 - - @property - def month2(self): - """Gets the month2 of this RatingSection. # noqa: E501 - - Analyst Ratings at 2 month in the future # noqa: E501 - - :return: The month2 of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._month2 - - @month2.setter - def month2(self, month2): - """Sets the month2 of this RatingSection. - - Analyst Ratings at 2 month in the future # noqa: E501 - - :param month2: The month2 of this RatingSection. # noqa: E501 - :type: float - """ - if month2 is None: - raise ValueError("Invalid value for `month2`, must not be `None`") # noqa: E501 - - self._month2 = month2 - - @property - def month3(self): - """Gets the month3 of this RatingSection. # noqa: E501 - - Analyst Ratings at 3 month in the future # noqa: E501 - - :return: The month3 of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._month3 - - @month3.setter - def month3(self, month3): - """Sets the month3 of this RatingSection. - - Analyst Ratings at 3 month in the future # noqa: E501 - - :param month3: The month3 of this RatingSection. # noqa: E501 - :type: float - """ - if month3 is None: - raise ValueError("Invalid value for `month3`, must not be `None`") # noqa: E501 - - self._month3 = month3 - - @property - def month4(self): - """Gets the month4 of this RatingSection. # noqa: E501 - - Analyst Ratings at 4 month in the future # noqa: E501 - - :return: The month4 of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._month4 - - @month4.setter - def month4(self, month4): - """Sets the month4 of this RatingSection. - - Analyst Ratings at 4 month in the future # noqa: E501 - - :param month4: The month4 of this RatingSection. # noqa: E501 - :type: float - """ - - self._month4 = month4 - - @property - def month5(self): - """Gets the month5 of this RatingSection. # noqa: E501 - - Analyst Ratings at 5 month in the future # noqa: E501 - - :return: The month5 of this RatingSection. # noqa: E501 - :rtype: float - """ - return self._month5 - - @month5.setter - def month5(self, month5): - """Sets the month5 of this RatingSection. - - Analyst Ratings at 5 month in the future # noqa: E501 - - :param month5: The month5 of this RatingSection. # noqa: E501 - :type: float - """ - - self._month5 = month5 - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(RatingSection, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RatingSection): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/split.py b/polygon/rest/models/split.py deleted file mode 100644 index 1261668f..00000000 --- a/polygon/rest/models/split.py +++ /dev/null @@ -1,313 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Split(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'TickerSymbol', - 'ex_date': 'datetime', - 'payment_date': 'datetime', - 'record_date': 'datetime', - 'declared_date': 'datetime', - 'ratio': 'float', - 'tofactor': 'float', - 'forfactor': 'float' - } - - attribute_map = { - 'ticker': 'ticker', - 'ex_date': 'exDate', - 'payment_date': 'paymentDate', - 'record_date': 'recordDate', - 'declared_date': 'declaredDate', - 'ratio': 'ratio', - 'tofactor': 'tofactor', - 'forfactor': 'forfactor' - } - - def __init__(self, ticker=None, ex_date=None, payment_date=None, record_date=None, declared_date=None, ratio=None, tofactor=None, forfactor=None): # noqa: E501 - """Split - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._ex_date = None - self._payment_date = None - self._record_date = None - self._declared_date = None - self._ratio = None - self._tofactor = None - self._forfactor = None - self.discriminator = None - self.ticker = ticker - self.ex_date = ex_date - self.payment_date = payment_date - if record_date is not None: - self.record_date = record_date - if declared_date is not None: - self.declared_date = declared_date - self.ratio = ratio - self.tofactor = tofactor - self.forfactor = forfactor - - @property - def ticker(self): - """Gets the ticker of this Split. # noqa: E501 - - - :return: The ticker of this Split. # noqa: E501 - :rtype: TickerSymbol - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this Split. - - - :param ticker: The ticker of this Split. # noqa: E501 - :type: TickerSymbol - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def ex_date(self): - """Gets the ex_date of this Split. # noqa: E501 - - Execution date of the split # noqa: E501 - - :return: The ex_date of this Split. # noqa: E501 - :rtype: datetime - """ - return self._ex_date - - @ex_date.setter - def ex_date(self, ex_date): - """Sets the ex_date of this Split. - - Execution date of the split # noqa: E501 - - :param ex_date: The ex_date of this Split. # noqa: E501 - :type: datetime - """ - if ex_date is None: - raise ValueError("Invalid value for `ex_date`, must not be `None`") # noqa: E501 - - self._ex_date = ex_date - - @property - def payment_date(self): - """Gets the payment_date of this Split. # noqa: E501 - - Payment date of the split # noqa: E501 - - :return: The payment_date of this Split. # noqa: E501 - :rtype: datetime - """ - return self._payment_date - - @payment_date.setter - def payment_date(self, payment_date): - """Sets the payment_date of this Split. - - Payment date of the split # noqa: E501 - - :param payment_date: The payment_date of this Split. # noqa: E501 - :type: datetime - """ - if payment_date is None: - raise ValueError("Invalid value for `payment_date`, must not be `None`") # noqa: E501 - - self._payment_date = payment_date - - @property - def record_date(self): - """Gets the record_date of this Split. # noqa: E501 - - Payment date of the split # noqa: E501 - - :return: The record_date of this Split. # noqa: E501 - :rtype: datetime - """ - return self._record_date - - @record_date.setter - def record_date(self, record_date): - """Sets the record_date of this Split. - - Payment date of the split # noqa: E501 - - :param record_date: The record_date of this Split. # noqa: E501 - :type: datetime - """ - - self._record_date = record_date - - @property - def declared_date(self): - """Gets the declared_date of this Split. # noqa: E501 - - Payment date of the split # noqa: E501 - - :return: The declared_date of this Split. # noqa: E501 - :rtype: datetime - """ - return self._declared_date - - @declared_date.setter - def declared_date(self, declared_date): - """Sets the declared_date of this Split. - - Payment date of the split # noqa: E501 - - :param declared_date: The declared_date of this Split. # noqa: E501 - :type: datetime - """ - - self._declared_date = declared_date - - @property - def ratio(self): - """Gets the ratio of this Split. # noqa: E501 - - refers to the split ratio. The split ratio is an inverse of the number of shares that a holder of the stock would have after the split divided by the number of shares that the holder had before.
For example: Split ratio of .5 = 2 for 1 split. # noqa: E501 - - :return: The ratio of this Split. # noqa: E501 - :rtype: float - """ - return self._ratio - - @ratio.setter - def ratio(self, ratio): - """Sets the ratio of this Split. - - refers to the split ratio. The split ratio is an inverse of the number of shares that a holder of the stock would have after the split divided by the number of shares that the holder had before.
For example: Split ratio of .5 = 2 for 1 split. # noqa: E501 - - :param ratio: The ratio of this Split. # noqa: E501 - :type: float - """ - if ratio is None: - raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 - - self._ratio = ratio - - @property - def tofactor(self): - """Gets the tofactor of this Split. # noqa: E501 - - To factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 - - :return: The tofactor of this Split. # noqa: E501 - :rtype: float - """ - return self._tofactor - - @tofactor.setter - def tofactor(self, tofactor): - """Sets the tofactor of this Split. - - To factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 - - :param tofactor: The tofactor of this Split. # noqa: E501 - :type: float - """ - if tofactor is None: - raise ValueError("Invalid value for `tofactor`, must not be `None`") # noqa: E501 - - self._tofactor = tofactor - - @property - def forfactor(self): - """Gets the forfactor of this Split. # noqa: E501 - - For factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 - - :return: The forfactor of this Split. # noqa: E501 - :rtype: float - """ - return self._forfactor - - @forfactor.setter - def forfactor(self, forfactor): - """Sets the forfactor of this Split. - - For factor of the split. Used to calculate the split ratio forfactor/tofactor = ratio (eg ½ = 0.5) # noqa: E501 - - :param forfactor: The forfactor of this Split. # noqa: E501 - :type: float - """ - if forfactor is None: - raise ValueError("Invalid value for `forfactor`, must not be `None`") # noqa: E501 - - self._forfactor = forfactor - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Split, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Split): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stock_symbol.py b/polygon/rest/models/stock_symbol.py deleted file mode 100644 index dec75ee1..00000000 --- a/polygon/rest/models/stock_symbol.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StockSymbol(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """StockSymbol - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StockSymbol, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StockSymbol): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_snapshot_agg.py b/polygon/rest/models/stocks_snapshot_agg.py deleted file mode 100644 index b5dff909..00000000 --- a/polygon/rest/models/stocks_snapshot_agg.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksSnapshotAgg(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'c': 'int', - 'h': 'int', - 'l': 'int', - 'o': 'int', - 'v': 'int' - } - - attribute_map = { - 'c': 'c', - 'h': 'h', - 'l': 'l', - 'o': 'o', - 'v': 'v' - } - - def __init__(self, c=None, h=None, l=None, o=None, v=None): # noqa: E501 - """StocksSnapshotAgg - a model defined in Swagger""" # noqa: E501 - self._c = None - self._h = None - self._l = None - self._o = None - self._v = None - self.discriminator = None - self.c = c - self.h = h - self.l = l - self.o = o - self.v = v - - @property - def c(self): - """Gets the c of this StocksSnapshotAgg. # noqa: E501 - - Close price # noqa: E501 - - :return: The c of this StocksSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this StocksSnapshotAgg. - - Close price # noqa: E501 - - :param c: The c of this StocksSnapshotAgg. # noqa: E501 - :type: int - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def h(self): - """Gets the h of this StocksSnapshotAgg. # noqa: E501 - - High price # noqa: E501 - - :return: The h of this StocksSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._h - - @h.setter - def h(self, h): - """Sets the h of this StocksSnapshotAgg. - - High price # noqa: E501 - - :param h: The h of this StocksSnapshotAgg. # noqa: E501 - :type: int - """ - if h is None: - raise ValueError("Invalid value for `h`, must not be `None`") # noqa: E501 - - self._h = h - - @property - def l(self): - """Gets the l of this StocksSnapshotAgg. # noqa: E501 - - Low price # noqa: E501 - - :return: The l of this StocksSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._l - - @l.setter - def l(self, l): - """Sets the l of this StocksSnapshotAgg. - - Low price # noqa: E501 - - :param l: The l of this StocksSnapshotAgg. # noqa: E501 - :type: int - """ - if l is None: - raise ValueError("Invalid value for `l`, must not be `None`") # noqa: E501 - - self._l = l - - @property - def o(self): - """Gets the o of this StocksSnapshotAgg. # noqa: E501 - - Open price # noqa: E501 - - :return: The o of this StocksSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._o - - @o.setter - def o(self, o): - """Sets the o of this StocksSnapshotAgg. - - Open price # noqa: E501 - - :param o: The o of this StocksSnapshotAgg. # noqa: E501 - :type: int - """ - if o is None: - raise ValueError("Invalid value for `o`, must not be `None`") # noqa: E501 - - self._o = o - - @property - def v(self): - """Gets the v of this StocksSnapshotAgg. # noqa: E501 - - Volume # noqa: E501 - - :return: The v of this StocksSnapshotAgg. # noqa: E501 - :rtype: int - """ - return self._v - - @v.setter - def v(self, v): - """Sets the v of this StocksSnapshotAgg. - - Volume # noqa: E501 - - :param v: The v of this StocksSnapshotAgg. # noqa: E501 - :type: int - """ - if v is None: - raise ValueError("Invalid value for `v`, must not be `None`") # noqa: E501 - - self._v = v - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksSnapshotAgg, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksSnapshotAgg): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_snapshot_book_item.py b/polygon/rest/models/stocks_snapshot_book_item.py deleted file mode 100644 index 774eb848..00000000 --- a/polygon/rest/models/stocks_snapshot_book_item.py +++ /dev/null @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksSnapshotBookItem(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'p': 'int', - 'x': 'object' - } - - attribute_map = { - 'p': 'p', - 'x': 'x' - } - - def __init__(self, p=None, x=None): # noqa: E501 - """StocksSnapshotBookItem - a model defined in Swagger""" # noqa: E501 - self._p = None - self._x = None - self.discriminator = None - self.p = p - self.x = x - - @property - def p(self): - """Gets the p of this StocksSnapshotBookItem. # noqa: E501 - - Price of this book level # noqa: E501 - - :return: The p of this StocksSnapshotBookItem. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this StocksSnapshotBookItem. - - Price of this book level # noqa: E501 - - :param p: The p of this StocksSnapshotBookItem. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def x(self): - """Gets the x of this StocksSnapshotBookItem. # noqa: E501 - - Exchange to Size of this price level # noqa: E501 - - :return: The x of this StocksSnapshotBookItem. # noqa: E501 - :rtype: object - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this StocksSnapshotBookItem. - - Exchange to Size of this price level # noqa: E501 - - :param x: The x of this StocksSnapshotBookItem. # noqa: E501 - :type: object - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksSnapshotBookItem, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksSnapshotBookItem): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_snapshot_quote.py b/polygon/rest/models/stocks_snapshot_quote.py deleted file mode 100644 index 5b38e159..00000000 --- a/polygon/rest/models/stocks_snapshot_quote.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksSnapshotQuote(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'p': 'int', - 's': 'int', - 'P': 'int', - 'S': 'int', - 't': 'int' - } - - attribute_map = { - 'p': 'p', - 's': 's', - 'P': 'P', - 'S': 'S', - 't': 't' - } - - def __init__(self, p=None, s=None, P=None, S=None, t=None): # noqa: E501 - """StocksSnapshotQuote - a model defined in Swagger""" # noqa: E501 - self._p = None - self._s = None - self._P = None - self._s = None - self._t = None - self.discriminator = None - self.p = p - self.s = s - self.P = P - self.S = S - self.t = t - - @property - def p(self): - """Gets the p of this StocksSnapshotQuote. # noqa: E501 - - Bid Price # noqa: E501 - - :return: The p of this StocksSnapshotQuote. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this StocksSnapshotQuote. - - Bid Price # noqa: E501 - - :param p: The p of this StocksSnapshotQuote. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def s(self): - """Gets the s of this StocksSnapshotQuote. # noqa: E501 - - Bid size in lots # noqa: E501 - - :return: The s of this StocksSnapshotQuote. # noqa: E501 - :rtype: int - """ - return self._s - - @s.setter - def s(self, s): - """Sets the s of this StocksSnapshotQuote. - - Bid size in lots # noqa: E501 - - :param s: The s of this StocksSnapshotQuote. # noqa: E501 - :type: int - """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 - - self._s = s - - @property - def P(self): - """Gets the P of this StocksSnapshotQuote. # noqa: E501 - - Ask Price # noqa: E501 - - :return: The P of this StocksSnapshotQuote. # noqa: E501 - :rtype: int - """ - return self._P - - @P.setter - def P(self, P): - """Sets the p of this StocksSnapshotQuote. - - Ask Price # noqa: E501 - - :param P: The P of this StocksSnapshotQuote. # noqa: E501 - :type: int - """ - if P is None: - raise ValueError("Invalid value for `P`, must not be `None`") # noqa: E501 - - self._P = P - - @property - def S(self): - """Gets the S of this StocksSnapshotQuote. # noqa: E501 - - Ask size in lots # noqa: E501 - - :return: The S of this StocksSnapshotQuote. # noqa: E501 - :rtype: int - """ - return self._S - - @S.setter - def S(self, S): - """Sets the S of this StocksSnapshotQuote. - - Ask size in lots # noqa: E501 - - :param S: The s of this StocksSnapshotQuote. # noqa: E501 - :type: int - """ - if S is None: - raise ValueError("Invalid value for `S`, must not be `None`") # noqa: E501 - - self._S = S - - @property - def t(self): - """Gets the t of this StocksSnapshotQuote. # noqa: E501 - - Last Updated timestamp ( Nanosecond Timestamp ) # noqa: E501 - - :return: The t of this StocksSnapshotQuote. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this StocksSnapshotQuote. - - Last Updated timestamp ( Nanosecond Timestamp ) # noqa: E501 - - :param t: The t of this StocksSnapshotQuote. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksSnapshotQuote, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksSnapshotQuote): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_snapshot_ticker.py b/polygon/rest/models/stocks_snapshot_ticker.py deleted file mode 100644 index 773ecb0e..00000000 --- a/polygon/rest/models/stocks_snapshot_ticker.py +++ /dev/null @@ -1,335 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksSnapshotTicker(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'day': 'StocksSnapshotAgg', - 'last_trade': 'Trade', - 'last_quote': 'StocksSnapshotQuote', - 'min': 'StocksSnapshotAgg', - 'prev_day': 'StocksSnapshotAgg', - 'todays_change': 'int', - 'todays_change_perc': 'int', - 'updated': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'day': 'day', - 'last_trade': 'lastTrade', - 'last_quote': 'lastQuote', - 'min': 'min', - 'prev_day': 'prevDay', - 'todays_change': 'todaysChange', - 'todays_change_perc': 'todaysChangePerc', - 'updated': 'updated' - } - - def __init__(self, ticker=None, day=None, last_trade=None, last_quote=None, min=None, prev_day=None, todays_change=None, todays_change_perc=None, updated=None): # noqa: E501 - """StocksSnapshotTicker - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._day = None - self._last_trade = None - self._last_quote = None - self._min = None - self._prev_day = None - self._todays_change = None - self._todays_change_perc = None - self._updated = None - self.discriminator = None - self.ticker = ticker - self.day = day - self.last_trade = last_trade - if last_quote is not None: - self.last_quote = last_quote - self.min = min - self.prev_day = prev_day - self.todays_change = todays_change - self.todays_change_perc = todays_change_perc - self.updated = updated - - @property - def ticker(self): - """Gets the ticker of this StocksSnapshotTicker. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The ticker of this StocksSnapshotTicker. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this StocksSnapshotTicker. - - Ticker of the object # noqa: E501 - - :param ticker: The ticker of this StocksSnapshotTicker. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def day(self): - """Gets the day of this StocksSnapshotTicker. # noqa: E501 - - - :return: The day of this StocksSnapshotTicker. # noqa: E501 - :rtype: StocksSnapshotAgg - """ - return self._day - - @day.setter - def day(self, day): - """Sets the day of this StocksSnapshotTicker. - - - :param day: The day of this StocksSnapshotTicker. # noqa: E501 - :type: StocksSnapshotAgg - """ - if day is None: - raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 - - self._day = day - - @property - def last_trade(self): - """Gets the last_trade of this StocksSnapshotTicker. # noqa: E501 - - - :return: The last_trade of this StocksSnapshotTicker. # noqa: E501 - :rtype: Trade - """ - return self._last_trade - - @last_trade.setter - def last_trade(self, last_trade): - """Sets the last_trade of this StocksSnapshotTicker. - - - :param last_trade: The last_trade of this StocksSnapshotTicker. # noqa: E501 - :type: Trade - """ - if last_trade is None: - raise ValueError("Invalid value for `last_trade`, must not be `None`") # noqa: E501 - - self._last_trade = last_trade - - @property - def last_quote(self): - """Gets the last_quote of this StocksSnapshotTicker. # noqa: E501 - - - :return: The last_quote of this StocksSnapshotTicker. # noqa: E501 - :rtype: StocksSnapshotQuote - """ - return self._last_quote - - @last_quote.setter - def last_quote(self, last_quote): - """Sets the last_quote of this StocksSnapshotTicker. - - - :param last_quote: The last_quote of this StocksSnapshotTicker. # noqa: E501 - :type: StocksSnapshotQuote - """ - - self._last_quote = last_quote - - @property - def min(self): - """Gets the min of this StocksSnapshotTicker. # noqa: E501 - - - :return: The min of this StocksSnapshotTicker. # noqa: E501 - :rtype: StocksSnapshotAgg - """ - return self._min - - @min.setter - def min(self, min): - """Sets the min of this StocksSnapshotTicker. - - - :param min: The min of this StocksSnapshotTicker. # noqa: E501 - :type: StocksSnapshotAgg - """ - if min is None: - raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 - - self._min = min - - @property - def prev_day(self): - """Gets the prev_day of this StocksSnapshotTicker. # noqa: E501 - - - :return: The prev_day of this StocksSnapshotTicker. # noqa: E501 - :rtype: StocksSnapshotAgg - """ - return self._prev_day - - @prev_day.setter - def prev_day(self, prev_day): - """Sets the prev_day of this StocksSnapshotTicker. - - - :param prev_day: The prev_day of this StocksSnapshotTicker. # noqa: E501 - :type: StocksSnapshotAgg - """ - if prev_day is None: - raise ValueError("Invalid value for `prev_day`, must not be `None`") # noqa: E501 - - self._prev_day = prev_day - - @property - def todays_change(self): - """Gets the todays_change of this StocksSnapshotTicker. # noqa: E501 - - Value of the change from previous day # noqa: E501 - - :return: The todays_change of this StocksSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change - - @todays_change.setter - def todays_change(self, todays_change): - """Sets the todays_change of this StocksSnapshotTicker. - - Value of the change from previous day # noqa: E501 - - :param todays_change: The todays_change of this StocksSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change is None: - raise ValueError("Invalid value for `todays_change`, must not be `None`") # noqa: E501 - - self._todays_change = todays_change - - @property - def todays_change_perc(self): - """Gets the todays_change_perc of this StocksSnapshotTicker. # noqa: E501 - - Percentage change since previous day # noqa: E501 - - :return: The todays_change_perc of this StocksSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._todays_change_perc - - @todays_change_perc.setter - def todays_change_perc(self, todays_change_perc): - """Sets the todays_change_perc of this StocksSnapshotTicker. - - Percentage change since previous day # noqa: E501 - - :param todays_change_perc: The todays_change_perc of this StocksSnapshotTicker. # noqa: E501 - :type: int - """ - if todays_change_perc is None: - raise ValueError("Invalid value for `todays_change_perc`, must not be `None`") # noqa: E501 - - self._todays_change_perc = todays_change_perc - - @property - def updated(self): - """Gets the updated of this StocksSnapshotTicker. # noqa: E501 - - Last Updated timestamp # noqa: E501 - - :return: The updated of this StocksSnapshotTicker. # noqa: E501 - :rtype: int - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this StocksSnapshotTicker. - - Last Updated timestamp # noqa: E501 - - :param updated: The updated of this StocksSnapshotTicker. # noqa: E501 - :type: int - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksSnapshotTicker, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksSnapshotTicker): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_snapshot_ticker_book.py b/polygon/rest/models/stocks_snapshot_ticker_book.py deleted file mode 100644 index 3c726b59..00000000 --- a/polygon/rest/models/stocks_snapshot_ticker_book.py +++ /dev/null @@ -1,283 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksSnapshotTickerBook(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'str', - 'bids': 'list[StocksSnapshotBookItem]', - 'asks': 'list[StocksSnapshotBookItem]', - 'bid_count': 'int', - 'ask_count': 'int', - 'spread': 'int', - 'updated': 'int' - } - - attribute_map = { - 'ticker': 'ticker', - 'bids': 'bids', - 'asks': 'asks', - 'bid_count': 'bidCount', - 'ask_count': 'askCount', - 'spread': 'spread', - 'updated': 'updated' - } - - def __init__(self, ticker=None, bids=None, asks=None, bid_count=None, ask_count=None, spread=None, updated=None): # noqa: E501 - """StocksSnapshotTickerBook - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._bids = None - self._asks = None - self._bid_count = None - self._ask_count = None - self._spread = None - self._updated = None - self.discriminator = None - self.ticker = ticker - if bids is not None: - self.bids = bids - if asks is not None: - self.asks = asks - if bid_count is not None: - self.bid_count = bid_count - if ask_count is not None: - self.ask_count = ask_count - if spread is not None: - self.spread = spread - self.updated = updated - - @property - def ticker(self): - """Gets the ticker of this StocksSnapshotTickerBook. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The ticker of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: str - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this StocksSnapshotTickerBook. - - Ticker of the object # noqa: E501 - - :param ticker: The ticker of this StocksSnapshotTickerBook. # noqa: E501 - :type: str - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def bids(self): - """Gets the bids of this StocksSnapshotTickerBook. # noqa: E501 - - Bids # noqa: E501 - - :return: The bids of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: list[StocksSnapshotBookItem] - """ - return self._bids - - @bids.setter - def bids(self, bids): - """Sets the bids of this StocksSnapshotTickerBook. - - Bids # noqa: E501 - - :param bids: The bids of this StocksSnapshotTickerBook. # noqa: E501 - :type: list[StocksSnapshotBookItem] - """ - - self._bids = bids - - @property - def asks(self): - """Gets the asks of this StocksSnapshotTickerBook. # noqa: E501 - - Asks # noqa: E501 - - :return: The asks of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: list[StocksSnapshotBookItem] - """ - return self._asks - - @asks.setter - def asks(self, asks): - """Sets the asks of this StocksSnapshotTickerBook. - - Asks # noqa: E501 - - :param asks: The asks of this StocksSnapshotTickerBook. # noqa: E501 - :type: list[StocksSnapshotBookItem] - """ - - self._asks = asks - - @property - def bid_count(self): - """Gets the bid_count of this StocksSnapshotTickerBook. # noqa: E501 - - Combined total number of bids in the book # noqa: E501 - - :return: The bid_count of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._bid_count - - @bid_count.setter - def bid_count(self, bid_count): - """Sets the bid_count of this StocksSnapshotTickerBook. - - Combined total number of bids in the book # noqa: E501 - - :param bid_count: The bid_count of this StocksSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._bid_count = bid_count - - @property - def ask_count(self): - """Gets the ask_count of this StocksSnapshotTickerBook. # noqa: E501 - - Combined total number of asks in the book # noqa: E501 - - :return: The ask_count of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._ask_count - - @ask_count.setter - def ask_count(self, ask_count): - """Sets the ask_count of this StocksSnapshotTickerBook. - - Combined total number of asks in the book # noqa: E501 - - :param ask_count: The ask_count of this StocksSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._ask_count = ask_count - - @property - def spread(self): - """Gets the spread of this StocksSnapshotTickerBook. # noqa: E501 - - Difference between the best bid and the best ask price accross exchanges # noqa: E501 - - :return: The spread of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._spread - - @spread.setter - def spread(self, spread): - """Sets the spread of this StocksSnapshotTickerBook. - - Difference between the best bid and the best ask price accross exchanges # noqa: E501 - - :param spread: The spread of this StocksSnapshotTickerBook. # noqa: E501 - :type: int - """ - - self._spread = spread - - @property - def updated(self): - """Gets the updated of this StocksSnapshotTickerBook. # noqa: E501 - - Last Updated timestamp # noqa: E501 - - :return: The updated of this StocksSnapshotTickerBook. # noqa: E501 - :rtype: int - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this StocksSnapshotTickerBook. - - Last Updated timestamp # noqa: E501 - - :param updated: The updated of this StocksSnapshotTickerBook. # noqa: E501 - :type: int - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksSnapshotTickerBook, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksSnapshotTickerBook): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_v2_nbbo.py b/polygon/rest/models/stocks_v2_nbbo.py deleted file mode 100644 index 4fe55d36..00000000 --- a/polygon/rest/models/stocks_v2_nbbo.py +++ /dev/null @@ -1,485 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksV2NBBO(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'T': 'str', - 't': 'int', - 'y': 'int', - 'f': 'int', - 'q': 'int', - 'c': 'list[int]', - 'i': 'list[int]', - 'p': 'int', - 'x': 'int', - 's': 'int', - 'P': 'int', - 'X': 'int', - 'S': 'int', - 'z': 'int' - } - - attribute_map = { - 'T': 'T', - 't': 't', - 'y': 'y', - 'f': 'f', - 'q': 'q', - 'c': 'c', - 'i': 'i', - 'p': 'p', - 'x': 'x', - 's': 's', - 'P': 'P', - 'X': 'X', - 'S': 'S', - 'z': 'z' - } - - def __init__(self, T=None, t=None, y=None, f=None, q=None, c=None, i=None, p=None, x=None, s=None, P=None, X=None, S=None, z=None): # noqa: E501 - """StocksV2NBBO - a model defined in Swagger""" # noqa: E501 - self._T = None - self._t = None - self._y = None - self._f = None - self._q = None - self._c = None - self._i = None - self._p = None - self._x = None - self._s = None - self._P = None - self._X = None - self._S = None - self._z = None - self.discriminator = None - if T is not None: - self.T = T - self.t = t - if y is not None: - self.y = y - if f is not None: - self.f = f - self.q = q - if c is not None: - self.c = c - if i is not None: - self.i = i - self.p = p - self.x = x - self.s = s - self.p = p - self.x = x - self.s = s - self.z = z - - @property - def T(self): - """Gets the T of this StocksV2NBBO. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The T of this StocksV2NBBO. # noqa: E501 - :rtype: str - """ - return self._T - @T.setter - def T(self, T): - """Sets the T of this StocksV2NBBO. - - Ticker of the object # noqa: E501 - - :param T: The T of this StocksV2NBBO. # noqa: E501 - :type: str - """ - - self._T = T - - @property - def t(self): - """Gets the t of this StocksV2NBBO. # noqa: E501 - - Nanosecond accuracy SIP Unix Timestamp # noqa: E501 - - :return: The t of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this StocksV2NBBO. - - Nanosecond accuracy SIP Unix Timestamp # noqa: E501 - - :param t: The t of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - @property - def y(self): - """Gets the y of this StocksV2NBBO. # noqa: E501 - - Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 - - :return: The y of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._y - - @y.setter - def y(self, y): - """Sets the y of this StocksV2NBBO. - - Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 - - :param y: The y of this StocksV2NBBO. # noqa: E501 - :type: int - """ - - self._y = y - - @property - def f(self): - """Gets the f of this StocksV2NBBO. # noqa: E501 - - Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 - - :return: The f of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._f - - @f.setter - def f(self, f): - """Sets the f of this StocksV2NBBO. - - Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 - - :param f: The f of this StocksV2NBBO. # noqa: E501 - :type: int - """ - - self._f = f - - @property - def q(self): - """Gets the q of this StocksV2NBBO. # noqa: E501 - - Sequence Number # noqa: E501 - - :return: The q of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._q - - @q.setter - def q(self, q): - """Sets the q of this StocksV2NBBO. - - Sequence Number # noqa: E501 - - :param q: The q of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if q is None: - raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 - - self._q = q - - @property - def c(self): - """Gets the c of this StocksV2NBBO. # noqa: E501 - - Conditions # noqa: E501 - - :return: The c of this StocksV2NBBO. # noqa: E501 - :rtype: list[int] - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this StocksV2NBBO. - - Conditions # noqa: E501 - - :param c: The c of this StocksV2NBBO. # noqa: E501 - :type: list[int] - """ - - self._c = c - - @property - def i(self): - """Gets the i of this StocksV2NBBO. # noqa: E501 - - Indicators # noqa: E501 - - :return: The i of this StocksV2NBBO. # noqa: E501 - :rtype: list[int] - """ - return self._i - - @i.setter - def i(self, i): - """Sets the i of this StocksV2NBBO. - - Indicators # noqa: E501 - - :param i: The i of this StocksV2NBBO. # noqa: E501 - :type: list[int] - """ - - self._i = i - - @property - def p(self): - """Gets the p of this StocksV2NBBO. # noqa: E501 - - BID Price # noqa: E501 - - :return: The p of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this StocksV2NBBO. - - BID Price # noqa: E501 - - :param p: The p of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def x(self): - """Gets the x of this StocksV2NBBO. # noqa: E501 - - BID Exchange ID # noqa: E501 - - :return: The x of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this StocksV2NBBO. - - BID Exchange ID # noqa: E501 - - :param x: The x of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - @property - def s(self): - """Gets the s of this StocksV2NBBO. # noqa: E501 - - BID Size ( In round lots ) # noqa: E501 - - :return: The s of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._s - - @s.setter - def s(self, s): - """Sets the s of this StocksV2NBBO. - - BID Size ( In round lots ) # noqa: E501 - - :param s: The s of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 - - self._s = s - - @property - def P(self): - """Gets the P of this StocksV2NBBO. # noqa: E501 - - ASK Price # noqa: E501 - - :return: The P of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._P - - @P.setter - def P(self, P): - """Sets the P of this StocksV2NBBO. - - ASK Price # noqa: E501 - - :param P: The P of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if P is None: - raise ValueError("Invalid value for `P`, must not be `None`") # noqa: E501 - - self._P = P - - @property - def x(self): - """Gets the x of this StocksV2NBBO. # noqa: E501 - - ASK Exchange ID # noqa: E501 - - :return: The x of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this StocksV2NBBO. - - ASK Exchange ID # noqa: E501 - - :param x: The x of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - @property - def S(self): - """Gets the S of this StocksV2NBBO. # noqa: E501 - - ASK Size ( In round lots ) # noqa: E501 - - :return: The S of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._S - - @S.setter - def S(self, S): - """Sets the S of this StocksV2NBBO. - - ASK Size ( In round lots ) # noqa: E501 - - :param S: The S of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if S is None: - raise ValueError("Invalid value for `S`, must not be `None`") # noqa: E501 - - self._S = S - - @property - def z(self): - """Gets the z of this StocksV2NBBO. # noqa: E501 - - Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 - - :return: The z of this StocksV2NBBO. # noqa: E501 - :rtype: int - """ - return self._z - - @z.setter - def z(self, z): - """Sets the z of this StocksV2NBBO. - - Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 - - :param z: The z of this StocksV2NBBO. # noqa: E501 - :type: int - """ - if z is None: - raise ValueError("Invalid value for `z`, must not be `None`") # noqa: E501 - - self._z = z - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksV2NBBO, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksV2NBBO): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/stocks_v2_trade.py b/polygon/rest/models/stocks_v2_trade.py deleted file mode 100644 index 7ba1c13f..00000000 --- a/polygon/rest/models/stocks_v2_trade.py +++ /dev/null @@ -1,401 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class StocksV2Trade(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'T': 'str', - 't': 'int', - 'y': 'int', - 'f': 'int', - 'q': 'int', - 'i': 'str', - 'x': 'int', - 's': 'int', - 'c': 'list[int]', - 'p': 'int', - 'z': 'int' - } - - attribute_map = { - 'T': 'T', - 't': 't', - 'y': 'y', - 'f': 'f', - 'q': 'q', - 'i': 'i', - 'x': 'x', - 's': 's', - 'c': 'c', - 'p': 'p', - 'z': 'z' - } - - def __init__(self, T=None, t=None, y=None, f=None, q=None, i=None, x=None, s=None, c=None, p=None, z=None): # noqa: E501 - """StocksV2Trade - a model defined in Swagger""" # noqa: E501 - self._T = None - self._t = None - self._y = None - self._f = None - self._q = None - self._i = None - self._x = None - self._s = None - self._c = None - self._p = None - self._z = None - self.discriminator = None - if T is not None: - self.T = T - self.t = t - if y is not None: - self.y = y - if f is not None: - self.f = f - self.q = q - self.i = i - self.x = x - self.s = s - self.c = c - self.p = p - self.z = z - - @property - def T(self): - """Gets the T of this StocksV2Trade. # noqa: E501 - - Ticker of the object # noqa: E501 - - :return: The T of this StocksV2Trade. # noqa: E501 - :rtype: str - """ - return self._T - - @T.setter - def T(self, T): - """Sets the T of this StocksV2Trade. - - Ticker of the object # noqa: E501 - - :param T: The T of this StocksV2Trade. # noqa: E501 - :type: str - """ - - self._T = T - - @property - def t(self): - """Gets the t of this StocksV2Trade. # noqa: E501 - - Nanosecond accuracy SIP Unix Timestamp # noqa: E501 - - :return: The t of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this StocksV2Trade. - - Nanosecond accuracy SIP Unix Timestamp # noqa: E501 - - :param t: The t of this StocksV2Trade. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - @property - def y(self): - """Gets the y of this StocksV2Trade. # noqa: E501 - - Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 - - :return: The y of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._y - - @y.setter - def y(self, y): - """Sets the y of this StocksV2Trade. - - Nanosecond accuracy Participant/Exchange Unix Timestamp # noqa: E501 - - :param y: The y of this StocksV2Trade. # noqa: E501 - :type: int - """ - - self._y = y - - @property - def f(self): - """Gets the f of this StocksV2Trade. # noqa: E501 - - Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 - - :return: The f of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._f - - @f.setter - def f(self, f): - """Sets the f of this StocksV2Trade. - - Nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp # noqa: E501 - - :param f: The f of this StocksV2Trade. # noqa: E501 - :type: int - """ - - self._f = f - - @property - def q(self): - """Gets the q of this StocksV2Trade. # noqa: E501 - - Sequence Number # noqa: E501 - - :return: The q of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._q - - @q.setter - def q(self, q): - """Sets the q of this StocksV2Trade. - - Sequence Number # noqa: E501 - - :param q: The q of this StocksV2Trade. # noqa: E501 - :type: int - """ - if q is None: - raise ValueError("Invalid value for `q`, must not be `None`") # noqa: E501 - - self._q = q - - @property - def i(self): - """Gets the i of this StocksV2Trade. # noqa: E501 - - Trade ID # noqa: E501 - - :return: The i of this StocksV2Trade. # noqa: E501 - :rtype: str - """ - return self._i - - @i.setter - def i(self, i): - """Sets the i of this StocksV2Trade. - - Trade ID # noqa: E501 - - :param i: The i of this StocksV2Trade. # noqa: E501 - :type: str - """ - if i is None: - raise ValueError("Invalid value for `i`, must not be `None`") # noqa: E501 - - self._i = i - - @property - def x(self): - """Gets the x of this StocksV2Trade. # noqa: E501 - - Exchange ID # noqa: E501 - - :return: The x of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this StocksV2Trade. - - Exchange ID # noqa: E501 - - :param x: The x of this StocksV2Trade. # noqa: E501 - :type: int - """ - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - - self._x = x - - @property - def s(self): - """Gets the s of this StocksV2Trade. # noqa: E501 - - Size/Volume of the trade # noqa: E501 - - :return: The s of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._s - - @s.setter - def s(self, s): - """Sets the s of this StocksV2Trade. - - Size/Volume of the trade # noqa: E501 - - :param s: The s of this StocksV2Trade. # noqa: E501 - :type: int - """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 - - self._s = s - - @property - def c(self): - """Gets the c of this StocksV2Trade. # noqa: E501 - - Conditions # noqa: E501 - - :return: The c of this StocksV2Trade. # noqa: E501 - :rtype: list[int] - """ - return self._c - - @c.setter - def c(self, c): - """Sets the c of this StocksV2Trade. - - Conditions # noqa: E501 - - :param c: The c of this StocksV2Trade. # noqa: E501 - :type: list[int] - """ - if c is None: - raise ValueError("Invalid value for `c`, must not be `None`") # noqa: E501 - - self._c = c - - @property - def p(self): - """Gets the p of this StocksV2Trade. # noqa: E501 - - Price of the trade # noqa: E501 - - :return: The p of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this StocksV2Trade. - - Price of the trade # noqa: E501 - - :param p: The p of this StocksV2Trade. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def z(self): - """Gets the z of this StocksV2Trade. # noqa: E501 - - Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 - - :return: The z of this StocksV2Trade. # noqa: E501 - :rtype: int - """ - return self._z - - @z.setter - def z(self, z): - """Sets the z of this StocksV2Trade. - - Tape where trade occured. ( 1,2 = CTA, 3 = UTP ) # noqa: E501 - - :param z: The z of this StocksV2Trade. # noqa: E501 - :type: int - """ - if z is None: - raise ValueError("Invalid value for `z`, must not be `None`") # noqa: E501 - - self._z = z - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(StocksV2Trade, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StocksV2Trade): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/symbol.py b/polygon/rest/models/symbol.py deleted file mode 100644 index 92dfd2d2..00000000 --- a/polygon/rest/models/symbol.py +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Symbol(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'symbol': 'StockSymbol', - 'name': 'str', - 'type': 'str', - 'url': 'str', - 'updated': 'datetime', - 'is_otc': 'bool' - } - - attribute_map = { - 'symbol': 'symbol', - 'name': 'name', - 'type': 'type', - 'url': 'url', - 'updated': 'updated', - 'is_otc': 'isOTC' - } - - def __init__(self, symbol=None, name=None, type=None, url=None, updated=None, is_otc=None): # noqa: E501 - """Symbol - a model defined in Swagger""" # noqa: E501 - self._symbol = None - self._name = None - self._type = None - self._url = None - self._updated = None - self._is_otc = None - self.discriminator = None - self.symbol = symbol - self.name = name - self.type = type - self.url = url - self.updated = updated - self.is_otc = is_otc - - @property - def symbol(self): - """Gets the symbol of this Symbol. # noqa: E501 - - - :return: The symbol of this Symbol. # noqa: E501 - :rtype: StockSymbol - """ - return self._symbol - - @symbol.setter - def symbol(self, symbol): - """Sets the symbol of this Symbol. - - - :param symbol: The symbol of this Symbol. # noqa: E501 - :type: StockSymbol - """ - if symbol is None: - raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - - self._symbol = symbol - - @property - def name(self): - """Gets the name of this Symbol. # noqa: E501 - - Name of the item. # noqa: E501 - - :return: The name of this Symbol. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Symbol. - - Name of the item. # noqa: E501 - - :param name: The name of this Symbol. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def type(self): - """Gets the type of this Symbol. # noqa: E501 - - Type of symbol this is. See symbol types. # noqa: E501 - - :return: The type of this Symbol. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Symbol. - - Type of symbol this is. See symbol types. # noqa: E501 - - :param type: The type of this Symbol. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - - self._type = type - - @property - def url(self): - """Gets the url of this Symbol. # noqa: E501 - - URL of this symbol. Use this to get this symbols endpoints. # noqa: E501 - - :return: The url of this Symbol. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this Symbol. - - URL of this symbol. Use this to get this symbols endpoints. # noqa: E501 - - :param url: The url of this Symbol. # noqa: E501 - :type: str - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def updated(self): - """Gets the updated of this Symbol. # noqa: E501 - - Last time this company record was updated. # noqa: E501 - - :return: The updated of this Symbol. # noqa: E501 - :rtype: datetime - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this Symbol. - - Last time this company record was updated. # noqa: E501 - - :param updated: The updated of this Symbol. # noqa: E501 - :type: datetime - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - @property - def is_otc(self): - """Gets the is_otc of this Symbol. # noqa: E501 - - If the symbol is listed on the OTC Markets. # noqa: E501 - - :return: The is_otc of this Symbol. # noqa: E501 - :rtype: bool - """ - return self._is_otc - - @is_otc.setter - def is_otc(self, is_otc): - """Sets the is_otc of this Symbol. - - If the symbol is listed on the OTC Markets. # noqa: E501 - - :param is_otc: The is_otc of this Symbol. # noqa: E501 - :type: bool - """ - if is_otc is None: - raise ValueError("Invalid value for `is_otc`, must not be `None`") # noqa: E501 - - self._is_otc = is_otc - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Symbol, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Symbol): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/symbol_type_map.py b/polygon/rest/models/symbol_type_map.py deleted file mode 100644 index e0c6f113..00000000 --- a/polygon/rest/models/symbol_type_map.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class SymbolTypeMap(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """SymbolTypeMap - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SymbolTypeMap, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SymbolTypeMap): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/ticker.py b/polygon/rest/models/ticker.py deleted file mode 100644 index f10fa033..00000000 --- a/polygon/rest/models/ticker.py +++ /dev/null @@ -1,396 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Ticker(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ticker': 'StockSymbol', - 'name': 'str', - 'market': 'str', - 'locale': 'str', - 'currency': 'str', - 'active': 'bool', - 'primary_exch': 'str', - 'url': 'str', - 'updated': 'datetime', - 'attrs': 'object', - 'codes': 'object' - } - - attribute_map = { - 'ticker': 'ticker', - 'name': 'name', - 'market': 'market', - 'locale': 'locale', - 'currency': 'currency', - 'active': 'active', - 'primary_exch': 'primaryExch', - 'url': 'url', - 'updated': 'updated', - 'attrs': 'attrs', - 'codes': 'codes' - } - - def __init__(self, ticker=None, name=None, market=None, locale=None, currency=None, active=None, primary_exch=None, url=None, updated=None, attrs=None, codes=None): # noqa: E501 - """Ticker - a model defined in Swagger""" # noqa: E501 - self._ticker = None - self._name = None - self._market = None - self._locale = None - self._currency = None - self._active = None - self._primary_exch = None - self._url = None - self._updated = None - self._attrs = None - self._codes = None - self.discriminator = None - self.ticker = ticker - self.name = name - self.market = market - self.locale = locale - if currency is not None: - self.currency = currency - if active is not None: - self.active = active - if primary_exch is not None: - self.primary_exch = primary_exch - if url is not None: - self.url = url - self.updated = updated - if attrs is not None: - self.attrs = attrs - if codes is not None: - self.codes = codes - - @property - def ticker(self): - """Gets the ticker of this Ticker. # noqa: E501 - - - :return: The ticker of this Ticker. # noqa: E501 - :rtype: StockSymbol - """ - return self._ticker - - @ticker.setter - def ticker(self, ticker): - """Sets the ticker of this Ticker. - - - :param ticker: The ticker of this Ticker. # noqa: E501 - :type: StockSymbol - """ - if ticker is None: - raise ValueError("Invalid value for `ticker`, must not be `None`") # noqa: E501 - - self._ticker = ticker - - @property - def name(self): - """Gets the name of this Ticker. # noqa: E501 - - Name of the item. # noqa: E501 - - :return: The name of this Ticker. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Ticker. - - Name of the item. # noqa: E501 - - :param name: The name of this Ticker. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def market(self): - """Gets the market of this Ticker. # noqa: E501 - - The market in which this ticker participates # noqa: E501 - - :return: The market of this Ticker. # noqa: E501 - :rtype: str - """ - return self._market - - @market.setter - def market(self, market): - """Sets the market of this Ticker. - - The market in which this ticker participates # noqa: E501 - - :param market: The market of this Ticker. # noqa: E501 - :type: str - """ - if market is None: - raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 - - self._market = market - - @property - def locale(self): - """Gets the locale of this Ticker. # noqa: E501 - - Locale of where this ticker is traded # noqa: E501 - - :return: The locale of this Ticker. # noqa: E501 - :rtype: str - """ - return self._locale - - @locale.setter - def locale(self, locale): - """Sets the locale of this Ticker. - - Locale of where this ticker is traded # noqa: E501 - - :param locale: The locale of this Ticker. # noqa: E501 - :type: str - """ - if locale is None: - raise ValueError("Invalid value for `locale`, must not be `None`") # noqa: E501 - - self._locale = locale - - @property - def currency(self): - """Gets the currency of this Ticker. # noqa: E501 - - Currency this ticker is traded in # noqa: E501 - - :return: The currency of this Ticker. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this Ticker. - - Currency this ticker is traded in # noqa: E501 - - :param currency: The currency of this Ticker. # noqa: E501 - :type: str - """ - - self._currency = currency - - @property - def active(self): - """Gets the active of this Ticker. # noqa: E501 - - If the ticker is active. False means the ticker has been delisted # noqa: E501 - - :return: The active of this Ticker. # noqa: E501 - :rtype: bool - """ - return self._active - - @active.setter - def active(self, active): - """Sets the active of this Ticker. - - If the ticker is active. False means the ticker has been delisted # noqa: E501 - - :param active: The active of this Ticker. # noqa: E501 - :type: bool - """ - - self._active = active - - @property - def primary_exch(self): - """Gets the primary_exch of this Ticker. # noqa: E501 - - The listing exchange for this ticker # noqa: E501 - - :return: The primary_exch of this Ticker. # noqa: E501 - :rtype: str - """ - return self._primary_exch - - @primary_exch.setter - def primary_exch(self, primary_exch): - """Sets the primary_exch of this Ticker. - - The listing exchange for this ticker # noqa: E501 - - :param primary_exch: The primary_exch of this Ticker. # noqa: E501 - :type: str - """ - - self._primary_exch = primary_exch - - @property - def url(self): - """Gets the url of this Ticker. # noqa: E501 - - URL of this ticker. Use this to get more information about the ticker. # noqa: E501 - - :return: The url of this Ticker. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this Ticker. - - URL of this ticker. Use this to get more information about the ticker. # noqa: E501 - - :param url: The url of this Ticker. # noqa: E501 - :type: str - """ - - self._url = url - - @property - def updated(self): - """Gets the updated of this Ticker. # noqa: E501 - - Last time this ticker record was updated. # noqa: E501 - - :return: The updated of this Ticker. # noqa: E501 - :rtype: datetime - """ - return self._updated - - @updated.setter - def updated(self, updated): - """Sets the updated of this Ticker. - - Last time this ticker record was updated. # noqa: E501 - - :param updated: The updated of this Ticker. # noqa: E501 - :type: datetime - """ - if updated is None: - raise ValueError("Invalid value for `updated`, must not be `None`") # noqa: E501 - - self._updated = updated - - @property - def attrs(self): - """Gets the attrs of this Ticker. # noqa: E501 - - Additional details about this ticker. No schema. # noqa: E501 - - :return: The attrs of this Ticker. # noqa: E501 - :rtype: object - """ - return self._attrs - - @attrs.setter - def attrs(self, attrs): - """Sets the attrs of this Ticker. - - Additional details about this ticker. No schema. # noqa: E501 - - :param attrs: The attrs of this Ticker. # noqa: E501 - :type: object - """ - - self._attrs = attrs - - @property - def codes(self): - """Gets the codes of this Ticker. # noqa: E501 - - Additional details about this ticker. No schema. # noqa: E501 - - :return: The codes of this Ticker. # noqa: E501 - :rtype: object - """ - return self._codes - - @codes.setter - def codes(self, codes): - """Sets the codes of this Ticker. - - Additional details about this ticker. No schema. # noqa: E501 - - :param codes: The codes of this Ticker. # noqa: E501 - :type: object - """ - - self._codes = codes - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Ticker, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Ticker): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/ticker_symbol.py b/polygon/rest/models/ticker_symbol.py deleted file mode 100644 index 80996ad4..00000000 --- a/polygon/rest/models/ticker_symbol.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class TickerSymbol(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """TickerSymbol - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TickerSymbol, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TickerSymbol): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/trade.py b/polygon/rest/models/trade.py deleted file mode 100644 index b3eab1ea..00000000 --- a/polygon/rest/models/trade.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Trade(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'c1': 'int', - 'c2': 'int', - 'c3': 'int', - 'c4': 'int', - 'e': 'str', - 'p': 'int', - 's': 'int', - 't': 'int' - } - - attribute_map = { - 'c1': 'c1', - 'c2': 'c2', - 'c3': 'c3', - 'c4': 'c4', - 'e': 'e', - 'p': 'p', - 's': 's', - 't': 't' - } - - def __init__(self, c1=None, c2=None, c3=None, c4=None, e=None, p=None, s=None, t=None): # noqa: E501 - """Trade - a model defined in Swagger""" # noqa: E501 - self._c1 = None - self._c2 = None - self._c3 = None - self._c4 = None - self._e = None - self._p = None - self._s = None - self._t = None - self.discriminator = None - self.c1 = c1 - self.c2 = c2 - self.c3 = c3 - self.c4 = c4 - self.e = e - self.p = p - self.s = s - self.t = t - - @property - def c1(self): - """Gets the c1 of this Trade. # noqa: E501 - - Condition 1 of this trade # noqa: E501 - - :return: The c1 of this Trade. # noqa: E501 - :rtype: int - """ - return self._c1 - - @c1.setter - def c1(self, c1): - """Sets the c1 of this Trade. - - Condition 1 of this trade # noqa: E501 - - :param c1: The c1 of this Trade. # noqa: E501 - :type: int - """ - if c1 is None: - raise ValueError("Invalid value for `c1`, must not be `None`") # noqa: E501 - - self._c1 = c1 - - @property - def c2(self): - """Gets the c2 of this Trade. # noqa: E501 - - Condition 2 of this trade # noqa: E501 - - :return: The c2 of this Trade. # noqa: E501 - :rtype: int - """ - return self._c2 - - @c2.setter - def c2(self, c2): - """Sets the c2 of this Trade. - - Condition 2 of this trade # noqa: E501 - - :param c2: The c2 of this Trade. # noqa: E501 - :type: int - """ - if c2 is None: - raise ValueError("Invalid value for `c2`, must not be `None`") # noqa: E501 - - self._c2 = c2 - - @property - def c3(self): - """Gets the c3 of this Trade. # noqa: E501 - - Condition 3 of this trade # noqa: E501 - - :return: The c3 of this Trade. # noqa: E501 - :rtype: int - """ - return self._c3 - - @c3.setter - def c3(self, c3): - """Sets the c3 of this Trade. - - Condition 3 of this trade # noqa: E501 - - :param c3: The c3 of this Trade. # noqa: E501 - :type: int - """ - if c3 is None: - raise ValueError("Invalid value for `c3`, must not be `None`") # noqa: E501 - - self._c3 = c3 - - @property - def c4(self): - """Gets the c4 of this Trade. # noqa: E501 - - Condition 4 of this trade # noqa: E501 - - :return: The c4 of this Trade. # noqa: E501 - :rtype: int - """ - return self._c4 - - @c4.setter - def c4(self, c4): - """Sets the c4 of this Trade. - - Condition 4 of this trade # noqa: E501 - - :param c4: The c4 of this Trade. # noqa: E501 - :type: int - """ - if c4 is None: - raise ValueError("Invalid value for `c4`, must not be `None`") # noqa: E501 - - self._c4 = c4 - - @property - def e(self): - """Gets the e of this Trade. # noqa: E501 - - The exchange this trade happened on # noqa: E501 - - :return: The e of this Trade. # noqa: E501 - :rtype: str - """ - return self._e - - @e.setter - def e(self, e): - """Sets the e of this Trade. - - The exchange this trade happened on # noqa: E501 - - :param e: The e of this Trade. # noqa: E501 - :type: str - """ - if e is None: - raise ValueError("Invalid value for `e`, must not be `None`") # noqa: E501 - - self._e = e - - @property - def p(self): - """Gets the p of this Trade. # noqa: E501 - - Price of the trade # noqa: E501 - - :return: The p of this Trade. # noqa: E501 - :rtype: int - """ - return self._p - - @p.setter - def p(self, p): - """Sets the p of this Trade. - - Price of the trade # noqa: E501 - - :param p: The p of this Trade. # noqa: E501 - :type: int - """ - if p is None: - raise ValueError("Invalid value for `p`, must not be `None`") # noqa: E501 - - self._p = p - - @property - def s(self): - """Gets the s of this Trade. # noqa: E501 - - Size of the trade # noqa: E501 - - :return: The s of this Trade. # noqa: E501 - :rtype: int - """ - return self._s - - @s.setter - def s(self, s): - """Sets the s of this Trade. - - Size of the trade # noqa: E501 - - :param s: The s of this Trade. # noqa: E501 - :type: int - """ - if s is None: - raise ValueError("Invalid value for `s`, must not be `None`") # noqa: E501 - - self._s = s - - @property - def t(self): - """Gets the t of this Trade. # noqa: E501 - - Timestamp of this trade # noqa: E501 - - :return: The t of this Trade. # noqa: E501 - :rtype: int - """ - return self._t - - @t.setter - def t(self, t): - """Sets the t of this Trade. - - Timestamp of this trade # noqa: E501 - - :param t: The t of this Trade. # noqa: E501 - :type: int - """ - if t is None: - raise ValueError("Invalid value for `t`, must not be `None`") # noqa: E501 - - self._t = t - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Trade, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Trade): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/polygon/rest/models/unauthorized.py b/polygon/rest/models/unauthorized.py deleted file mode 100644 index aa2d689a..00000000 --- a/polygon/rest/models/unauthorized.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - - -class Unauthorized(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str' - } - - attribute_map = { - 'message': 'message' - } - - def __init__(self, message=None): # noqa: E501 - """Unauthorized - a model defined in Swagger""" # noqa: E501 - self._message = None - self.discriminator = None - if message is not None: - self.message = message - - @property - def message(self): - """Gets the message of this Unauthorized. # noqa: E501 - - - :return: The message of this Unauthorized. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this Unauthorized. - - - :param message: The message of this Unauthorized. # noqa: E501 - :type: str - """ - - self._message = message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Unauthorized, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Unauthorized): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other From 52bffc5d3ca49a850baa618c6ae898ed9b5e0887 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:46 -0500 Subject: [PATCH 05/16] Added custom generated file --- polygon/rest/rest_client.py | 164 +++++++++++++++++++++++++++++++++--- 1 file changed, 150 insertions(+), 14 deletions(-) diff --git a/polygon/rest/rest_client.py b/polygon/rest/rest_client.py index 8d27e71e..c55a9942 100644 --- a/polygon/rest/rest_client.py +++ b/polygon/rest/rest_client.py @@ -1,32 +1,168 @@ -import logging - import requests class RESTClient: DEFAULT_HOST = "api.polygon.io" - def __init__(self, auth_key: str, debug: bool = False): + def __init__(self, auth_key): self.auth_key = auth_key self.url = "https://" + self.DEFAULT_HOST self._session = requests.Session() self._session.params["apiKey"] = self.auth_key - logging.basicConfig(level=logging.DEBUG if debug else None) - - def tickers(self, **params): + def tickers(self, **query_params): endpoint = f"{self.url}/v2/reference/tickers" - return self._session.get(endpoint, params=params) + return self._session.get(endpoint, params=query_params) - def ticker_types(self, **params): - endpoint = f"{self.url}/v2/references/types" - return self._session.get(endpoint, params=params) + def ticker_types(self, **query_params): + endpoint = f"{self.url}/v2/reference/types" + return self._session.get(endpoint, params=query_params) - def ticker_details(self, symbol, **params): + def ticker_details(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" - return self._session.get(endpoint, params=params) + return self._session.get(endpoint, params=query_params) - def ticker_news(self, symbol, **params): + def ticker_news(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" - return self._session.get(endpoint, params=params) \ No newline at end of file + return self._session.get(endpoint, params=query_params) + + def markets(self, **query_params): + endpoint = f"{self.url}/v2/reference/markets" + return self._session.get(endpoint, params=query_params) + + def locales(self, **query_params): + endpoint = f"{self.url}/v2/reference/locales" + return self._session.get(endpoint, params=query_params) + + def stock_splits(self, symbol, **query_params): + endpoint = f"{self.url}/v2/reference/splits/{symbol}" + return self._session.get(endpoint, params=query_params) + + def stock_dividends(self, symbol, **query_params): + endpoint = f"{self.url}/v2/reference/dividends/{symbol}" + return self._session.get(endpoint, params=query_params) + + def stock_financials(self, symbol, **query_params): + endpoint = f"{self.url}/v2/reference/financials/{symbol}" + return self._session.get(endpoint, params=query_params) + + def market_status(self, **query_params): + endpoint = f"{self.url}/v1/marketstatus/now" + return self._session.get(endpoint, params=query_params) + + def market_holidays(self, **query_params): + endpoint = f"{self.url}/v1/marketstatus/upcoming" + return self._session.get(endpoint, params=query_params) + + def exchanges(self, **query_params): + endpoint = f"{self.url}/v1/meta/exchanges" + return self._session.get(endpoint, params=query_params) + + def historic_trades(self, symbol, date, **query_params): + endpoint = f"{self.url}/v1/historic/trades/{symbol}/{date}" + return self._session.get(endpoint, params=query_params) + + def v2_historic_trades(self, ticker, date, **query_params): + endpoint = f"{self.url}/v2/ticks/stocks/trades/{ticker}/{date}" + return self._session.get(endpoint, params=query_params) + + def historic_quotes(self, symbol, date, **query_params): + endpoint = f"{self.url}/v1/historic/quotes/{symbol}/{date}" + return self._session.get(endpoint, params=query_params) + + def v2_historic_nbbo_quotes(self, ticker, date, **query_params): + endpoint = f"{self.url}/v2/ticks/stocks/nbbo/{ticker}/{date}" + return self._session.get(endpoint, params=query_params) + + def last_trade_for_a_symbol(self, symbol, **query_params): + endpoint = f"{self.url}/v1/last/stocks/{symbol}" + return self._session.get(endpoint, params=query_params) + + def last_quote_for_a_symbol(self, symbol, **query_params): + endpoint = f"{self.url}/v1/last_quote/stocks/{symbol}" + return self._session.get(endpoint, params=query_params) + + def daily_open_close(self, symbol, date, **query_params): + endpoint = f"{self.url}/v1/open-close/{symbol}/{date}" + return self._session.get(endpoint, params=query_params) + + def condition_mappings(self, ticktype, **query_params): + endpoint = f"{self.url}/v1/meta/conditions/{ticktype}" + return self._session.get(endpoint, params=query_params) + + def snapshot_all_tickers(self, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers" + return self._session.get(endpoint, params=query_params) + + def snapshot_single_ticker(self, ticker, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}" + return self._session.get(endpoint, params=query_params) + + def snapshot_gainers_losers(self, direction, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/{direction}" + return self._session.get(endpoint, params=query_params) + + def previous_close(self, ticker, **query_params): + endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" + return self._session.get(endpoint, params=query_params) + + def aggregates(self, ticker, multiplier, timespan, from_, to, **query_params): + endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" + return self._session.get(endpoint, params=query_params) + + def grouped_daily(self, locale, market, date, **query_params): + endpoint = f"{self.url}/v2/aggs/grouped/locale/{locale}/market/{market}/{date}" + return self._session.get(endpoint, params=query_params) + + def historic_forex_ticks(self, from_, to, date, **query_params): + endpoint = f"{self.url}/v1/historic/forex/{from_}/{to}/{date}" + return self._session.get(endpoint, params=query_params) + + def real_time_currency_conversion(self, from_, to, **query_params): + endpoint = f"{self.url}/v1/conversion/{from_}/{to}" + return self._session.get(endpoint, params=query_params) + + def last_quote_for_a_currency_pair(self, from_, to, **query_params): + endpoint = f"{self.url}/v1/last_quote/currencies/{from_}/{to}" + return self._session.get(endpoint, params=query_params) + + def snapshot_all_tickers(self, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers" + return self._session.get(endpoint, params=query_params) + + def snapshot_gainers_losers(self, direction, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/{direction}" + return self._session.get(endpoint, params=query_params) + + def crypto_exchanges(self, **query_params): + endpoint = f"{self.url}/v1/meta/crypto-exchanges" + return self._session.get(endpoint, params=query_params) + + def last_trade_for_a_crypto_pair(self, from_, to, **query_params): + endpoint = f"{self.url}/v1/last/crypto/{from_}/{to}" + return self._session.get(endpoint, params=query_params) + + def daily_open_close(self, from_, to, date, **query_params): + endpoint = f"{self.url}/v1/open-close/crypto/{from_}/{to}/{date}" + return self._session.get(endpoint, params=query_params) + + def historic_crypto_trades(self, from_, to, date, **query_params): + endpoint = f"{self.url}/v1/historic/crypto/{from_}/{to}/{date}" + return self._session.get(endpoint, params=query_params) + + def snapshot_all_tickers(self, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers" + return self._session.get(endpoint, params=query_params) + + def snapshot_single_ticker(self, ticker, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}" + return self._session.get(endpoint, params=query_params) + + def snapshot_single_ticker_full_book_l2(self, ticker, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" + return self._session.get(endpoint, params=query_params) + + def snapshot_gainers_losers(self, direction, **query_params): + endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/{direction}" + return self._session.get(endpoint, params=query_params) From 7eb65b793cdc61f5f4d7119849adb5130dc1b360 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:53 -0500 Subject: [PATCH 06/16] Bug fix, forgot to return on_open --- polygon/__init__.py | 2 + polygon/rest/__init__.py | 76 +------------------ polygon/websocket/__init__.py | 1 + .../websocket}/websocket_client.py | 8 +- polygon_client/__init__.py | 1 - requirements.txt | 2 + example.py => websocket-example.py | 0 7 files changed, 12 insertions(+), 78 deletions(-) create mode 100644 polygon/__init__.py create mode 100644 polygon/websocket/__init__.py rename {polygon_client => polygon/websocket}/websocket_client.py (91%) delete mode 100644 polygon_client/__init__.py rename example.py => websocket-example.py (100%) diff --git a/polygon/__init__.py b/polygon/__init__.py new file mode 100644 index 00000000..4287cf1e --- /dev/null +++ b/polygon/__init__.py @@ -0,0 +1,2 @@ +from polygon.websocket import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER +from polygon.rest import RESTClient diff --git a/polygon/rest/__init__.py b/polygon/rest/__init__.py index 0d82df78..afb3193f 100644 --- a/polygon/rest/__init__.py +++ b/polygon/rest/__init__.py @@ -1,75 +1 @@ -# coding: utf-8 - -# flake8: noqa - -""" - Polygon API - - The future of fintech. # noqa: E501 - - OpenAPI spec version: 1.0.1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -# import apis into sdk package -from polygon.rest.api import CryptoApi -from polygon.rest.api import ForexCurrenciesApi -from polygon.rest.api import ReferenceApi -from polygon.rest.api import StocksEquitiesApi -# import ApiClient -from polygon.rest.api_client import ApiClient -from polygon.rest.configuration import Configuration -# import models into sdk package -from polygon.rest.models import AggResponse -from polygon.rest.models import Aggregate -from polygon.rest.models import Aggv2 -from polygon.rest.models import AnalystRatings -from polygon.rest.models import Company -from polygon.rest.models import ConditionTypeMap -from polygon.rest.models import Conflict -from polygon.rest.models import CryptoExchange -from polygon.rest.models import CryptoSnapshotAgg -from polygon.rest.models import CryptoSnapshotBookItem -from polygon.rest.models import CryptoSnapshotTicker -from polygon.rest.models import CryptoSnapshotTickerBook -from polygon.rest.models import CryptoTick -from polygon.rest.models import CryptoTickJson -from polygon.rest.models import Dividend -from polygon.rest.models import Earning -from polygon.rest.models import Error -from polygon.rest.models import Exchange -from polygon.rest.models import Financial -from polygon.rest.models import Financials -from polygon.rest.models import Forex -from polygon.rest.models import ForexAggregate -from polygon.rest.models import ForexSnapshotAgg -from polygon.rest.models import ForexSnapshotTicker -from polygon.rest.models import HistTrade -from polygon.rest.models import LastForexQuote -from polygon.rest.models import LastForexTrade -from polygon.rest.models import LastQuote -from polygon.rest.models import LastTrade -from polygon.rest.models import MarketHoliday -from polygon.rest.models import MarketStatus -from polygon.rest.models import News -from polygon.rest.models import NotFound -from polygon.rest.models import Quote -from polygon.rest.models import RatingSection -from polygon.rest.models import Split -from polygon.rest.models import StockSymbol -from polygon.rest.models import StocksSnapshotAgg -from polygon.rest.models import StocksSnapshotBookItem -from polygon.rest.models import StocksSnapshotQuote -from polygon.rest.models import StocksSnapshotTicker -from polygon.rest.models import StocksSnapshotTickerBook -from polygon.rest.models import StocksV2NBBO -from polygon.rest.models import StocksV2Trade -from polygon.rest.models import Symbol -from polygon.rest.models import SymbolTypeMap -from polygon.rest.models import Ticker -from polygon.rest.models import TickerSymbol -from polygon.rest.models import Trade -from polygon.rest.models import Unauthorized +from .rest_client import RESTClient \ No newline at end of file diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py new file mode 100644 index 00000000..5e22428d --- /dev/null +++ b/polygon/websocket/__init__.py @@ -0,0 +1 @@ +from polygon.websocket.websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER \ No newline at end of file diff --git a/polygon_client/websocket_client.py b/polygon/websocket/websocket_client.py similarity index 91% rename from polygon_client/websocket_client.py rename to polygon/websocket/websocket_client.py index f183dcdf..cb750cbe 100644 --- a/polygon_client/websocket_client.py +++ b/polygon/websocket/websocket_client.py @@ -9,8 +9,8 @@ CRYPTO_CLUSTER = "crypto" -class WebSocketClient(object): - DEFAULT_HOST = 'socket.polygon.io' +class WebSocketClient: + DEFAULT_HOST = "socket.polygon.io" # TODO: Either an instance of the client couples 1:1 with the cluster or an instance of the Client couples 1:3 with # the 3 possible clusters (I think I like client per, but then a problem is the user can make multiple clients for @@ -32,6 +32,9 @@ def __init__(self, cluster: str, auth_key: str, process_message: Optional[Callab # self._run_thread is only set if the client is run asynchronously self._run_thread: Optional[threading.Thread] = None + # TODO: this probably isn't great design. + # If the user defines their own signal handler then this will gets overwritten. + # We still need to make sure that killing, terminating, interrupting the program closes the connection signal.signal(signal.SIGINT, self._cleanup_signal_handler()) signal.signal(signal.SIGTERM, self._cleanup_signal_handler()) @@ -92,6 +95,7 @@ def _default_process_message(message): def _default_on_open(self): def f(ws): self._authenticate(ws) + return f @staticmethod diff --git a/polygon_client/__init__.py b/polygon_client/__init__.py deleted file mode 100644 index a0f9603a..00000000 --- a/polygon_client/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER diff --git a/requirements.txt b/requirements.txt index 491579f3..93fba3fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,9 @@ certifi==2019.9.11 chardet==3.0.4 idna==2.8 multidict==4.5.2 +requests==2.22.0 six==1.12.0 +urllib3==1.25.6 websocket-client==0.56.0 websockets==8.0.2 yarl==1.3.0 diff --git a/example.py b/websocket-example.py similarity index 100% rename from example.py rename to websocket-example.py From e5a2064c4af5ea544743cb5531963b6103feafd0 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:55 -0500 Subject: [PATCH 07/16] better formatting and returns json response --- polygon/rest/__init__.py | 2 +- polygon/rest/rest_client.py | 78 +++++++++++++++++------------------ polygon/websocket/__init__.py | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/polygon/rest/__init__.py b/polygon/rest/__init__.py index afb3193f..d65861a4 100644 --- a/polygon/rest/__init__.py +++ b/polygon/rest/__init__.py @@ -1 +1 @@ -from .rest_client import RESTClient \ No newline at end of file +from .rest_client import RESTClient diff --git a/polygon/rest/rest_client.py b/polygon/rest/rest_client.py index c55a9942..ca23d21b 100644 --- a/polygon/rest/rest_client.py +++ b/polygon/rest/rest_client.py @@ -13,156 +13,156 @@ def __init__(self, auth_key): def tickers(self, **query_params): endpoint = f"{self.url}/v2/reference/tickers" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def ticker_types(self, **query_params): endpoint = f"{self.url}/v2/reference/types" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def ticker_details(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def ticker_news(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def markets(self, **query_params): endpoint = f"{self.url}/v2/reference/markets" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def locales(self, **query_params): endpoint = f"{self.url}/v2/reference/locales" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def stock_splits(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/splits/{symbol}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def stock_dividends(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/dividends/{symbol}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def stock_financials(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/financials/{symbol}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def market_status(self, **query_params): endpoint = f"{self.url}/v1/marketstatus/now" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def market_holidays(self, **query_params): endpoint = f"{self.url}/v1/marketstatus/upcoming" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def exchanges(self, **query_params): endpoint = f"{self.url}/v1/meta/exchanges" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def historic_trades(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/historic/trades/{symbol}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def v2_historic_trades(self, ticker, date, **query_params): endpoint = f"{self.url}/v2/ticks/stocks/trades/{ticker}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def historic_quotes(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/historic/quotes/{symbol}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def v2_historic_nbbo_quotes(self, ticker, date, **query_params): endpoint = f"{self.url}/v2/ticks/stocks/nbbo/{ticker}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def last_trade_for_a_symbol(self, symbol, **query_params): endpoint = f"{self.url}/v1/last/stocks/{symbol}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def last_quote_for_a_symbol(self, symbol, **query_params): endpoint = f"{self.url}/v1/last_quote/stocks/{symbol}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def daily_open_close(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/open-close/{symbol}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def condition_mappings(self, ticktype, **query_params): endpoint = f"{self.url}/v1/meta/conditions/{ticktype}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_single_ticker(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/{direction}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def previous_close(self, ticker, **query_params): endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def aggregates(self, ticker, multiplier, timespan, from_, to, **query_params): endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def grouped_daily(self, locale, market, date, **query_params): endpoint = f"{self.url}/v2/aggs/grouped/locale/{locale}/market/{market}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def historic_forex_ticks(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/historic/forex/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def real_time_currency_conversion(self, from_, to, **query_params): endpoint = f"{self.url}/v1/conversion/{from_}/{to}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def last_quote_for_a_currency_pair(self, from_, to, **query_params): endpoint = f"{self.url}/v1/last_quote/currencies/{from_}/{to}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/{direction}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def crypto_exchanges(self, **query_params): endpoint = f"{self.url}/v1/meta/crypto-exchanges" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def last_trade_for_a_crypto_pair(self, from_, to, **query_params): endpoint = f"{self.url}/v1/last/crypto/{from_}/{to}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def daily_open_close(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/open-close/crypto/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def historic_crypto_trades(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/historic/crypto/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_single_ticker(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_single_ticker_full_book_l2(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/{direction}" - return self._session.get(endpoint, params=query_params) + return self._session.get(endpoint, params=query_params).json() diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py index 5e22428d..8f068910 100644 --- a/polygon/websocket/__init__.py +++ b/polygon/websocket/__init__.py @@ -1 +1 @@ -from polygon.websocket.websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER \ No newline at end of file +from polygon.websocket.websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER From 0f023e556ddc33928e9b1151e5bc5a5723902e33 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:57 -0500 Subject: [PATCH 08/16] check in generated_models files --- polygon/rest/{rest_client.py => client.py} | 0 polygon/rest/models/__init__.py | 193 ++ polygon/rest/models/definitions.py | 2910 ++++++++++++++++++++ polygon/rest/models/unmarshal.py | 51 + 4 files changed, 3154 insertions(+) rename polygon/rest/{rest_client.py => client.py} (100%) create mode 100644 polygon/rest/models/__init__.py create mode 100644 polygon/rest/models/definitions.py create mode 100644 polygon/rest/models/unmarshal.py diff --git a/polygon/rest/rest_client.py b/polygon/rest/client.py similarity index 100% rename from polygon/rest/rest_client.py rename to polygon/rest/client.py diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py new file mode 100644 index 00000000..f2f27b94 --- /dev/null +++ b/polygon/rest/models/__init__.py @@ -0,0 +1,193 @@ +from .definitions import LastTrade +from .definitions import LastQuote +from .definitions import HistTrade +from .definitions import Quote +from .definitions import Aggregate +from .definitions import Company +from .definitions import Symbol +from .definitions import Dividend +from .definitions import News +from .definitions import Earning +from .definitions import Financial +from .definitions import Exchange +from .definitions import Error +from .definitions import NotFound +from .definitions import Conflict +from .definitions import Unauthorized +from .definitions import MarketStatus +from .definitions import MarketHoliday +from .definitions import AnalystRatings +from .definitions import RatingSection +from .definitions import CryptoTick +from .definitions import CryptoTickJson +from .definitions import CryptoExchange +from .definitions import CryptoSnapshotTicker +from .definitions import CryptoSnapshotBookItem +from .definitions import CryptoSnapshotTickerBook +from .definitions import CryptoSnapshotAgg +from .definitions import Forex +from .definitions import LastForexTrade +from .definitions import LastForexQuote +from .definitions import ForexAggregate +from .definitions import ForexSnapshotTicker +from .definitions import ForexSnapshotAgg +from .definitions import Ticker +from .definitions import Split +from .definitions import Financials +from .definitions import Trade +from .definitions import StocksSnapshotTicker +from .definitions import StocksSnapshotBookItem +from .definitions import StocksSnapshotTickerBook +from .definitions import StocksV2Trade +from .definitions import StocksV2NBBO +from .definitions import StocksSnapshotAgg +from .definitions import StocksSnapshotQuote +from .definitions import Aggv2 +from .definitions import AggResponse +from .definitions import TickersApiResponse +from .definitions import TickerTypesApiResponse +from .definitions import TickerDetailsApiResponse +from .definitions import TickerNewsApiResponse +from .definitions import MarketsApiResponse +from .definitions import LocalesApiResponse +from .definitions import StockSplitsApiResponse +from .definitions import StockDividendsApiResponse +from .definitions import StockFinancialsApiResponse +from .definitions import MarketStatusApiResponse +from .definitions import MarketHolidaysApiResponse +from .definitions import ExchangesApiResponse +from .definitions import HistoricTradesApiResponse +from .definitions import HistoricTradesV2ApiResponse +from .definitions import HistoricQuotesApiResponse +from .definitions import HistoricNBboQuotesV2ApiResponse +from .definitions import LastTradeForASymbolApiResponse +from .definitions import LastQuoteForASymbolApiResponse +from .definitions import DailyOpenCloseApiResponse +from .definitions import ConditionMappingsApiResponse +from .definitions import SnapshotAllTickersApiResponse +from .definitions import SnapshotSingleTickerApiResponse +from .definitions import SnapshotGainersLosersApiResponse +from .definitions import PreviousCloseApiResponse +from .definitions import AggregatesApiResponse +from .definitions import GroupedDailyApiResponse +from .definitions import HistoricForexTicksApiResponse +from .definitions import RealTimeCurrencyConversionApiResponse +from .definitions import LastQuoteForACurrencyPairApiResponse +from .definitions import SnapshotAllTickersApiResponse +from .definitions import SnapshotGainersLosersApiResponse +from .definitions import CryptoExchangesApiResponse +from .definitions import LastTradeForACryptoPairApiResponse +from .definitions import DailyOpenCloseApiResponse +from .definitions import HistoricCryptoTradesApiResponse +from .definitions import SnapshotAllTickersApiResponse +from .definitions import SnapshotSingleTickerApiResponse +from .definitions import SnapshotSingleTickerFullBookApiResponse +from .definitions import SnapshotGainersLosersApiResponse +from .definitions import StockSymbol +from .definitions import ConditionTypeMap +from .definitions import SymbolTypeMap +from .definitions import TickerSymbol + + +import typing + +from .definitions import BaseDefinition + +# noinspection SpellCheckingInspection +name_to_class: typing.Dict[str, BaseDefinition] = { + "LastTrade": LastTrade, + "LastQuote": LastQuote, + "HistTrade": HistTrade, + "Quote": Quote, + "Aggregate": Aggregate, + "Company": Company, + "Symbol": Symbol, + "Dividend": Dividend, + "News": News, + "Earning": Earning, + "Financial": Financial, + "Exchange": Exchange, + "Error": Error, + "NotFound": NotFound, + "Conflict": Conflict, + "Unauthorized": Unauthorized, + "MarketStatus": MarketStatus, + "MarketHoliday": MarketHoliday, + "AnalystRatings": AnalystRatings, + "RatingSection": RatingSection, + "CryptoTick": CryptoTick, + "CryptoTickJson": CryptoTickJson, + "CryptoExchange": CryptoExchange, + "CryptoSnapshotTicker": CryptoSnapshotTicker, + "CryptoSnapshotBookItem": CryptoSnapshotBookItem, + "CryptoSnapshotTickerBook": CryptoSnapshotTickerBook, + "CryptoSnapshotAgg": CryptoSnapshotAgg, + "Forex": Forex, + "LastForexTrade": LastForexTrade, + "LastForexQuote": LastForexQuote, + "ForexAggregate": ForexAggregate, + "ForexSnapshotTicker": ForexSnapshotTicker, + "ForexSnapshotAgg": ForexSnapshotAgg, + "Ticker": Ticker, + "Split": Split, + "Financials": Financials, + "Trade": Trade, + "StocksSnapshotTicker": StocksSnapshotTicker, + "StocksSnapshotBookItem": StocksSnapshotBookItem, + "StocksSnapshotTickerBook": StocksSnapshotTickerBook, + "StocksV2Trade": StocksV2Trade, + "StocksV2NBBO": StocksV2NBBO, + "StocksSnapshotAgg": StocksSnapshotAgg, + "StocksSnapshotQuote": StocksSnapshotQuote, + "Aggv2": Aggv2, + "AggResponse": AggResponse, + "TickersApiResponse": TickersApiResponse, + "TickerTypesApiResponse": TickerTypesApiResponse, + "TickerDetailsApiResponse": TickerDetailsApiResponse, + "TickerNewsApiResponse": TickerNewsApiResponse, + "MarketsApiResponse": MarketsApiResponse, + "LocalesApiResponse": LocalesApiResponse, + "StockSplitsApiResponse": StockSplitsApiResponse, + "StockDividendsApiResponse": StockDividendsApiResponse, + "StockFinancialsApiResponse": StockFinancialsApiResponse, + "MarketStatusApiResponse": MarketStatusApiResponse, + "MarketHolidaysApiResponse": MarketHolidaysApiResponse, + "ExchangesApiResponse": ExchangesApiResponse, + "HistoricTradesApiResponse": HistoricTradesApiResponse, + "HistoricTradesV2ApiResponse": HistoricTradesV2ApiResponse, + "HistoricQuotesApiResponse": HistoricQuotesApiResponse, + "HistoricNBboQuotesV2ApiResponse": HistoricNBboQuotesV2ApiResponse, + "LastTradeForASymbolApiResponse": LastTradeForASymbolApiResponse, + "LastQuoteForASymbolApiResponse": LastQuoteForASymbolApiResponse, + "DailyOpenCloseApiResponse": DailyOpenCloseApiResponse, + "ConditionMappingsApiResponse": ConditionMappingsApiResponse, + "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, + "SnapshotSingleTickerApiResponse": SnapshotSingleTickerApiResponse, + "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, + "PreviousCloseApiResponse": PreviousCloseApiResponse, + "AggregatesApiResponse": AggregatesApiResponse, + "GroupedDailyApiResponse": GroupedDailyApiResponse, + "HistoricForexTicksApiResponse": HistoricForexTicksApiResponse, + "RealTimeCurrencyConversionApiResponse": RealTimeCurrencyConversionApiResponse, + "LastQuoteForACurrencyPairApiResponse": LastQuoteForACurrencyPairApiResponse, + "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, + "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, + "CryptoExchangesApiResponse": CryptoExchangesApiResponse, + "LastTradeForACryptoPairApiResponse": LastTradeForACryptoPairApiResponse, + "DailyOpenCloseApiResponse": DailyOpenCloseApiResponse, + "HistoricCryptoTradesApiResponse": HistoricCryptoTradesApiResponse, + "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, + "SnapshotSingleTickerApiResponse": SnapshotSingleTickerApiResponse, + "SnapshotSingleTickerFullBookApiResponse": SnapshotSingleTickerFullBookApiResponse, + "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, + +} + +# noinspection SpellCheckingInspection +name_to_type = { + "StockSymbol": StockSymbol, + "ConditionTypeMap": ConditionTypeMap, + "SymbolTypeMap": SymbolTypeMap, + "TickerSymbol": TickerSymbol, + +} \ No newline at end of file diff --git a/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py new file mode 100644 index 00000000..dfb09ece --- /dev/null +++ b/polygon/rest/models/definitions.py @@ -0,0 +1,2910 @@ +from typing import List, Dict + +from polygon.rest import models + +StockSymbol = str +ConditionTypeMap = Dict[str, str] +SymbolTypeMap = Dict[str, str] +TickerSymbol = str + + +class BaseDefinition: + swagger_name_to_python: Dict[str, str] + attribute_is_primitive: Dict[str, bool] + + def _unmarshal_json(self, input_json): + for key, value in input_json: + if key not in self.swagger_name_to_python: + raise ValueError(f"response json has unexpected attribute {key}") + + python_name = self.swagger_name_to_python[key] + if self.attribute_is_primitive[python_name]: + if python_name not in models.name_to_class: + raise ValueError( + f"received an attribute that is not a primitive nor a definition class: {python_name}") + + value = models.name_to_class[python_name] + value._unmarshal_json(input_json["key"]) + + self.__setattr__(python_name, value) + + +# noinspection SpellCheckingInspection +class LastTrade(BaseDefinition): + swagger_name_to_python = { + "price": "price", + "size": "size", + "exchange": "exchange", + "cond1": "cond1", + "cond2": "cond2", + "cond3": "cond3", + "cond4": "cond4", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "price": True, + "size": True, + "exchange": True, + "cond1": True, + "cond2": True, + "cond3": True, + "cond4": True, + "timestamp": True, + + } + + def __init__(self, input_json): + self.price: int + self.size: int + self.exchange: int + self.cond1: int + self.cond2: int + self.cond3: int + self.cond4: int + self.timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastQuote(BaseDefinition): + swagger_name_to_python = { + "askprice": "askprice", + "asksize": "asksize", + "askexchange": "askexchange", + "bidprice": "bidprice", + "bidsize": "bidsize", + "bidexchange": "bidexchange", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "askprice": True, + "asksize": True, + "askexchange": True, + "bidprice": True, + "bidsize": True, + "bidexchange": True, + "timestamp": True, + + } + + def __init__(self, input_json): + self.askprice: int + self.asksize: int + self.askexchange: int + self.bidprice: int + self.bidsize: int + self.bidexchange: int + self.timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistTrade(BaseDefinition): + swagger_name_to_python = { + "condition1": "condition1", + "condition2": "condition2", + "condition3": "condition3", + "condition4": "condition4", + "exchange": "exchange", + "price": "price", + "size": "size", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "condition1": True, + "condition2": True, + "condition3": True, + "condition4": True, + "exchange": True, + "price": True, + "size": True, + "timestamp": True, + + } + + def __init__(self, input_json): + self.condition1: int + self.condition2: int + self.condition3: int + self.condition4: int + self.exchange: str + self.price: int + self.size: int + self.timestamp: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Quote(BaseDefinition): + swagger_name_to_python = { + "c": "condition_of_this_quote", + "bE": "bid_exchange", + "aE": "ask_exchange", + "aP": "ask_price", + "bP": "bid_price", + "bS": "bid_size", + "aS": "ask_size", + "t": "timestamp_of_this_trade", + + } + + attribute_is_primitive = { + "condition_of_this_quote": True, + "bid_exchange": True, + "ask_exchange": True, + "ask_price": True, + "bid_price": True, + "bid_size": True, + "ask_size": True, + "timestamp_of_this_trade": True, + + } + + def __init__(self, input_json): + self.condition_of_this_quote: int + self.bid_exchange: str + self.ask_exchange: str + self.ask_price: int + self.bid_price: int + self.bid_size: int + self.ask_size: int + self.timestamp_of_this_trade: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Aggregate(BaseDefinition): + swagger_name_to_python = { + "o": "open_price", + "c": "close_price", + "l": "low_price", + "h": "high_price", + "v": "total_volume_of_all_trades", + "k": "transactions", + "t": "timestamp_of_this_aggregation", + + } + + attribute_is_primitive = { + "open_price": True, + "close_price": True, + "low_price": True, + "high_price": True, + "total_volume_of_all_trades": True, + "transactions": True, + "timestamp_of_this_aggregation": True, + + } + + def __init__(self, input_json): + self.open_price: int + self.close_price: int + self.low_price: int + self.high_price: int + self.total_volume_of_all_trades: int + self.transactions: int + self.timestamp_of_this_aggregation: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Company(BaseDefinition): + swagger_name_to_python = { + "logo": "logo", + "exchange": "exchange", + "name": "name", + "symbol": "symbol", + "listdate": "listdate", + "cik": "cik", + "bloomberg": "bloomberg", + "figi": "figi", + "lei": "lei", + "sic": "sic", + "country": "country", + "industry": "industry", + "sector": "sector", + "marketcap": "marketcap", + "employees": "employees", + "phone": "phone", + "ceo": "ceo", + "url": "url", + "description": "description", + "similar": "similar", + "tags": "tags", + "updated": "updated", + + } + + attribute_is_primitive = { + "logo": True, + "exchange": True, + "name": True, + "symbol": False, + "listdate": True, + "cik": True, + "bloomberg": True, + "figi": True, + "lei": True, + "sic": True, + "country": True, + "industry": True, + "sector": True, + "marketcap": True, + "employees": True, + "phone": True, + "ceo": True, + "url": True, + "description": True, + "similar": False, + "tags": False, + "updated": True, + + } + + def __init__(self, input_json): + self.logo: str + self.exchange: str + self.name: str + self.symbol: StockSymbol + self.listdate: str + self.cik: str + self.bloomberg: str + self.figi: str + self.lei: str + self.sic: float + self.country: str + self.industry: str + self.sector: str + self.marketcap: float + self.employees: float + self.phone: str + self.ceo: str + self.url: str + self.description: str + self.similar: List[StockSymbol] + self.tags: List[str] + self.updated: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Symbol(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "name": "name", + "type": "type", + "url": "url", + "updated": "updated", + "isOTC": "is___otc", + + } + + attribute_is_primitive = { + "symbol": False, + "name": True, + "type": True, + "url": True, + "updated": True, + "is___otc": True, + + } + + def __init__(self, input_json): + self.symbol: StockSymbol + self.name: str + self.type: str + self.url: str + self.updated: str + self.is___otc: bool + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Dividend(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "type": "type", + "exDate": "ex_date", + "paymentDate": "payment_date", + "recordDate": "record_date", + "declaredDate": "declared_date", + "amount": "amount", + "qualified": "qualified", + "flag": "flag", + + } + + attribute_is_primitive = { + "symbol": False, + "type": True, + "ex_date": True, + "payment_date": True, + "record_date": True, + "declared_date": True, + "amount": True, + "qualified": True, + "flag": True, + + } + + def __init__(self, input_json): + self.symbol: StockSymbol + self.type: str + self.ex_date: str + self.payment_date: str + self.record_date: str + self.declared_date: str + self.amount: float + self.qualified: str + self.flag: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class News(BaseDefinition): + swagger_name_to_python = { + "symbols": "symbols", + "title": "title", + "url": "url", + "source": "source", + "summary": "summary", + "image": "image", + "timestamp": "timestamp", + "keywords": "keywords", + + } + + attribute_is_primitive = { + "symbols": False, + "title": True, + "url": True, + "source": True, + "summary": True, + "image": True, + "timestamp": True, + "keywords": False, + + } + + def __init__(self, input_json): + self.symbols: List[StockSymbol] + self.title: str + self.url: str + self.source: str + self.summary: str + self.image: str + self.timestamp: str + self.keywords: List[str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Earning(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "EPSReportDate": "e___psrep_ortdate", + "EPSReportDateStr": "e___psrep_ort_datestr", + "fiscalPeriod": "fiscal_period", + "fiscalEndDate": "fiscal_en_ddate", + "actualEPS": "actual___eps", + "consensusEPS": "consensus___eps", + "estimatedEPS": "estimated___eps", + "announceTime": "announce_time", + "numberOfEstimates": "number_o_festimates", + "EPSSurpriseDollar": "e___pssurpr_isedollar", + "yearAgo": "year_ago", + "yearAgoChangePercent": "year_ag_ochan_gepercent", + "estimatedChangePercent": "estimated_chang_epercent", + + } + + attribute_is_primitive = { + "symbol": True, + "e___psrep_ortdate": True, + "e___psrep_ort_datestr": True, + "fiscal_period": True, + "fiscal_en_ddate": True, + "actual___eps": True, + "consensus___eps": True, + "estimated___eps": True, + "announce_time": True, + "number_o_festimates": True, + "e___pssurpr_isedollar": True, + "year_ago": True, + "year_ag_ochan_gepercent": True, + "estimated_chang_epercent": True, + + } + + def __init__(self, input_json): + self.symbol: str + self.e___psrep_ortdate: str + self.e___psrep_ort_datestr: str + self.fiscal_period: str + self.fiscal_en_ddate: str + self.actual___eps: float + self.consensus___eps: float + self.estimated___eps: float + self.announce_time: str + self.number_o_festimates: float + self.e___pssurpr_isedollar: float + self.year_ago: float + self.year_ag_ochan_gepercent: float + self.estimated_chang_epercent: float + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Financial(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "reportDate": "report_date", + "reportDateStr": "report_dat_estr", + "grossProfit": "gross_profit", + "costOfRevenue": "cost_o_frevenue", + "operatingRevenue": "operating_revenue", + "totalRevenue": "total_revenue", + "operatingIncome": "operating_income", + "netIncome": "net_income", + "researchAndDevelopment": "research_an_ddevelopment", + "operatingExpense": "operating_expense", + "currentAssets": "current_assets", + "totalAssets": "total_assets", + "totalLiabilities": "total_liabilities", + "currentCash": "current_cash", + "currentDebt": "current_debt", + "totalCash": "total_cash", + "totalDebt": "total_debt", + "shareholderEquity": "shareholder_equity", + "cashChange": "cash_change", + "cashFlow": "cash_flow", + "operatingGainsLosses": "operating_gain_slosses", + + } + + attribute_is_primitive = { + "symbol": True, + "report_date": True, + "report_dat_estr": True, + "gross_profit": True, + "cost_o_frevenue": True, + "operating_revenue": True, + "total_revenue": True, + "operating_income": True, + "net_income": True, + "research_an_ddevelopment": True, + "operating_expense": True, + "current_assets": True, + "total_assets": True, + "total_liabilities": True, + "current_cash": True, + "current_debt": True, + "total_cash": True, + "total_debt": True, + "shareholder_equity": True, + "cash_change": True, + "cash_flow": True, + "operating_gain_slosses": True, + + } + + def __init__(self, input_json): + self.symbol: str + self.report_date: str + self.report_dat_estr: str + self.gross_profit: float + self.cost_o_frevenue: float + self.operating_revenue: float + self.total_revenue: float + self.operating_income: float + self.net_income: float + self.research_an_ddevelopment: float + self.operating_expense: float + self.current_assets: float + self.total_assets: float + self.total_liabilities: float + self.current_cash: float + self.current_debt: float + self.total_cash: float + self.total_debt: float + self.shareholder_equity: float + self.cash_change: float + self.cash_flow: float + self.operating_gain_slosses: float + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Exchange(BaseDefinition): + swagger_name_to_python = { + "id": "i_d_of_the_exchange", + "type": "type", + "market": "market", + "mic": "mic", + "name": "name", + "tape": "tape", + + } + + attribute_is_primitive = { + "i_d_of_the_exchange": True, + "type": True, + "market": True, + "mic": True, + "name": True, + "tape": True, + + } + + def __init__(self, input_json): + self.i_d_of_the_exchange: float + self.type: str + self.market: str + self.mic: str + self.name: str + self.tape: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Error(BaseDefinition): + swagger_name_to_python = { + "code": "code", + "message": "message", + "fields": "fields", + + } + + attribute_is_primitive = { + "code": True, + "message": True, + "fields": True, + + } + + def __init__(self, input_json): + self.code: int + self.message: str + self.fields: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class NotFound(BaseDefinition): + swagger_name_to_python = { + "message": "message", + + } + + attribute_is_primitive = { + "message": True, + + } + + def __init__(self, input_json): + self.message: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Conflict(BaseDefinition): + swagger_name_to_python = { + "message": "message", + + } + + attribute_is_primitive = { + "message": True, + + } + + def __init__(self, input_json): + self.message: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Unauthorized(BaseDefinition): + swagger_name_to_python = { + "message": "message", + + } + + attribute_is_primitive = { + "message": True, + + } + + def __init__(self, input_json): + self.message: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class MarketStatus(BaseDefinition): + swagger_name_to_python = { + "market": "market", + "serverTime": "server_time", + "exchanges": "exchanges", + "currencies": "currencies", + + } + + attribute_is_primitive = { + "market": True, + "server_time": True, + "exchanges": True, + "currencies": True, + + } + + def __init__(self, input_json): + self.market: str + self.server_time: str + self.exchanges: Dict[str, str] + self.currencies: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class MarketHoliday(BaseDefinition): + swagger_name_to_python = { + "exchange": "exchange", + "name": "name", + "status": "status", + "date": "date", + "open": "open", + "close": "close", + + } + + attribute_is_primitive = { + "exchange": True, + "name": True, + "status": True, + "date": True, + "open": True, + "close": True, + + } + + def __init__(self, input_json): + self.exchange: str + self.name: str + self.status: str + self.date: str + self.open: str + self.close: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class AnalystRatings(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "analysts": "analysts", + "change": "change", + "strongBuy": "strong_buy", + "buy": "buy", + "hold": "hold", + "sell": "sell", + "strongSell": "strong_sell", + "updated": "updated", + + } + + attribute_is_primitive = { + "symbol": True, + "analysts": True, + "change": True, + "strong_buy": False, + "buy": False, + "hold": False, + "sell": False, + "strong_sell": False, + "updated": True, + + } + + def __init__(self, input_json): + self.symbol: str + self.analysts: float + self.change: float + self.strong_buy: RatingSection + self.buy: RatingSection + self.hold: RatingSection + self.sell: RatingSection + self.strong_sell: RatingSection + self.updated: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class RatingSection(BaseDefinition): + swagger_name_to_python = { + "current": "current", + "month1": "month1", + "month2": "month2", + "month3": "month3", + "month4": "month4", + "month5": "month5", + + } + + attribute_is_primitive = { + "current": True, + "month1": True, + "month2": True, + "month3": True, + "month4": True, + "month5": True, + + } + + def __init__(self, input_json): + self.current: float + self.month1: float + self.month2: float + self.month3: float + self.month4: float + self.month5: float + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoTick(BaseDefinition): + swagger_name_to_python = { + "price": "price", + "size": "size", + "exchange": "exchange", + "conditions": "conditions", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "price": True, + "size": True, + "exchange": True, + "conditions": False, + "timestamp": True, + + } + + def __init__(self, input_json): + self.price: int + self.size: int + self.exchange: int + self.conditions: List[int] + self.timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoTickJson(BaseDefinition): + swagger_name_to_python = { + "p": "trade_price", + "s": "size_of_the_trade", + "x": "exchange_the_trade_occured_on", + "c": "c", + "t": "timestamp_of_this_trade", + + } + + attribute_is_primitive = { + "trade_price": True, + "size_of_the_trade": True, + "exchange_the_trade_occured_on": True, + "c": False, + "timestamp_of_this_trade": True, + + } + + def __init__(self, input_json): + self.trade_price: int + self.size_of_the_trade: int + self.exchange_the_trade_occured_on: int + self.c: List[int] + self.timestamp_of_this_trade: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoExchange(BaseDefinition): + swagger_name_to_python = { + "id": "i_d_of_the_exchange", + "type": "type", + "market": "market", + "name": "name", + "url": "url", + + } + + attribute_is_primitive = { + "i_d_of_the_exchange": True, + "type": True, + "market": True, + "name": True, + "url": True, + + } + + def __init__(self, input_json): + self.i_d_of_the_exchange: float + self.type: str + self.market: str + self.name: str + self.url: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoSnapshotTicker(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "day": "day", + "lastTrade": "last_trade", + "min": "min", + "prevDay": "prev_day", + "todaysChange": "todays_change", + "todaysChangePerc": "todays_chang_eperc", + "updated": "updated", + + } + + attribute_is_primitive = { + "ticker": True, + "day": False, + "last_trade": False, + "min": False, + "prev_day": False, + "todays_change": True, + "todays_chang_eperc": True, + "updated": True, + + } + + def __init__(self, input_json): + self.ticker: str + self.day: CryptoSnapshotAgg + self.last_trade: CryptoTickJson + self.min: CryptoSnapshotAgg + self.prev_day: CryptoSnapshotAgg + self.todays_change: int + self.todays_chang_eperc: int + self.updated: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoSnapshotBookItem(BaseDefinition): + swagger_name_to_python = { + "p": "price_of_this_book_level", + "x": "exchange_to_size_of_this_price_level", + + } + + attribute_is_primitive = { + "price_of_this_book_level": True, + "exchange_to_size_of_this_price_level": True, + + } + + def __init__(self, input_json): + self.price_of_this_book_level: int + self.exchange_to_size_of_this_price_level: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoSnapshotTickerBook(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "bids": "bids", + "asks": "asks", + "bidCount": "bid_count", + "askCount": "ask_count", + "spread": "spread", + "updated": "updated", + + } + + attribute_is_primitive = { + "ticker": True, + "bids": False, + "asks": False, + "bid_count": True, + "ask_count": True, + "spread": True, + "updated": True, + + } + + def __init__(self, input_json): + self.ticker: str + self.bids: List[CryptoSnapshotBookItem] + self.asks: List[CryptoSnapshotBookItem] + self.bid_count: int + self.ask_count: int + self.spread: int + self.updated: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoSnapshotAgg(BaseDefinition): + swagger_name_to_python = { + "c": "close_price", + "h": "high_price", + "l": "low_price", + "o": "open_price", + "v": "volume", + + } + + attribute_is_primitive = { + "close_price": True, + "high_price": True, + "low_price": True, + "open_price": True, + "volume": True, + + } + + def __init__(self, input_json): + self.close_price: int + self.high_price: int + self.low_price: int + self.open_price: int + self.volume: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Forex(BaseDefinition): + swagger_name_to_python = { + "a": "ask_price", + "b": "bid_price", + "t": "timestamp_of_this_trade", + + } + + attribute_is_primitive = { + "ask_price": True, + "bid_price": True, + "timestamp_of_this_trade": True, + + } + + def __init__(self, input_json): + self.ask_price: int + self.bid_price: int + self.timestamp_of_this_trade: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastForexTrade(BaseDefinition): + swagger_name_to_python = { + "price": "price", + "exchange": "exchange", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "price": True, + "exchange": True, + "timestamp": True, + + } + + def __init__(self, input_json): + self.price: int + self.exchange: int + self.timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastForexQuote(BaseDefinition): + swagger_name_to_python = { + "ask": "ask", + "bid": "bid", + "exchange": "exchange", + "timestamp": "timestamp", + + } + + attribute_is_primitive = { + "ask": True, + "bid": True, + "exchange": True, + "timestamp": True, + + } + + def __init__(self, input_json): + self.ask: int + self.bid: int + self.exchange: int + self.timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class ForexAggregate(BaseDefinition): + swagger_name_to_python = { + "o": "open_price", + "c": "close_price", + "l": "low_price", + "h": "high_price", + "v": "volume_of_all_trades", + "t": "timestamp_of_this_aggregation", + + } + + attribute_is_primitive = { + "open_price": True, + "close_price": True, + "low_price": True, + "high_price": True, + "volume_of_all_trades": True, + "timestamp_of_this_aggregation": True, + + } + + def __init__(self, input_json): + self.open_price: int + self.close_price: int + self.low_price: int + self.high_price: int + self.volume_of_all_trades: int + self.timestamp_of_this_aggregation: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class ForexSnapshotTicker(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "day": "day", + "lastTrade": "last_trade", + "min": "min", + "prevDay": "prev_day", + "todaysChange": "todays_change", + "todaysChangePerc": "todays_chang_eperc", + "updated": "updated", + + } + + attribute_is_primitive = { + "ticker": True, + "day": False, + "last_trade": False, + "min": False, + "prev_day": False, + "todays_change": True, + "todays_chang_eperc": True, + "updated": True, + + } + + def __init__(self, input_json): + self.ticker: str + self.day: ForexSnapshotAgg + self.last_trade: Forex + self.min: ForexSnapshotAgg + self.prev_day: ForexSnapshotAgg + self.todays_change: int + self.todays_chang_eperc: int + self.updated: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class ForexSnapshotAgg(BaseDefinition): + swagger_name_to_python = { + "c": "close_price", + "h": "high_price", + "l": "low_price", + "o": "open_price", + "v": "volume", + + } + + attribute_is_primitive = { + "close_price": True, + "high_price": True, + "low_price": True, + "open_price": True, + "volume": True, + + } + + def __init__(self, input_json): + self.close_price: int + self.high_price: int + self.low_price: int + self.open_price: int + self.volume: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Ticker(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "name": "name", + "market": "market", + "locale": "locale", + "currency": "currency", + "active": "active", + "primaryExch": "primary_exch", + "url": "url", + "updated": "updated", + "attrs": "attrs", + "codes": "codes", + + } + + attribute_is_primitive = { + "ticker": False, + "name": True, + "market": True, + "locale": True, + "currency": True, + "active": True, + "primary_exch": True, + "url": True, + "updated": True, + "attrs": True, + "codes": True, + + } + + def __init__(self, input_json): + self.ticker: StockSymbol + self.name: str + self.market: str + self.locale: str + self.currency: str + self.active: bool + self.primary_exch: str + self.url: str + self.updated: str + self.attrs: Dict[str, str] + self.codes: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Split(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "exDate": "ex_date", + "paymentDate": "payment_date", + "recordDate": "record_date", + "declaredDate": "declared_date", + "ratio": "ratio", + "tofactor": "tofactor", + "forfactor": "forfactor", + + } + + attribute_is_primitive = { + "ticker": False, + "ex_date": True, + "payment_date": True, + "record_date": True, + "declared_date": True, + "ratio": True, + "tofactor": True, + "forfactor": True, + + } + + def __init__(self, input_json): + self.ticker: TickerSymbol + self.ex_date: str + self.payment_date: str + self.record_date: str + self.declared_date: str + self.ratio: float + self.tofactor: float + self.forfactor: float + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Financials(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "period": "period", + "calendarDate": "calendar_date", + "reportPeriod": "report_period", + "updated": "updated", + "accumulatedOtherComprehensiveIncome": "accumulated_othe_rcomprehensi_veincome", + "assets": "assets", + "assetsAverage": "assets_average", + "assetsCurrent": "assets_current", + "assetTurnover": "asset_turnover", + "assetsNonCurrent": "assets_no_ncurrent", + "bookValuePerShare": "book_valu_ep_ershare", + "capitalExpenditure": "capital_expenditure", + "cashAndEquivalents": "cash_an_dequivalents", + "cashAndEquivalentsUSD": "cash_an_dequivalen___tsusd", + "costOfRevenue": "cost_o_frevenue", + "consolidatedIncome": "consolidated_income", + "currentRatio": "current_ratio", + "debtToEquityRatio": "debt_t_oequi_tyratio", + "debt": "debt", + "debtCurrent": "debt_current", + "debtNonCurrent": "debt_no_ncurrent", + "debtUSD": "debt___usd", + "deferredRevenue": "deferred_revenue", + "depreciationAmortizationAndAccretion": "depreciation_amortizatio_na_ndaccretion", + "deposits": "deposits", + "dividendYield": "dividend_yield", + "dividendsPerBasicCommonShare": "dividends_pe_rbas_iccom_monshare", + "earningBeforeInterestTaxes": "earning_befor_eintere_sttaxes", + "earningsBeforeInterestTaxesDepreciationAmortization": "earnings_befor_eintere_stta_xesdeprecia_tionamortization", + "EBITDAMargin": "e______bitdamargin", + "earningsBeforeInterestTaxesDepreciationAmortizationUSD": "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd", + "earningBeforeInterestTaxesUSD": "earning_befor_eintere_stta___xesusd", + "earningsBeforeTax": "earnings_befor_etax", + "earningsPerBasicShare": "earnings_pe_rbas_icshare", + "earningsPerDilutedShare": "earnings_pe_rdilut_edshare", + "earningsPerBasicShareUSD": "earnings_pe_rbas_icsh___areusd", + "shareholdersEquity": "shareholders_equity", + "averageEquity": "average_equity", + "shareholdersEquityUSD": "shareholders_equit___yusd", + "enterpriseValue": "enterprise_value", + "enterpriseValueOverEBIT": "enterprise_valu_eov____erebit", + "enterpriseValueOverEBITDA": "enterprise_valu_eov______erebitda", + "freeCashFlow": "free_cas_hflow", + "freeCashFlowPerShare": "free_cas_hfl_ow_pershare", + "foreignCurrencyUSDExchangeRate": "foreign_currenc____yusdexc_hangerate", + "grossProfit": "gross_profit", + "grossMargin": "gross_margin", + "goodwillAndIntangibleAssets": "goodwill_an_dintangib_leassets", + "interestExpense": "interest_expense", + "investedCapital": "invested_capital", + "investedCapitalAverage": "invested_capita_laverage", + "inventory": "inventory", + "investments": "investments", + "investmentsCurrent": "investments_current", + "investmentsNonCurrent": "investments_no_ncurrent", + "totalLiabilities": "total_liabilities", + "currentLiabilities": "current_liabilities", + "liabilitiesNonCurrent": "liabilities_no_ncurrent", + "marketCapitalization": "market_capitalization", + "netCashFlow": "net_cas_hflow", + "netCashFlowBusinessAcquisitionsDisposals": "net_cas_hfl_owbusin_essacquisit_ionsdisposals", + "issuanceEquityShares": "issuance_equit_yshares", + "issuanceDebtSecurities": "issuance_deb_tsecurities", + "paymentDividendsOtherCashDistributions": "payment_dividend_soth_erc_ashdistributions", + "netCashFlowFromFinancing": "net_cas_hfl_owf_romfinancing", + "netCashFlowFromInvesting": "net_cas_hfl_owf_rominvesting", + "netCashFlowInvestmentAcquisitionsDisposals": "net_cas_hfl_owinvestm_entacquisit_ionsdisposals", + "netCashFlowFromOperations": "net_cas_hfl_owf_romoperations", + "effectOfExchangeRateChangesOnCash": "effect_o_fexchan_ger_atecha_n_gesoncash", + "netIncome": "net_income", + "netIncomeCommonStock": "net_incom_ecomm_onstock", + "netIncomeCommonStockUSD": "net_incom_ecomm_onst___ockusd", + "netLossIncomeFromDiscontinuedOperations": "net_los_sinco_mef_romdisconti_nuedoperations", + "netIncomeToNonControllingInterests": "net_incom_e_to_noncontrol_linginterests", + "profitMargin": "profit_margin", + "operatingExpenses": "operating_expenses", + "operatingIncome": "operating_income", + "tradeAndNonTradePayables": "trade_an_dn_ontr_adepayables", + "payoutRatio": "payout_ratio", + "priceToBookValue": "price_t_obo_okvalue", + "priceEarnings": "price_earnings", + "priceToEarningsRatio": "price_t_oearnin_gsratio", + "propertyPlantEquipmentNet": "property_plan_tequipme_ntnet", + "preferredDividendsIncomeStatementImpact": "preferred_dividend_sinco_mestatem_entimpact", + "sharePriceAdjustedClose": "share_pric_eadjust_edclose", + "priceSales": "price_sales", + "priceToSalesRatio": "price_t_osal_esratio", + "tradeAndNonTradeReceivables": "trade_an_dn_ontr_adereceivables", + "accumulatedRetainedEarningsDeficit": "accumulated_retaine_dearnin_gsdeficit", + "revenues": "revenues", + "revenuesUSD": "revenues___usd", + "researchAndDevelopmentExpense": "research_an_ddevelopme_ntexpense", + "returnOnAverageAssets": "return_o_navera_geassets", + "returnOnAverageEquity": "return_o_navera_geequity", + "returnOnInvestedCapital": "return_o_ninvest_edcapital", + "returnOnSales": "return_o_nsales", + "shareBasedCompensation": "share_base_dcompensation", + "sellingGeneralAndAdministrativeExpense": "selling_genera_la_ndadministrat_iveexpense", + "shareFactor": "share_factor", + "shares": "shares", + "weightedAverageShares": "weighted_averag_eshares", + "weightedAverageSharesDiluted": "weighted_averag_eshar_esdiluted", + "salesPerShare": "sales_pe_rshare", + "tangibleAssetValue": "tangible_asse_tvalue", + "taxAssets": "tax_assets", + "incomeTaxExpense": "income_ta_xexpense", + "taxLiabilities": "tax_liabilities", + "tangibleAssetsBookValuePerShare": "tangible_asset_sbo_okva_lu_epershare", + "workingCapital": "working_capital", + + } + + attribute_is_primitive = { + "ticker": False, + "period": True, + "calendar_date": True, + "report_period": True, + "updated": True, + "accumulated_othe_rcomprehensi_veincome": True, + "assets": True, + "assets_average": True, + "assets_current": True, + "asset_turnover": True, + "assets_no_ncurrent": True, + "book_valu_ep_ershare": True, + "capital_expenditure": True, + "cash_an_dequivalents": True, + "cash_an_dequivalen___tsusd": True, + "cost_o_frevenue": True, + "consolidated_income": True, + "current_ratio": True, + "debt_t_oequi_tyratio": True, + "debt": True, + "debt_current": True, + "debt_no_ncurrent": True, + "debt___usd": True, + "deferred_revenue": True, + "depreciation_amortizatio_na_ndaccretion": True, + "deposits": True, + "dividend_yield": True, + "dividends_pe_rbas_iccom_monshare": True, + "earning_befor_eintere_sttaxes": True, + "earnings_befor_eintere_stta_xesdeprecia_tionamortization": True, + "e______bitdamargin": True, + "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd": True, + "earning_befor_eintere_stta___xesusd": True, + "earnings_befor_etax": True, + "earnings_pe_rbas_icshare": True, + "earnings_pe_rdilut_edshare": True, + "earnings_pe_rbas_icsh___areusd": True, + "shareholders_equity": True, + "average_equity": True, + "shareholders_equit___yusd": True, + "enterprise_value": True, + "enterprise_valu_eov____erebit": True, + "enterprise_valu_eov______erebitda": True, + "free_cas_hflow": True, + "free_cas_hfl_ow_pershare": True, + "foreign_currenc____yusdexc_hangerate": True, + "gross_profit": True, + "gross_margin": True, + "goodwill_an_dintangib_leassets": True, + "interest_expense": True, + "invested_capital": True, + "invested_capita_laverage": True, + "inventory": True, + "investments": True, + "investments_current": True, + "investments_no_ncurrent": True, + "total_liabilities": True, + "current_liabilities": True, + "liabilities_no_ncurrent": True, + "market_capitalization": True, + "net_cas_hflow": True, + "net_cas_hfl_owbusin_essacquisit_ionsdisposals": True, + "issuance_equit_yshares": True, + "issuance_deb_tsecurities": True, + "payment_dividend_soth_erc_ashdistributions": True, + "net_cas_hfl_owf_romfinancing": True, + "net_cas_hfl_owf_rominvesting": True, + "net_cas_hfl_owinvestm_entacquisit_ionsdisposals": True, + "net_cas_hfl_owf_romoperations": True, + "effect_o_fexchan_ger_atecha_n_gesoncash": True, + "net_income": True, + "net_incom_ecomm_onstock": True, + "net_incom_ecomm_onst___ockusd": True, + "net_los_sinco_mef_romdisconti_nuedoperations": True, + "net_incom_e_to_noncontrol_linginterests": True, + "profit_margin": True, + "operating_expenses": True, + "operating_income": True, + "trade_an_dn_ontr_adepayables": True, + "payout_ratio": True, + "price_t_obo_okvalue": True, + "price_earnings": True, + "price_t_oearnin_gsratio": True, + "property_plan_tequipme_ntnet": True, + "preferred_dividend_sinco_mestatem_entimpact": True, + "share_pric_eadjust_edclose": True, + "price_sales": True, + "price_t_osal_esratio": True, + "trade_an_dn_ontr_adereceivables": True, + "accumulated_retaine_dearnin_gsdeficit": True, + "revenues": True, + "revenues___usd": True, + "research_an_ddevelopme_ntexpense": True, + "return_o_navera_geassets": True, + "return_o_navera_geequity": True, + "return_o_ninvest_edcapital": True, + "return_o_nsales": True, + "share_base_dcompensation": True, + "selling_genera_la_ndadministrat_iveexpense": True, + "share_factor": True, + "shares": True, + "weighted_averag_eshares": True, + "weighted_averag_eshar_esdiluted": True, + "sales_pe_rshare": True, + "tangible_asse_tvalue": True, + "tax_assets": True, + "income_ta_xexpense": True, + "tax_liabilities": True, + "tangible_asset_sbo_okva_lu_epershare": True, + "working_capital": True, + + } + + def __init__(self, input_json): + self.ticker: TickerSymbol + self.period: str + self.calendar_date: str + self.report_period: str + self.updated: str + self.accumulated_othe_rcomprehensi_veincome: int + self.assets: int + self.assets_average: int + self.assets_current: int + self.asset_turnover: int + self.assets_no_ncurrent: int + self.book_valu_ep_ershare: int + self.capital_expenditure: int + self.cash_an_dequivalents: int + self.cash_an_dequivalen___tsusd: int + self.cost_o_frevenue: int + self.consolidated_income: int + self.current_ratio: int + self.debt_t_oequi_tyratio: int + self.debt: int + self.debt_current: int + self.debt_no_ncurrent: int + self.debt___usd: int + self.deferred_revenue: int + self.depreciation_amortizatio_na_ndaccretion: int + self.deposits: int + self.dividend_yield: int + self.dividends_pe_rbas_iccom_monshare: int + self.earning_befor_eintere_sttaxes: int + self.earnings_befor_eintere_stta_xesdeprecia_tionamortization: int + self.e______bitdamargin: int + self.earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd: int + self.earning_befor_eintere_stta___xesusd: int + self.earnings_befor_etax: int + self.earnings_pe_rbas_icshare: int + self.earnings_pe_rdilut_edshare: int + self.earnings_pe_rbas_icsh___areusd: int + self.shareholders_equity: int + self.average_equity: int + self.shareholders_equit___yusd: int + self.enterprise_value: int + self.enterprise_valu_eov____erebit: int + self.enterprise_valu_eov______erebitda: int + self.free_cas_hflow: int + self.free_cas_hfl_ow_pershare: int + self.foreign_currenc____yusdexc_hangerate: int + self.gross_profit: int + self.gross_margin: int + self.goodwill_an_dintangib_leassets: int + self.interest_expense: int + self.invested_capital: int + self.invested_capita_laverage: int + self.inventory: int + self.investments: int + self.investments_current: int + self.investments_no_ncurrent: int + self.total_liabilities: int + self.current_liabilities: int + self.liabilities_no_ncurrent: int + self.market_capitalization: int + self.net_cas_hflow: int + self.net_cas_hfl_owbusin_essacquisit_ionsdisposals: int + self.issuance_equit_yshares: int + self.issuance_deb_tsecurities: int + self.payment_dividend_soth_erc_ashdistributions: int + self.net_cas_hfl_owf_romfinancing: int + self.net_cas_hfl_owf_rominvesting: int + self.net_cas_hfl_owinvestm_entacquisit_ionsdisposals: int + self.net_cas_hfl_owf_romoperations: int + self.effect_o_fexchan_ger_atecha_n_gesoncash: int + self.net_income: int + self.net_incom_ecomm_onstock: int + self.net_incom_ecomm_onst___ockusd: int + self.net_los_sinco_mef_romdisconti_nuedoperations: int + self.net_incom_e_to_noncontrol_linginterests: int + self.profit_margin: int + self.operating_expenses: int + self.operating_income: int + self.trade_an_dn_ontr_adepayables: int + self.payout_ratio: int + self.price_t_obo_okvalue: int + self.price_earnings: int + self.price_t_oearnin_gsratio: int + self.property_plan_tequipme_ntnet: int + self.preferred_dividend_sinco_mestatem_entimpact: int + self.share_pric_eadjust_edclose: int + self.price_sales: int + self.price_t_osal_esratio: int + self.trade_an_dn_ontr_adereceivables: int + self.accumulated_retaine_dearnin_gsdeficit: int + self.revenues: int + self.revenues___usd: int + self.research_an_ddevelopme_ntexpense: int + self.return_o_navera_geassets: int + self.return_o_navera_geequity: int + self.return_o_ninvest_edcapital: int + self.return_o_nsales: int + self.share_base_dcompensation: int + self.selling_genera_la_ndadministrat_iveexpense: int + self.share_factor: int + self.shares: int + self.weighted_averag_eshares: int + self.weighted_averag_eshar_esdiluted: int + self.sales_pe_rshare: int + self.tangible_asse_tvalue: int + self.tax_assets: int + self.income_ta_xexpense: int + self.tax_liabilities: int + self.tangible_asset_sbo_okva_lu_epershare: int + self.working_capital: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Trade(BaseDefinition): + swagger_name_to_python = { + "c1": "condition_1_of_this_trade", + "c2": "condition_2_of_this_trade", + "c3": "condition_3_of_this_trade", + "c4": "condition_4_of_this_trade", + "e": "the_exchange_this_trade_happened_on", + "p": "price_of_the_trade", + "s": "size_of_the_trade", + "t": "timestamp_of_this_trade", + + } + + attribute_is_primitive = { + "condition_1_of_this_trade": True, + "condition_2_of_this_trade": True, + "condition_3_of_this_trade": True, + "condition_4_of_this_trade": True, + "the_exchange_this_trade_happened_on": True, + "price_of_the_trade": True, + "size_of_the_trade": True, + "timestamp_of_this_trade": True, + + } + + def __init__(self, input_json): + self.condition_1_of_this_trade: int + self.condition_2_of_this_trade: int + self.condition_3_of_this_trade: int + self.condition_4_of_this_trade: int + self.the_exchange_this_trade_happened_on: str + self.price_of_the_trade: int + self.size_of_the_trade: int + self.timestamp_of_this_trade: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksSnapshotTicker(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "day": "day", + "lastTrade": "last_trade", + "lastQuote": "last_quote", + "min": "min", + "prevDay": "prev_day", + "todaysChange": "todays_change", + "todaysChangePerc": "todays_chang_eperc", + "updated": "updated", + + } + + attribute_is_primitive = { + "ticker": True, + "day": False, + "last_trade": False, + "last_quote": False, + "min": False, + "prev_day": False, + "todays_change": True, + "todays_chang_eperc": True, + "updated": True, + + } + + def __init__(self, input_json): + self.ticker: str + self.day: StocksSnapshotAgg + self.last_trade: Trade + self.last_quote: StocksSnapshotQuote + self.min: StocksSnapshotAgg + self.prev_day: StocksSnapshotAgg + self.todays_change: int + self.todays_chang_eperc: int + self.updated: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksSnapshotBookItem(BaseDefinition): + swagger_name_to_python = { + "p": "price_of_this_book_level", + "x": "exchange_to_size_of_this_price_level", + + } + + attribute_is_primitive = { + "price_of_this_book_level": True, + "exchange_to_size_of_this_price_level": True, + + } + + def __init__(self, input_json): + self.price_of_this_book_level: int + self.exchange_to_size_of_this_price_level: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksSnapshotTickerBook(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "bids": "bids", + "asks": "asks", + "bidCount": "bid_count", + "askCount": "ask_count", + "spread": "spread", + "updated": "updated", + + } + + attribute_is_primitive = { + "ticker": True, + "bids": False, + "asks": False, + "bid_count": True, + "ask_count": True, + "spread": True, + "updated": True, + + } + + def __init__(self, input_json): + self.ticker: str + self.bids: List[StocksSnapshotBookItem] + self.asks: List[StocksSnapshotBookItem] + self.bid_count: int + self.ask_count: int + self.spread: int + self.updated: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksV2Trade(BaseDefinition): + swagger_name_to_python = { + "T": "ticker_of_the_object", + "t": "nanosecond_accuracy_s__ip_unix_timestamp", + "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", + "f": "nanosecond_accuracy_t__rf", + "q": "sequence_number", + "i": "trade_i_d", + "x": "exchange_i_d", + "s": "size_volume_of_the_trade", + "c": "c", + "p": "price_of_the_trade", + "z": "tape_where_trade_occured", + + } + + attribute_is_primitive = { + "ticker_of_the_object": True, + "nanosecond_accuracy_s__ip_unix_timestamp": True, + "nanosecond_accuracy_participant_exchange_unix_timestamp": True, + "nanosecond_accuracy_t__rf": True, + "sequence_number": True, + "trade_i_d": True, + "exchange_i_d": True, + "size_volume_of_the_trade": True, + "c": False, + "price_of_the_trade": True, + "tape_where_trade_occured": True, + + } + + def __init__(self, input_json): + self.ticker_of_the_object: str + self.nanosecond_accuracy_s__ip_unix_timestamp: int + self.nanosecond_accuracy_participant_exchange_unix_timestamp: int + self.nanosecond_accuracy_t__rf: int + self.sequence_number: int + self.trade_i_d: str + self.exchange_i_d: int + self.size_volume_of_the_trade: int + self.c: List[int] + self.price_of_the_trade: int + self.tape_where_trade_occured: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksV2NBBO(BaseDefinition): + swagger_name_to_python = { + "T": "ticker_of_the_object", + "t": "nanosecond_accuracy_s__ip_unix_timestamp", + "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", + "f": "nanosecond_accuracy_t__rf", + "q": "sequence_number", + "c": "c", + "i": "i", + "p": "b__id_price", + "x": "b__id_exchange__id", + "s": "b__id_size", + "P": "a__sk_price", + "X": "a__sk_exchange__id", + "S": "a__sk_size", + "z": "tape_where_trade_occured", + + } + + attribute_is_primitive = { + "ticker_of_the_object": True, + "nanosecond_accuracy_s__ip_unix_timestamp": True, + "nanosecond_accuracy_participant_exchange_unix_timestamp": True, + "nanosecond_accuracy_t__rf": True, + "sequence_number": True, + "c": False, + "i": False, + "b__id_price": True, + "b__id_exchange__id": True, + "b__id_size": True, + "a__sk_price": True, + "a__sk_exchange__id": True, + "a__sk_size": True, + "tape_where_trade_occured": True, + + } + + def __init__(self, input_json): + self.ticker_of_the_object: str + self.nanosecond_accuracy_s__ip_unix_timestamp: int + self.nanosecond_accuracy_participant_exchange_unix_timestamp: int + self.nanosecond_accuracy_t__rf: int + self.sequence_number: int + self.c: List[int] + self.i: List[int] + self.b__id_price: int + self.b__id_exchange__id: int + self.b__id_size: int + self.a__sk_price: int + self.a__sk_exchange__id: int + self.a__sk_size: int + self.tape_where_trade_occured: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksSnapshotAgg(BaseDefinition): + swagger_name_to_python = { + "c": "close_price", + "h": "high_price", + "l": "low_price", + "o": "open_price", + "v": "volume", + + } + + attribute_is_primitive = { + "close_price": True, + "high_price": True, + "low_price": True, + "open_price": True, + "volume": True, + + } + + def __init__(self, input_json): + self.close_price: int + self.high_price: int + self.low_price: int + self.open_price: int + self.volume: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StocksSnapshotQuote(BaseDefinition): + swagger_name_to_python = { + "p": "bid_price", + "s": "bid_size_in_lots", + "P": "ask_price", + "S": "ask_size_in_lots", + "t": "last_updated_timestamp", + + } + + attribute_is_primitive = { + "bid_price": True, + "bid_size_in_lots": True, + "ask_price": True, + "ask_size_in_lots": True, + "last_updated_timestamp": True, + + } + + def __init__(self, input_json): + self.bid_price: int + self.bid_size_in_lots: int + self.ask_price: int + self.ask_size_in_lots: int + self.last_updated_timestamp: int + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class Aggv2(BaseDefinition): + swagger_name_to_python = { + "T": "ticker_symbol", + "v": "volume", + "o": "open", + "c": "close", + "h": "high", + "l": "low", + "t": "unix_msec_timestamp", + "n": "number_of_items_in_aggregate_window", + + } + + attribute_is_primitive = { + "ticker_symbol": True, + "volume": True, + "open": True, + "close": True, + "high": True, + "low": True, + "unix_msec_timestamp": True, + "number_of_items_in_aggregate_window": True, + + } + + def __init__(self, input_json): + self.ticker_symbol: str + self.volume: int + self.open: int + self.close: int + self.high: int + self.low: int + self.unix_msec_timestamp: float + self.number_of_items_in_aggregate_window: float + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class AggResponse(BaseDefinition): + swagger_name_to_python = { + "ticker": "ticker", + "status": "status", + "adjusted": "adjusted", + "queryCount": "query_count", + "resultsCount": "results_count", + "results": "results", + + } + + attribute_is_primitive = { + "ticker": True, + "status": True, + "adjusted": True, + "query_count": True, + "results_count": True, + "results": False, + + } + + def __init__(self, input_json): + self.ticker: str + self.status: str + self.adjusted: bool + self.query_count: float + self.results_count: float + self.results: List[Aggv2] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class TickersApiResponse(BaseDefinition): + swagger_name_to_python = { + "Symbol": "symbol", + + } + + attribute_is_primitive = { + "symbol": False, + + } + + def __init__(self, input_json): + self.symbol: List[Symbol] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class TickerTypesApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "results": True, + + } + + def __init__(self, input_json): + self.status: str + self.results: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class TickerDetailsApiResponse(BaseDefinition): + swagger_name_to_python = { + "company": "company", + + } + + attribute_is_primitive = { + "company": False, + + } + + def __init__(self, input_json): + self.company: Company + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class TickerNewsApiResponse(BaseDefinition): + swagger_name_to_python = { + "News": "news", + + } + + attribute_is_primitive = { + "news": False, + + } + + def __init__(self, input_json): + self.news: List[News] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class MarketsApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "results": False, + + } + + def __init__(self, input_json): + self.status: str + self.results: List[Dict[str, str]] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LocalesApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "results": False, + + } + + def __init__(self, input_json): + self.status: str + self.results: List[Dict[str, str]] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StockSplitsApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "count": "count", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "count": True, + "results": False, + + } + + def __init__(self, input_json): + self.status: str + self.count: float + self.results: List[Split] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StockDividendsApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "count": "count", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "count": True, + "results": False, + + } + + def __init__(self, input_json): + self.status: str + self.count: float + self.results: List[Dividend] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class StockFinancialsApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "count": "count", + "results": "results", + + } + + attribute_is_primitive = { + "status": True, + "count": True, + "results": False, + + } + + def __init__(self, input_json): + self.status: str + self.count: float + self.results: List[Financials] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class MarketStatusApiResponse(BaseDefinition): + swagger_name_to_python = { + "marketstatus": "marketstatus", + + } + + attribute_is_primitive = { + "marketstatus": False, + + } + + def __init__(self, input_json): + self.marketstatus: MarketStatus + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class MarketHolidaysApiResponse(BaseDefinition): + swagger_name_to_python = { + "MarketHoliday": "market_holiday", + + } + + attribute_is_primitive = { + "market_holiday": False, + + } + + def __init__(self, input_json): + self.market_holiday: List[MarketHoliday] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class ExchangesApiResponse(BaseDefinition): + swagger_name_to_python = { + "Exchange": "exchange", + + } + + attribute_is_primitive = { + "exchange": False, + + } + + def __init__(self, input_json): + self.exchange: List[Exchange] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricTradesApiResponse(BaseDefinition): + swagger_name_to_python = { + "day": "day", + "map": "map", + "msLatency": "ms_latency", + "status": "status", + "symbol": "symbol", + "ticks": "ticks", + + } + + attribute_is_primitive = { + "day": True, + "map": True, + "ms_latency": True, + "status": True, + "symbol": True, + "ticks": False, + + } + + def __init__(self, input_json): + self.day: str + self.map: Dict[str, str] + self.ms_latency: int + self.status: str + self.symbol: str + self.ticks: List[Trade] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricTradesV2ApiResponse(BaseDefinition): + swagger_name_to_python = { + "results_count": "results_count", + "db_latency": "db_latency", + "success": "success", + "ticker": "ticker", + "results": "results", + + } + + attribute_is_primitive = { + "results_count": True, + "db_latency": True, + "success": True, + "ticker": True, + "results": False, + + } + + def __init__(self, input_json): + self.results_count: int + self.db_latency: int + self.success: bool + self.ticker: str + self.results: List[StocksV2Trade] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricQuotesApiResponse(BaseDefinition): + swagger_name_to_python = { + "day": "day", + "map": "map", + "msLatency": "ms_latency", + "status": "status", + "symbol": "symbol", + "ticks": "ticks", + + } + + attribute_is_primitive = { + "day": True, + "map": True, + "ms_latency": True, + "status": True, + "symbol": True, + "ticks": False, + + } + + def __init__(self, input_json): + self.day: str + self.map: Dict[str, str] + self.ms_latency: int + self.status: str + self.symbol: str + self.ticks: List[Quote] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricNBboQuotesV2ApiResponse(BaseDefinition): + swagger_name_to_python = { + "results_count": "results_count", + "db_latency": "db_latency", + "success": "success", + "ticker": "ticker", + "results": "results", + + } + + attribute_is_primitive = { + "results_count": True, + "db_latency": True, + "success": True, + "ticker": True, + "results": False, + + } + + def __init__(self, input_json): + self.results_count: int + self.db_latency: int + self.success: bool + self.ticker: str + self.results: List[StocksV2NBBO] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastTradeForASymbolApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "symbol": "symbol", + "last": "last", + + } + + attribute_is_primitive = { + "status": True, + "symbol": True, + "last": False, + + } + + def __init__(self, input_json): + self.status: str + self.symbol: str + self.last: LastTrade + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastQuoteForASymbolApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "symbol": "symbol", + "last": "last", + + } + + attribute_is_primitive = { + "status": True, + "symbol": True, + "last": False, + + } + + def __init__(self, input_json): + self.status: str + self.symbol: str + self.last: LastQuote + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class DailyOpenCloseApiResponse(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "open": "open", + "close": "close", + "afterHours": "after_hours", + + } + + attribute_is_primitive = { + "symbol": True, + "open": False, + "close": False, + "after_hours": False, + + } + + def __init__(self, input_json): + self.symbol: str + self.open: HistTrade + self.close: HistTrade + self.after_hours: HistTrade + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class ConditionMappingsApiResponse(BaseDefinition): + swagger_name_to_python = { + "conditiontypemap": "conditiontypemap", + + } + + attribute_is_primitive = { + "conditiontypemap": False, + + } + + def __init__(self, input_json): + self.conditiontypemap: ConditionTypeMap + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotAllTickersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[StocksSnapshotTicker] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotSingleTickerApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "ticker": "ticker", + + } + + attribute_is_primitive = { + "status": True, + "ticker": False, + + } + + def __init__(self, input_json): + self.status: str + self.ticker: StocksSnapshotTicker + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotGainersLosersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[StocksSnapshotTicker] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class PreviousCloseApiResponse(BaseDefinition): + swagger_name_to_python = { + "aggresponse": "aggresponse", + + } + + attribute_is_primitive = { + "aggresponse": False, + + } + + def __init__(self, input_json): + self.aggresponse: AggResponse + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class AggregatesApiResponse(BaseDefinition): + swagger_name_to_python = { + "aggresponse": "aggresponse", + + } + + attribute_is_primitive = { + "aggresponse": False, + + } + + def __init__(self, input_json): + self.aggresponse: AggResponse + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class GroupedDailyApiResponse(BaseDefinition): + swagger_name_to_python = { + "aggresponse": "aggresponse", + + } + + attribute_is_primitive = { + "aggresponse": False, + + } + + def __init__(self, input_json): + self.aggresponse: AggResponse + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricForexTicksApiResponse(BaseDefinition): + swagger_name_to_python = { + "day": "day", + "map": "map", + "msLatency": "ms_latency", + "status": "status", + "pair": "pair", + "ticks": "ticks", + + } + + attribute_is_primitive = { + "day": True, + "map": True, + "ms_latency": True, + "status": True, + "pair": True, + "ticks": False, + + } + + def __init__(self, input_json): + self.day: str + self.map: Dict[str, str] + self.ms_latency: int + self.status: str + self.pair: str + self.ticks: List[Forex] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class RealTimeCurrencyConversionApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "from": "from_", + "to": "to_currency_symbol", + "initialAmount": "initial_amount", + "converted": "converted", + "lastTrade": "last_trade", + "symbol": "symbol", + + } + + attribute_is_primitive = { + "status": True, + "from_": True, + "to_currency_symbol": True, + "initial_amount": True, + "converted": True, + "last_trade": False, + "symbol": True, + + } + + def __init__(self, input_json): + self.status: str + self.from_: str + self.to_currency_symbol: str + self.initial_amount: float + self.converted: float + self.last_trade: LastForexTrade + self.symbol: str + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastQuoteForACurrencyPairApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "symbol": "symbol", + "last": "last", + + } + + attribute_is_primitive = { + "status": True, + "symbol": True, + "last": False, + + } + + def __init__(self, input_json): + self.status: str + self.symbol: str + self.last: LastForexQuote + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotAllTickersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[ForexSnapshotTicker] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotGainersLosersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[ForexSnapshotTicker] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class CryptoExchangesApiResponse(BaseDefinition): + swagger_name_to_python = { + "CryptoExchange": "crypto_exchange", + + } + + attribute_is_primitive = { + "crypto_exchange": False, + + } + + def __init__(self, input_json): + self.crypto_exchange: List[CryptoExchange] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class LastTradeForACryptoPairApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "symbol": "symbol", + "last": "last", + "lastAverage": "last_average", + + } + + attribute_is_primitive = { + "status": True, + "symbol": True, + "last": False, + "last_average": True, + + } + + def __init__(self, input_json): + self.status: str + self.symbol: str + self.last: CryptoTick + self.last_average: Dict[str, str] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class DailyOpenCloseApiResponse(BaseDefinition): + swagger_name_to_python = { + "symbol": "symbol", + "isUTC": "is___utc", + "day": "day", + "open": "open", + "close": "close", + "openTrades": "open_trades", + "closingTrades": "closing_trades", + + } + + attribute_is_primitive = { + "symbol": True, + "is___utc": True, + "day": True, + "open": True, + "close": True, + "open_trades": False, + "closing_trades": False, + + } + + def __init__(self, input_json): + self.symbol: str + self.is___utc: bool + self.day: str + self.open: int + self.close: int + self.open_trades: List[CryptoTickJson] + self.closing_trades: List[CryptoTickJson] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class HistoricCryptoTradesApiResponse(BaseDefinition): + swagger_name_to_python = { + "day": "day", + "map": "map", + "msLatency": "ms_latency", + "status": "status", + "symbol": "symbol", + "ticks": "ticks", + + } + + attribute_is_primitive = { + "day": True, + "map": True, + "ms_latency": True, + "status": True, + "symbol": True, + "ticks": False, + + } + + def __init__(self, input_json): + self.day: str + self.map: Dict[str, str] + self.ms_latency: int + self.status: str + self.symbol: str + self.ticks: List[CryptoTickJson] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotAllTickersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[CryptoSnapshotTicker] + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotSingleTickerApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "ticker": "ticker", + + } + + attribute_is_primitive = { + "status": True, + "ticker": False, + + } + + def __init__(self, input_json): + self.status: str + self.ticker: CryptoSnapshotTicker + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotSingleTickerFullBookApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "data": "data", + + } + + attribute_is_primitive = { + "status": True, + "data": False, + + } + + def __init__(self, input_json): + self.status: str + self.data: CryptoSnapshotTickerBook + + self._unmarshal_json(input_json) + + +# noinspection SpellCheckingInspection +class SnapshotGainersLosersApiResponse(BaseDefinition): + swagger_name_to_python = { + "status": "status", + "tickers": "tickers", + + } + + attribute_is_primitive = { + "status": True, + "tickers": False, + + } + + def __init__(self, input_json): + self.status: str + self.tickers: List[CryptoSnapshotTicker] + + self._unmarshal_json(input_json) + diff --git a/polygon/rest/models/unmarshal.py b/polygon/rest/models/unmarshal.py new file mode 100644 index 00000000..23603dc4 --- /dev/null +++ b/polygon/rest/models/unmarshal.py @@ -0,0 +1,51 @@ +from typing import Dict, Callable + +from polygon.rest import models + +# noinspection SpellCheckingInspection +classes: Dict[str, Callable] = { + "tickers": models.TickersApiResponse, + "ticker_types": models.TickerTypesApiResponse, + "ticker_details": models.TickerDetailsApiResponse, + "ticker_news": models.TickerNewsApiResponse, + "markets": models.MarketsApiResponse, + "locales": models.LocalesApiResponse, + "stock_splits": models.StockSplitsApiResponse, + "stock_dividends": models.StockDividendsApiResponse, + "stock_financials": models.StockFinancialsApiResponse, + "market_status": models.MarketStatusApiResponse, + "market_holidays": models.MarketHolidaysApiResponse, + "exchanges": models.ExchangesApiResponse, + "historic_trades": models.HistoricTradesApiResponse, + "historic_trades_v2": models.HistoricTradesV2ApiResponse, + "historic_quotes": models.HistoricQuotesApiResponse, + "historic_n___bbo_quotes_v2": models.HistoricNBboQuotesV2ApiResponse, + "last_trade_for_a_symbol": models.LastTradeForASymbolApiResponse, + "last_quote_for_a_symbol": models.LastQuoteForASymbolApiResponse, + "daily_open_close": models.DailyOpenCloseApiResponse, + "condition_mappings": models.ConditionMappingsApiResponse, + "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, + "snapshot_single_ticker": models.SnapshotSingleTickerApiResponse, + "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, + "previous_close": models.PreviousCloseApiResponse, + "aggregates": models.AggregatesApiResponse, + "grouped_daily": models.GroupedDailyApiResponse, + "historic_forex_ticks": models.HistoricForexTicksApiResponse, + "real_time_currency_conversion": models.RealTimeCurrencyConversionApiResponse, + "last_quote_for_a_currency_pair": models.LastQuoteForACurrencyPairApiResponse, + "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, + "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, + "crypto_exchanges": models.CryptoExchangesApiResponse, + "last_trade_for_a_crypto_pair": models.LastTradeForACryptoPairApiResponse, + "daily_open_close": models.DailyOpenCloseApiResponse, + "historic_crypto_trades": models.HistoricCryptoTradesApiResponse, + "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, + "snapshot_single_ticker": models.SnapshotSingleTickerApiResponse, + "snapshot_single_ticker_full_book": models.SnapshotSingleTickerFullBookApiResponse, + "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, + +} + + +def unmarshal_json(handler, resp_json): + response_object = classes[handler](resp_json) From 2d45f1f47e0ea02a597eaac966d916c0101551b3 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:27:58 -0500 Subject: [PATCH 09/16] Passing 30/33 endpoints --- .gitignore | 37 +- polygon/rest/__init__.py | 2 +- polygon/rest/client.py | 99 +- polygon/rest/models/__init__.py | 4 +- polygon/rest/models/definitions.py | 1806 ++++++++++++++------ polygon/rest/models/unmarshal.py | 52 +- polygon/rest/tests/integration/test_api.py | 169 ++ requirements.txt | 20 +- 8 files changed, 1519 insertions(+), 670 deletions(-) create mode 100644 polygon/rest/tests/integration/test_api.py diff --git a/.gitignore b/.gitignore index c1a28fd2..a655050c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ @@ -19,13 +20,9 @@ lib64/ parts/ sdist/ var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -40,32 +37,28 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*.cover -*.py,cover +*,cover .hypothesis/ -.pytest_cache/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log # Sphinx documentation docs/_build/ -# Jupyter Notebook -.ipynb_checkpoints +# PyBuilder +target/ -# IPython -profile_default/ -ipython_config.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ +#Ipython Notebook +.ipynb_checkpoints diff --git a/polygon/rest/__init__.py b/polygon/rest/__init__.py index d65861a4..fb5d2b40 100644 --- a/polygon/rest/__init__.py +++ b/polygon/rest/__init__.py @@ -1 +1 @@ -from .rest_client import RESTClient +from .client import RESTClient diff --git a/polygon/rest/client.py b/polygon/rest/client.py index ca23d21b..a4fcb3a4 100644 --- a/polygon/rest/client.py +++ b/polygon/rest/client.py @@ -1,168 +1,181 @@ +from typing import Dict + import requests +from polygon.rest import models +from polygon.rest.models import unmarshal + class RESTClient: + """ This is a custom generated class """ DEFAULT_HOST = "api.polygon.io" - def __init__(self, auth_key): + def __init__(self, auth_key: str): self.auth_key = auth_key self.url = "https://" + self.DEFAULT_HOST self._session = requests.Session() self._session.params["apiKey"] = self.auth_key + def _handle_response(self, response_type: str, endpoint: str, params: Dict[str, str]) -> models.Definition: + resp: requests.Response = self._session.get(endpoint, params=params) + if resp.status_code == 200: + return unmarshal.unmarshal_json(response_type, resp.json()) + else: + resp.raise_for_status() + def tickers(self, **query_params): endpoint = f"{self.url}/v2/reference/tickers" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("TickersApiResponse", endpoint, query_params) def ticker_types(self, **query_params): endpoint = f"{self.url}/v2/reference/types" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("TickerTypesApiResponse", endpoint, query_params) def ticker_details(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("TickerDetailsApiResponse", endpoint, query_params) def ticker_news(self, symbol, **query_params): endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("TickerNewsApiResponse", endpoint, query_params) def markets(self, **query_params): endpoint = f"{self.url}/v2/reference/markets" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("MarketsApiResponse", endpoint, query_params) def locales(self, **query_params): endpoint = f"{self.url}/v2/reference/locales" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("LocalesApiResponse", endpoint, query_params) def stock_splits(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/splits/{symbol}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("StockSplitsApiResponse", endpoint, query_params) def stock_dividends(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/dividends/{symbol}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("StockDividendsApiResponse", endpoint, query_params) def stock_financials(self, symbol, **query_params): endpoint = f"{self.url}/v2/reference/financials/{symbol}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("StockFinancialsApiResponse", endpoint, query_params) def market_status(self, **query_params): endpoint = f"{self.url}/v1/marketstatus/now" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("MarketStatusApiResponse", endpoint, query_params) def market_holidays(self, **query_params): endpoint = f"{self.url}/v1/marketstatus/upcoming" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("MarketHolidaysApiResponse", endpoint, query_params) def exchanges(self, **query_params): endpoint = f"{self.url}/v1/meta/exchanges" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("ExchangesApiResponse", endpoint, query_params) def historic_trades(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/historic/trades/{symbol}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricTradesApiResponse", endpoint, query_params) - def v2_historic_trades(self, ticker, date, **query_params): + def historic_trades_v2(self, ticker, date, **query_params): endpoint = f"{self.url}/v2/ticks/stocks/trades/{ticker}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricTradesV2ApiResponse", endpoint, query_params) def historic_quotes(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/historic/quotes/{symbol}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricQuotesApiResponse", endpoint, query_params) - def v2_historic_nbbo_quotes(self, ticker, date, **query_params): + def historic_n___bbo_quotes_v2(self, ticker, date, **query_params): endpoint = f"{self.url}/v2/ticks/stocks/nbbo/{ticker}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricNBboQuotesV2ApiResponse", endpoint, query_params) def last_trade_for_a_symbol(self, symbol, **query_params): endpoint = f"{self.url}/v1/last/stocks/{symbol}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("LastTradeForASymbolApiResponse", endpoint, query_params) def last_quote_for_a_symbol(self, symbol, **query_params): endpoint = f"{self.url}/v1/last_quote/stocks/{symbol}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("LastQuoteForASymbolApiResponse", endpoint, query_params) def daily_open_close(self, symbol, date, **query_params): endpoint = f"{self.url}/v1/open-close/{symbol}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("DailyOpenCloseApiResponse", endpoint, query_params) def condition_mappings(self, ticktype, **query_params): endpoint = f"{self.url}/v1/meta/conditions/{ticktype}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("ConditionMappingsApiResponse", endpoint, query_params) def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) def snapshot_single_ticker(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotSingleTickerApiResponse", endpoint, query_params) def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/{direction}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) def previous_close(self, ticker, **query_params): endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("PreviousCloseApiResponse", endpoint, query_params) def aggregates(self, ticker, multiplier, timespan, from_, to, **query_params): endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("AggregatesApiResponse", endpoint, query_params) def grouped_daily(self, locale, market, date, **query_params): endpoint = f"{self.url}/v2/aggs/grouped/locale/{locale}/market/{market}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("GroupedDailyApiResponse", endpoint, query_params) def historic_forex_ticks(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/historic/forex/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricForexTicksApiResponse", endpoint, query_params) def real_time_currency_conversion(self, from_, to, **query_params): endpoint = f"{self.url}/v1/conversion/{from_}/{to}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("RealTimeCurrencyConversionApiResponse", endpoint, query_params) def last_quote_for_a_currency_pair(self, from_, to, **query_params): endpoint = f"{self.url}/v1/last_quote/currencies/{from_}/{to}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("LastQuoteForACurrencyPairApiResponse", endpoint, query_params) def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/{direction}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) def crypto_exchanges(self, **query_params): endpoint = f"{self.url}/v1/meta/crypto-exchanges" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("CryptoExchangesApiResponse", endpoint, query_params) def last_trade_for_a_crypto_pair(self, from_, to, **query_params): endpoint = f"{self.url}/v1/last/crypto/{from_}/{to}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("LastTradeForACryptoPairApiResponse", endpoint, query_params) def daily_open_close(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/open-close/crypto/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("DailyOpenCloseApiResponse", endpoint, query_params) def historic_crypto_trades(self, from_, to, date, **query_params): endpoint = f"{self.url}/v1/historic/crypto/{from_}/{to}/{date}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("HistoricCryptoTradesApiResponse", endpoint, query_params) def snapshot_all_tickers(self, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) def snapshot_single_ticker(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotSingleTickerApiResponse", endpoint, query_params) - def snapshot_single_ticker_full_book_l2(self, ticker, **query_params): + def snapshot_single_ticker_full_book(self, ticker, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotSingleTickerFullBookApiResponse", endpoint, query_params) def snapshot_gainers_losers(self, direction, **query_params): endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/{direction}" - return self._session.get(endpoint, params=query_params).json() + return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py index f2f27b94..05f7fcdf 100644 --- a/polygon/rest/models/__init__.py +++ b/polygon/rest/models/__init__.py @@ -91,10 +91,10 @@ import typing -from .definitions import BaseDefinition +from .definitions import Definition # noinspection SpellCheckingInspection -name_to_class: typing.Dict[str, BaseDefinition] = { +name_to_class: typing.Dict[str, typing.Callable[[], Definition]] = { "LastTrade": LastTrade, "LastQuote": LastQuote, "HistTrade": HistTrade, diff --git a/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py index dfb09ece..cf14763d 100644 --- a/polygon/rest/models/definitions.py +++ b/polygon/rest/models/definitions.py @@ -1,4 +1,4 @@ -from typing import List, Dict +from typing import List, Dict, Any, Optional from polygon.rest import models @@ -8,30 +8,51 @@ TickerSymbol = str -class BaseDefinition: - swagger_name_to_python: Dict[str, str] - attribute_is_primitive: Dict[str, bool] - - def _unmarshal_json(self, input_json): - for key, value in input_json: - if key not in self.swagger_name_to_python: - raise ValueError(f"response json has unexpected attribute {key}") - - python_name = self.swagger_name_to_python[key] - if self.attribute_is_primitive[python_name]: - if python_name not in models.name_to_class: - raise ValueError( - f"received an attribute that is not a primitive nor a definition class: {python_name}") - - value = models.name_to_class[python_name] - value._unmarshal_json(input_json["key"]) - - self.__setattr__(python_name, value) - - -# noinspection SpellCheckingInspection -class LastTrade(BaseDefinition): - swagger_name_to_python = { +class Definition: + _swagger_name_to_python: Dict[str, str] + _attribute_is_primitive: Dict[str, bool] + _attributes_to_types: Dict[str, Any] + + def unmarshal_json(self, input_json): + if isinstance(input_json, list): + list_attribute_name = list(self._swagger_name_to_python.values())[0] + if list_attribute_name in self._attributes_to_types: + list_type = self._attributes_to_types[list_attribute_name] + known_type = list_type.split("[")[1][:-1] + list_items = self._unmarshal_json_list(input_json, known_type) + else: + list_items = input_json + self.__setattr__(list_attribute_name, list_items) + elif isinstance(input_json, dict): + self._unmarshal_json_object(input_json) + + @staticmethod + def _unmarshal_json_list(input_json, known_type): + items = [] + for item in input_json: + new_item = models.name_to_class[known_type]() + items.append(new_item._unmarshal_json_object(item)) + + return items + + def _unmarshal_json_object(self, input_json): + for key, value in input_json.items(): + if key in self._swagger_name_to_python: + attribute_name = self._swagger_name_to_python[key] + if not self._attribute_is_primitive[attribute_name]: + if attribute_name in models.name_to_class: + value = models.name_to_class[attribute_name]() + value.unmarshal_json(input_json[key]) + else: + attribute_name = key + + self.__setattr__(attribute_name, value) + return self + + +# noinspection SpellCheckingInspection +class LastTrade(Definition): + _swagger_name_to_python = { "price": "price", "size": "size", "exchange": "exchange", @@ -43,7 +64,7 @@ class LastTrade(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "price": True, "size": True, "exchange": True, @@ -55,7 +76,19 @@ class LastTrade(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "price": "int", + "size": "int", + "exchange": "int", + "cond1": "int", + "cond2": "int", + "cond3": "int", + "cond4": "int", + "timestamp": "int", + + } + + def __init__(self): self.price: int self.size: int self.exchange: int @@ -65,12 +98,10 @@ def __init__(self, input_json): self.cond4: int self.timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastQuote(BaseDefinition): - swagger_name_to_python = { +class LastQuote(Definition): + _swagger_name_to_python = { "askprice": "askprice", "asksize": "asksize", "askexchange": "askexchange", @@ -81,7 +112,7 @@ class LastQuote(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "askprice": True, "asksize": True, "askexchange": True, @@ -92,7 +123,18 @@ class LastQuote(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "askprice": "int", + "asksize": "int", + "askexchange": "int", + "bidprice": "int", + "bidsize": "int", + "bidexchange": "int", + "timestamp": "int", + + } + + def __init__(self): self.askprice: int self.asksize: int self.askexchange: int @@ -101,12 +143,10 @@ def __init__(self, input_json): self.bidexchange: int self.timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class HistTrade(BaseDefinition): - swagger_name_to_python = { +class HistTrade(Definition): + _swagger_name_to_python = { "condition1": "condition1", "condition2": "condition2", "condition3": "condition3", @@ -118,7 +158,7 @@ class HistTrade(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "condition1": True, "condition2": True, "condition3": True, @@ -130,7 +170,19 @@ class HistTrade(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "condition1": "int", + "condition2": "int", + "condition3": "int", + "condition4": "int", + "exchange": "str", + "price": "int", + "size": "int", + "timestamp": "str", + + } + + def __init__(self): self.condition1: int self.condition2: int self.condition3: int @@ -140,12 +192,10 @@ def __init__(self, input_json): self.size: int self.timestamp: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Quote(BaseDefinition): - swagger_name_to_python = { +class Quote(Definition): + _swagger_name_to_python = { "c": "condition_of_this_quote", "bE": "bid_exchange", "aE": "ask_exchange", @@ -157,7 +207,7 @@ class Quote(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "condition_of_this_quote": True, "bid_exchange": True, "ask_exchange": True, @@ -169,7 +219,19 @@ class Quote(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "condition_of_this_quote": "int", + "bid_exchange": "str", + "ask_exchange": "str", + "ask_price": "int", + "bid_price": "int", + "bid_size": "int", + "ask_size": "int", + "timestamp_of_this_trade": "int", + + } + + def __init__(self): self.condition_of_this_quote: int self.bid_exchange: str self.ask_exchange: str @@ -179,12 +241,10 @@ def __init__(self, input_json): self.ask_size: int self.timestamp_of_this_trade: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Aggregate(BaseDefinition): - swagger_name_to_python = { +class Aggregate(Definition): + _swagger_name_to_python = { "o": "open_price", "c": "close_price", "l": "low_price", @@ -195,7 +255,7 @@ class Aggregate(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "open_price": True, "close_price": True, "low_price": True, @@ -206,7 +266,18 @@ class Aggregate(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "open_price": "int", + "close_price": "int", + "low_price": "int", + "high_price": "int", + "total_volume_of_all_trades": "int", + "transactions": "int", + "timestamp_of_this_aggregation": "int", + + } + + def __init__(self): self.open_price: int self.close_price: int self.low_price: int @@ -215,12 +286,10 @@ def __init__(self, input_json): self.transactions: int self.timestamp_of_this_aggregation: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Company(BaseDefinition): - swagger_name_to_python = { +class Company(Definition): + _swagger_name_to_python = { "logo": "logo", "exchange": "exchange", "name": "name", @@ -246,7 +315,7 @@ class Company(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "logo": True, "exchange": True, "name": True, @@ -272,7 +341,33 @@ class Company(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "logo": "str", + "exchange": "str", + "name": "str", + "symbol": "StockSymbol", + "listdate": "str", + "cik": "str", + "bloomberg": "str", + "figi": "str", + "lei": "str", + "sic": "float", + "country": "str", + "industry": "str", + "sector": "str", + "marketcap": "float", + "employees": "float", + "phone": "str", + "ceo": "str", + "url": "str", + "description": "str", + "similar": "List[StockSymbol]", + "tags": "List[str]", + "updated": "str", + + } + + def __init__(self): self.logo: str self.exchange: str self.name: str @@ -296,12 +391,10 @@ def __init__(self, input_json): self.tags: List[str] self.updated: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Symbol(BaseDefinition): - swagger_name_to_python = { +class Symbol(Definition): + _swagger_name_to_python = { "symbol": "symbol", "name": "name", "type": "type", @@ -311,7 +404,7 @@ class Symbol(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": False, "name": True, "type": True, @@ -321,7 +414,17 @@ class Symbol(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "StockSymbol", + "name": "str", + "type": "str", + "url": "str", + "updated": "str", + "is___otc": "bool", + + } + + def __init__(self): self.symbol: StockSymbol self.name: str self.type: str @@ -329,12 +432,10 @@ def __init__(self, input_json): self.updated: str self.is___otc: bool - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Dividend(BaseDefinition): - swagger_name_to_python = { +class Dividend(Definition): + _swagger_name_to_python = { "symbol": "symbol", "type": "type", "exDate": "ex_date", @@ -347,7 +448,7 @@ class Dividend(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": False, "type": True, "ex_date": True, @@ -360,7 +461,20 @@ class Dividend(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "StockSymbol", + "type": "str", + "ex_date": "str", + "payment_date": "str", + "record_date": "str", + "declared_date": "str", + "amount": "float", + "qualified": "str", + "flag": "str", + + } + + def __init__(self): self.symbol: StockSymbol self.type: str self.ex_date: str @@ -371,12 +485,10 @@ def __init__(self, input_json): self.qualified: str self.flag: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class News(BaseDefinition): - swagger_name_to_python = { +class News(Definition): + _swagger_name_to_python = { "symbols": "symbols", "title": "title", "url": "url", @@ -388,7 +500,7 @@ class News(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbols": False, "title": True, "url": True, @@ -400,7 +512,19 @@ class News(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbols": "List[StockSymbol]", + "title": "str", + "url": "str", + "source": "str", + "summary": "str", + "image": "str", + "timestamp": "str", + "keywords": "List[str]", + + } + + def __init__(self): self.symbols: List[StockSymbol] self.title: str self.url: str @@ -410,12 +534,10 @@ def __init__(self, input_json): self.timestamp: str self.keywords: List[str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Earning(BaseDefinition): - swagger_name_to_python = { +class Earning(Definition): + _swagger_name_to_python = { "symbol": "symbol", "EPSReportDate": "e___psrep_ortdate", "EPSReportDateStr": "e___psrep_ort_datestr", @@ -433,7 +555,7 @@ class Earning(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": True, "e___psrep_ortdate": True, "e___psrep_ort_datestr": True, @@ -451,7 +573,25 @@ class Earning(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "str", + "e___psrep_ortdate": "str", + "e___psrep_ort_datestr": "str", + "fiscal_period": "str", + "fiscal_en_ddate": "str", + "actual___eps": "float", + "consensus___eps": "float", + "estimated___eps": "float", + "announce_time": "str", + "number_o_festimates": "float", + "e___pssurpr_isedollar": "float", + "year_ago": "float", + "year_ag_ochan_gepercent": "float", + "estimated_chang_epercent": "float", + + } + + def __init__(self): self.symbol: str self.e___psrep_ortdate: str self.e___psrep_ort_datestr: str @@ -467,12 +607,10 @@ def __init__(self, input_json): self.year_ag_ochan_gepercent: float self.estimated_chang_epercent: float - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Financial(BaseDefinition): - swagger_name_to_python = { +class Financial(Definition): + _swagger_name_to_python = { "symbol": "symbol", "reportDate": "report_date", "reportDateStr": "report_dat_estr", @@ -498,7 +636,7 @@ class Financial(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": True, "report_date": True, "report_dat_estr": True, @@ -524,7 +662,33 @@ class Financial(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "str", + "report_date": "str", + "report_dat_estr": "str", + "gross_profit": "float", + "cost_o_frevenue": "float", + "operating_revenue": "float", + "total_revenue": "float", + "operating_income": "float", + "net_income": "float", + "research_an_ddevelopment": "float", + "operating_expense": "float", + "current_assets": "float", + "total_assets": "float", + "total_liabilities": "float", + "current_cash": "float", + "current_debt": "float", + "total_cash": "float", + "total_debt": "float", + "shareholder_equity": "float", + "cash_change": "float", + "cash_flow": "float", + "operating_gain_slosses": "float", + + } + + def __init__(self): self.symbol: str self.report_date: str self.report_dat_estr: str @@ -548,12 +712,10 @@ def __init__(self, input_json): self.cash_flow: float self.operating_gain_slosses: float - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Exchange(BaseDefinition): - swagger_name_to_python = { +class Exchange(Definition): + _swagger_name_to_python = { "id": "i_d_of_the_exchange", "type": "type", "market": "market", @@ -563,7 +725,7 @@ class Exchange(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "i_d_of_the_exchange": True, "type": True, "market": True, @@ -573,7 +735,17 @@ class Exchange(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "i_d_of_the_exchange": "float", + "type": "str", + "market": "str", + "mic": "str", + "name": "str", + "tape": "str", + + } + + def __init__(self): self.i_d_of_the_exchange: float self.type: str self.market: str @@ -581,90 +753,102 @@ def __init__(self, input_json): self.name: str self.tape: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Error(BaseDefinition): - swagger_name_to_python = { +class Error(Definition): + _swagger_name_to_python = { "code": "code", "message": "message", "fields": "fields", } - attribute_is_primitive = { + _attribute_is_primitive = { "code": True, "message": True, "fields": True, } - def __init__(self, input_json): + _attributes_to_types = { + "code": "int", + "message": "str", + "fields": "str", + + } + + def __init__(self): self.code: int self.message: str self.fields: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class NotFound(BaseDefinition): - swagger_name_to_python = { +class NotFound(Definition): + _swagger_name_to_python = { "message": "message", } - attribute_is_primitive = { + _attribute_is_primitive = { "message": True, } - def __init__(self, input_json): - self.message: str + _attributes_to_types = { + "message": "str", - self._unmarshal_json(input_json) + } + def __init__(self): + self.message: str + # noinspection SpellCheckingInspection -class Conflict(BaseDefinition): - swagger_name_to_python = { +class Conflict(Definition): + _swagger_name_to_python = { "message": "message", } - attribute_is_primitive = { + _attribute_is_primitive = { "message": True, } - def __init__(self, input_json): - self.message: str + _attributes_to_types = { + "message": "str", - self._unmarshal_json(input_json) + } + def __init__(self): + self.message: str + # noinspection SpellCheckingInspection -class Unauthorized(BaseDefinition): - swagger_name_to_python = { +class Unauthorized(Definition): + _swagger_name_to_python = { "message": "message", } - attribute_is_primitive = { + _attribute_is_primitive = { "message": True, } - def __init__(self, input_json): - self.message: str + _attributes_to_types = { + "message": "str", - self._unmarshal_json(input_json) + } + def __init__(self): + self.message: str + # noinspection SpellCheckingInspection -class MarketStatus(BaseDefinition): - swagger_name_to_python = { +class MarketStatus(Definition): + _swagger_name_to_python = { "market": "market", "serverTime": "server_time", "exchanges": "exchanges", @@ -672,7 +856,7 @@ class MarketStatus(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "market": True, "server_time": True, "exchanges": True, @@ -680,18 +864,24 @@ class MarketStatus(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "market": "str", + "server_time": "str", + "exchanges": "Dict[str, str]", + "currencies": "Dict[str, str]", + + } + + def __init__(self): self.market: str self.server_time: str self.exchanges: Dict[str, str] self.currencies: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class MarketHoliday(BaseDefinition): - swagger_name_to_python = { +class MarketHoliday(Definition): + _swagger_name_to_python = { "exchange": "exchange", "name": "name", "status": "status", @@ -701,7 +891,7 @@ class MarketHoliday(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "exchange": True, "name": True, "status": True, @@ -711,7 +901,17 @@ class MarketHoliday(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "exchange": "str", + "name": "str", + "status": "str", + "date": "str", + "open": "str", + "close": "str", + + } + + def __init__(self): self.exchange: str self.name: str self.status: str @@ -719,12 +919,10 @@ def __init__(self, input_json): self.open: str self.close: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class AnalystRatings(BaseDefinition): - swagger_name_to_python = { +class AnalystRatings(Definition): + _swagger_name_to_python = { "symbol": "symbol", "analysts": "analysts", "change": "change", @@ -737,7 +935,7 @@ class AnalystRatings(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": True, "analysts": True, "change": True, @@ -750,7 +948,20 @@ class AnalystRatings(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "str", + "analysts": "float", + "change": "float", + "strong_buy": "RatingSection", + "buy": "RatingSection", + "hold": "RatingSection", + "sell": "RatingSection", + "strong_sell": "RatingSection", + "updated": "str", + + } + + def __init__(self): self.symbol: str self.analysts: float self.change: float @@ -761,12 +972,10 @@ def __init__(self, input_json): self.strong_sell: RatingSection self.updated: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class RatingSection(BaseDefinition): - swagger_name_to_python = { +class RatingSection(Definition): + _swagger_name_to_python = { "current": "current", "month1": "month1", "month2": "month2", @@ -776,7 +985,7 @@ class RatingSection(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "current": True, "month1": True, "month2": True, @@ -786,7 +995,17 @@ class RatingSection(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "current": "float", + "month1": "float", + "month2": "float", + "month3": "float", + "month4": "float", + "month5": "float", + + } + + def __init__(self): self.current: float self.month1: float self.month2: float @@ -794,12 +1013,10 @@ def __init__(self, input_json): self.month4: float self.month5: float - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoTick(BaseDefinition): - swagger_name_to_python = { +class CryptoTick(Definition): + _swagger_name_to_python = { "price": "price", "size": "size", "exchange": "exchange", @@ -808,7 +1025,7 @@ class CryptoTick(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "price": True, "size": True, "exchange": True, @@ -817,19 +1034,26 @@ class CryptoTick(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "price": "int", + "size": "int", + "exchange": "int", + "conditions": "List[int]", + "timestamp": "int", + + } + + def __init__(self): self.price: int self.size: int self.exchange: int self.conditions: List[int] self.timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoTickJson(BaseDefinition): - swagger_name_to_python = { +class CryptoTickJson(Definition): + _swagger_name_to_python = { "p": "trade_price", "s": "size_of_the_trade", "x": "exchange_the_trade_occured_on", @@ -838,7 +1062,7 @@ class CryptoTickJson(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "trade_price": True, "size_of_the_trade": True, "exchange_the_trade_occured_on": True, @@ -847,19 +1071,26 @@ class CryptoTickJson(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "trade_price": "int", + "size_of_the_trade": "int", + "exchange_the_trade_occured_on": "int", + "c": "List[int]", + "timestamp_of_this_trade": "int", + + } + + def __init__(self): self.trade_price: int self.size_of_the_trade: int self.exchange_the_trade_occured_on: int self.c: List[int] self.timestamp_of_this_trade: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoExchange(BaseDefinition): - swagger_name_to_python = { +class CryptoExchange(Definition): + _swagger_name_to_python = { "id": "i_d_of_the_exchange", "type": "type", "market": "market", @@ -868,7 +1099,7 @@ class CryptoExchange(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "i_d_of_the_exchange": True, "type": True, "market": True, @@ -877,19 +1108,26 @@ class CryptoExchange(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "i_d_of_the_exchange": "float", + "type": "str", + "market": "str", + "name": "str", + "url": "str", + + } + + def __init__(self): self.i_d_of_the_exchange: float self.type: str self.market: str self.name: str self.url: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoSnapshotTicker(BaseDefinition): - swagger_name_to_python = { +class CryptoSnapshotTicker(Definition): + _swagger_name_to_python = { "ticker": "ticker", "day": "day", "lastTrade": "last_trade", @@ -901,7 +1139,7 @@ class CryptoSnapshotTicker(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "day": False, "last_trade": False, @@ -913,7 +1151,19 @@ class CryptoSnapshotTicker(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "day": "CryptoSnapshotAgg", + "last_trade": "CryptoTickJson", + "min": "CryptoSnapshotAgg", + "prev_day": "CryptoSnapshotAgg", + "todays_change": "int", + "todays_chang_eperc": "int", + "updated": "int", + + } + + def __init__(self): self.ticker: str self.day: CryptoSnapshotAgg self.last_trade: CryptoTickJson @@ -923,33 +1173,35 @@ def __init__(self, input_json): self.todays_chang_eperc: int self.updated: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoSnapshotBookItem(BaseDefinition): - swagger_name_to_python = { +class CryptoSnapshotBookItem(Definition): + _swagger_name_to_python = { "p": "price_of_this_book_level", "x": "exchange_to_size_of_this_price_level", } - attribute_is_primitive = { + _attribute_is_primitive = { "price_of_this_book_level": True, "exchange_to_size_of_this_price_level": True, } - def __init__(self, input_json): + _attributes_to_types = { + "price_of_this_book_level": "int", + "exchange_to_size_of_this_price_level": "Dict[str, str]", + + } + + def __init__(self): self.price_of_this_book_level: int self.exchange_to_size_of_this_price_level: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoSnapshotTickerBook(BaseDefinition): - swagger_name_to_python = { +class CryptoSnapshotTickerBook(Definition): + _swagger_name_to_python = { "ticker": "ticker", "bids": "bids", "asks": "asks", @@ -960,7 +1212,7 @@ class CryptoSnapshotTickerBook(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "bids": False, "asks": False, @@ -971,7 +1223,18 @@ class CryptoSnapshotTickerBook(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "bids": "List[CryptoSnapshotBookItem]", + "asks": "List[CryptoSnapshotBookItem]", + "bid_count": "int", + "ask_count": "int", + "spread": "int", + "updated": "int", + + } + + def __init__(self): self.ticker: str self.bids: List[CryptoSnapshotBookItem] self.asks: List[CryptoSnapshotBookItem] @@ -980,12 +1243,10 @@ def __init__(self, input_json): self.spread: int self.updated: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoSnapshotAgg(BaseDefinition): - swagger_name_to_python = { +class CryptoSnapshotAgg(Definition): + _swagger_name_to_python = { "c": "close_price", "h": "high_price", "l": "low_price", @@ -994,7 +1255,7 @@ class CryptoSnapshotAgg(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "close_price": True, "high_price": True, "low_price": True, @@ -1003,67 +1264,84 @@ class CryptoSnapshotAgg(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "close_price": "int", + "high_price": "int", + "low_price": "int", + "open_price": "int", + "volume": "int", + + } + + def __init__(self): self.close_price: int self.high_price: int self.low_price: int self.open_price: int self.volume: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Forex(BaseDefinition): - swagger_name_to_python = { +class Forex(Definition): + _swagger_name_to_python = { "a": "ask_price", "b": "bid_price", "t": "timestamp_of_this_trade", } - attribute_is_primitive = { + _attribute_is_primitive = { "ask_price": True, "bid_price": True, "timestamp_of_this_trade": True, } - def __init__(self, input_json): + _attributes_to_types = { + "ask_price": "int", + "bid_price": "int", + "timestamp_of_this_trade": "int", + + } + + def __init__(self): self.ask_price: int self.bid_price: int self.timestamp_of_this_trade: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastForexTrade(BaseDefinition): - swagger_name_to_python = { +class LastForexTrade(Definition): + _swagger_name_to_python = { "price": "price", "exchange": "exchange", "timestamp": "timestamp", } - attribute_is_primitive = { + _attribute_is_primitive = { "price": True, "exchange": True, "timestamp": True, } - def __init__(self, input_json): + _attributes_to_types = { + "price": "int", + "exchange": "int", + "timestamp": "int", + + } + + def __init__(self): self.price: int self.exchange: int self.timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastForexQuote(BaseDefinition): - swagger_name_to_python = { +class LastForexQuote(Definition): + _swagger_name_to_python = { "ask": "ask", "bid": "bid", "exchange": "exchange", @@ -1071,7 +1349,7 @@ class LastForexQuote(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ask": True, "bid": True, "exchange": True, @@ -1079,18 +1357,24 @@ class LastForexQuote(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ask": "int", + "bid": "int", + "exchange": "int", + "timestamp": "int", + + } + + def __init__(self): self.ask: int self.bid: int self.exchange: int self.timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class ForexAggregate(BaseDefinition): - swagger_name_to_python = { +class ForexAggregate(Definition): + _swagger_name_to_python = { "o": "open_price", "c": "close_price", "l": "low_price", @@ -1100,7 +1384,7 @@ class ForexAggregate(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "open_price": True, "close_price": True, "low_price": True, @@ -1110,7 +1394,17 @@ class ForexAggregate(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "open_price": "int", + "close_price": "int", + "low_price": "int", + "high_price": "int", + "volume_of_all_trades": "int", + "timestamp_of_this_aggregation": "int", + + } + + def __init__(self): self.open_price: int self.close_price: int self.low_price: int @@ -1118,12 +1412,10 @@ def __init__(self, input_json): self.volume_of_all_trades: int self.timestamp_of_this_aggregation: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class ForexSnapshotTicker(BaseDefinition): - swagger_name_to_python = { +class ForexSnapshotTicker(Definition): + _swagger_name_to_python = { "ticker": "ticker", "day": "day", "lastTrade": "last_trade", @@ -1135,7 +1427,7 @@ class ForexSnapshotTicker(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "day": False, "last_trade": False, @@ -1147,7 +1439,19 @@ class ForexSnapshotTicker(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "day": "ForexSnapshotAgg", + "last_trade": "Forex", + "min": "ForexSnapshotAgg", + "prev_day": "ForexSnapshotAgg", + "todays_change": "int", + "todays_chang_eperc": "int", + "updated": "int", + + } + + def __init__(self): self.ticker: str self.day: ForexSnapshotAgg self.last_trade: Forex @@ -1157,12 +1461,10 @@ def __init__(self, input_json): self.todays_chang_eperc: int self.updated: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class ForexSnapshotAgg(BaseDefinition): - swagger_name_to_python = { +class ForexSnapshotAgg(Definition): + _swagger_name_to_python = { "c": "close_price", "h": "high_price", "l": "low_price", @@ -1171,7 +1473,7 @@ class ForexSnapshotAgg(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "close_price": True, "high_price": True, "low_price": True, @@ -1180,19 +1482,26 @@ class ForexSnapshotAgg(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "close_price": "int", + "high_price": "int", + "low_price": "int", + "open_price": "int", + "volume": "int", + + } + + def __init__(self): self.close_price: int self.high_price: int self.low_price: int self.open_price: int self.volume: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Ticker(BaseDefinition): - swagger_name_to_python = { +class Ticker(Definition): + _swagger_name_to_python = { "ticker": "ticker", "name": "name", "market": "market", @@ -1207,7 +1516,7 @@ class Ticker(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": False, "name": True, "market": True, @@ -1222,7 +1531,22 @@ class Ticker(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "StockSymbol", + "name": "str", + "market": "str", + "locale": "str", + "currency": "str", + "active": "bool", + "primary_exch": "str", + "url": "str", + "updated": "str", + "attrs": "Dict[str, str]", + "codes": "Dict[str, str]", + + } + + def __init__(self): self.ticker: StockSymbol self.name: str self.market: str @@ -1235,12 +1559,10 @@ def __init__(self, input_json): self.attrs: Dict[str, str] self.codes: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Split(BaseDefinition): - swagger_name_to_python = { +class Split(Definition): + _swagger_name_to_python = { "ticker": "ticker", "exDate": "ex_date", "paymentDate": "payment_date", @@ -1252,7 +1574,7 @@ class Split(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": False, "ex_date": True, "payment_date": True, @@ -1264,7 +1586,19 @@ class Split(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "TickerSymbol", + "ex_date": "str", + "payment_date": "str", + "record_date": "str", + "declared_date": "str", + "ratio": "float", + "tofactor": "float", + "forfactor": "float", + + } + + def __init__(self): self.ticker: TickerSymbol self.ex_date: str self.payment_date: str @@ -1274,12 +1608,10 @@ def __init__(self, input_json): self.tofactor: float self.forfactor: float - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Financials(BaseDefinition): - swagger_name_to_python = { +class Financials(Definition): + _swagger_name_to_python = { "ticker": "ticker", "period": "period", "calendarDate": "calendar_date", @@ -1393,7 +1725,7 @@ class Financials(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": False, "period": True, "calendar_date": True, @@ -1507,7 +1839,121 @@ class Financials(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "TickerSymbol", + "period": "str", + "calendar_date": "str", + "report_period": "str", + "updated": "str", + "accumulated_othe_rcomprehensi_veincome": "int", + "assets": "int", + "assets_average": "int", + "assets_current": "int", + "asset_turnover": "int", + "assets_no_ncurrent": "int", + "book_valu_ep_ershare": "int", + "capital_expenditure": "int", + "cash_an_dequivalents": "int", + "cash_an_dequivalen___tsusd": "int", + "cost_o_frevenue": "int", + "consolidated_income": "int", + "current_ratio": "int", + "debt_t_oequi_tyratio": "int", + "debt": "int", + "debt_current": "int", + "debt_no_ncurrent": "int", + "debt___usd": "int", + "deferred_revenue": "int", + "depreciation_amortizatio_na_ndaccretion": "int", + "deposits": "int", + "dividend_yield": "int", + "dividends_pe_rbas_iccom_monshare": "int", + "earning_befor_eintere_sttaxes": "int", + "earnings_befor_eintere_stta_xesdeprecia_tionamortization": "int", + "e______bitdamargin": "int", + "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd": "int", + "earning_befor_eintere_stta___xesusd": "int", + "earnings_befor_etax": "int", + "earnings_pe_rbas_icshare": "int", + "earnings_pe_rdilut_edshare": "int", + "earnings_pe_rbas_icsh___areusd": "int", + "shareholders_equity": "int", + "average_equity": "int", + "shareholders_equit___yusd": "int", + "enterprise_value": "int", + "enterprise_valu_eov____erebit": "int", + "enterprise_valu_eov______erebitda": "int", + "free_cas_hflow": "int", + "free_cas_hfl_ow_pershare": "int", + "foreign_currenc____yusdexc_hangerate": "int", + "gross_profit": "int", + "gross_margin": "int", + "goodwill_an_dintangib_leassets": "int", + "interest_expense": "int", + "invested_capital": "int", + "invested_capita_laverage": "int", + "inventory": "int", + "investments": "int", + "investments_current": "int", + "investments_no_ncurrent": "int", + "total_liabilities": "int", + "current_liabilities": "int", + "liabilities_no_ncurrent": "int", + "market_capitalization": "int", + "net_cas_hflow": "int", + "net_cas_hfl_owbusin_essacquisit_ionsdisposals": "int", + "issuance_equit_yshares": "int", + "issuance_deb_tsecurities": "int", + "payment_dividend_soth_erc_ashdistributions": "int", + "net_cas_hfl_owf_romfinancing": "int", + "net_cas_hfl_owf_rominvesting": "int", + "net_cas_hfl_owinvestm_entacquisit_ionsdisposals": "int", + "net_cas_hfl_owf_romoperations": "int", + "effect_o_fexchan_ger_atecha_n_gesoncash": "int", + "net_income": "int", + "net_incom_ecomm_onstock": "int", + "net_incom_ecomm_onst___ockusd": "int", + "net_los_sinco_mef_romdisconti_nuedoperations": "int", + "net_incom_e_to_noncontrol_linginterests": "int", + "profit_margin": "int", + "operating_expenses": "int", + "operating_income": "int", + "trade_an_dn_ontr_adepayables": "int", + "payout_ratio": "int", + "price_t_obo_okvalue": "int", + "price_earnings": "int", + "price_t_oearnin_gsratio": "int", + "property_plan_tequipme_ntnet": "int", + "preferred_dividend_sinco_mestatem_entimpact": "int", + "share_pric_eadjust_edclose": "int", + "price_sales": "int", + "price_t_osal_esratio": "int", + "trade_an_dn_ontr_adereceivables": "int", + "accumulated_retaine_dearnin_gsdeficit": "int", + "revenues": "int", + "revenues___usd": "int", + "research_an_ddevelopme_ntexpense": "int", + "return_o_navera_geassets": "int", + "return_o_navera_geequity": "int", + "return_o_ninvest_edcapital": "int", + "return_o_nsales": "int", + "share_base_dcompensation": "int", + "selling_genera_la_ndadministrat_iveexpense": "int", + "share_factor": "int", + "shares": "int", + "weighted_averag_eshares": "int", + "weighted_averag_eshar_esdiluted": "int", + "sales_pe_rshare": "int", + "tangible_asse_tvalue": "int", + "tax_assets": "int", + "income_ta_xexpense": "int", + "tax_liabilities": "int", + "tangible_asset_sbo_okva_lu_epershare": "int", + "working_capital": "int", + + } + + def __init__(self): self.ticker: TickerSymbol self.period: str self.calendar_date: str @@ -1619,12 +2065,10 @@ def __init__(self, input_json): self.tangible_asset_sbo_okva_lu_epershare: int self.working_capital: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Trade(BaseDefinition): - swagger_name_to_python = { +class Trade(Definition): + _swagger_name_to_python = { "c1": "condition_1_of_this_trade", "c2": "condition_2_of_this_trade", "c3": "condition_3_of_this_trade", @@ -1636,7 +2080,7 @@ class Trade(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "condition_1_of_this_trade": True, "condition_2_of_this_trade": True, "condition_3_of_this_trade": True, @@ -1648,7 +2092,19 @@ class Trade(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "condition_1_of_this_trade": "int", + "condition_2_of_this_trade": "int", + "condition_3_of_this_trade": "int", + "condition_4_of_this_trade": "int", + "the_exchange_this_trade_happened_on": "str", + "price_of_the_trade": "int", + "size_of_the_trade": "int", + "timestamp_of_this_trade": "int", + + } + + def __init__(self): self.condition_1_of_this_trade: int self.condition_2_of_this_trade: int self.condition_3_of_this_trade: int @@ -1658,12 +2114,10 @@ def __init__(self, input_json): self.size_of_the_trade: int self.timestamp_of_this_trade: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksSnapshotTicker(BaseDefinition): - swagger_name_to_python = { +class StocksSnapshotTicker(Definition): + _swagger_name_to_python = { "ticker": "ticker", "day": "day", "lastTrade": "last_trade", @@ -1676,7 +2130,7 @@ class StocksSnapshotTicker(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "day": False, "last_trade": False, @@ -1689,7 +2143,20 @@ class StocksSnapshotTicker(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "day": "StocksSnapshotAgg", + "last_trade": "Trade", + "last_quote": "StocksSnapshotQuote", + "min": "StocksSnapshotAgg", + "prev_day": "StocksSnapshotAgg", + "todays_change": "int", + "todays_chang_eperc": "int", + "updated": "int", + + } + + def __init__(self): self.ticker: str self.day: StocksSnapshotAgg self.last_trade: Trade @@ -1700,33 +2167,35 @@ def __init__(self, input_json): self.todays_chang_eperc: int self.updated: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksSnapshotBookItem(BaseDefinition): - swagger_name_to_python = { +class StocksSnapshotBookItem(Definition): + _swagger_name_to_python = { "p": "price_of_this_book_level", "x": "exchange_to_size_of_this_price_level", } - attribute_is_primitive = { + _attribute_is_primitive = { "price_of_this_book_level": True, "exchange_to_size_of_this_price_level": True, } - def __init__(self, input_json): + _attributes_to_types = { + "price_of_this_book_level": "int", + "exchange_to_size_of_this_price_level": "Dict[str, str]", + + } + + def __init__(self): self.price_of_this_book_level: int self.exchange_to_size_of_this_price_level: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksSnapshotTickerBook(BaseDefinition): - swagger_name_to_python = { +class StocksSnapshotTickerBook(Definition): + _swagger_name_to_python = { "ticker": "ticker", "bids": "bids", "asks": "asks", @@ -1737,7 +2206,7 @@ class StocksSnapshotTickerBook(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "bids": False, "asks": False, @@ -1748,7 +2217,18 @@ class StocksSnapshotTickerBook(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "bids": "List[StocksSnapshotBookItem]", + "asks": "List[StocksSnapshotBookItem]", + "bid_count": "int", + "ask_count": "int", + "spread": "int", + "updated": "int", + + } + + def __init__(self): self.ticker: str self.bids: List[StocksSnapshotBookItem] self.asks: List[StocksSnapshotBookItem] @@ -1757,12 +2237,10 @@ def __init__(self, input_json): self.spread: int self.updated: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksV2Trade(BaseDefinition): - swagger_name_to_python = { +class StocksV2Trade(Definition): + _swagger_name_to_python = { "T": "ticker_of_the_object", "t": "nanosecond_accuracy_s__ip_unix_timestamp", "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", @@ -1777,7 +2255,7 @@ class StocksV2Trade(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker_of_the_object": True, "nanosecond_accuracy_s__ip_unix_timestamp": True, "nanosecond_accuracy_participant_exchange_unix_timestamp": True, @@ -1792,7 +2270,22 @@ class StocksV2Trade(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker_of_the_object": "str", + "nanosecond_accuracy_s__ip_unix_timestamp": "int", + "nanosecond_accuracy_participant_exchange_unix_timestamp": "int", + "nanosecond_accuracy_t__rf": "int", + "sequence_number": "int", + "trade_i_d": "str", + "exchange_i_d": "int", + "size_volume_of_the_trade": "int", + "c": "List[int]", + "price_of_the_trade": "int", + "tape_where_trade_occured": "int", + + } + + def __init__(self): self.ticker_of_the_object: str self.nanosecond_accuracy_s__ip_unix_timestamp: int self.nanosecond_accuracy_participant_exchange_unix_timestamp: int @@ -1805,12 +2298,10 @@ def __init__(self, input_json): self.price_of_the_trade: int self.tape_where_trade_occured: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksV2NBBO(BaseDefinition): - swagger_name_to_python = { +class StocksV2NBBO(Definition): + _swagger_name_to_python = { "T": "ticker_of_the_object", "t": "nanosecond_accuracy_s__ip_unix_timestamp", "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", @@ -1828,7 +2319,7 @@ class StocksV2NBBO(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker_of_the_object": True, "nanosecond_accuracy_s__ip_unix_timestamp": True, "nanosecond_accuracy_participant_exchange_unix_timestamp": True, @@ -1846,7 +2337,25 @@ class StocksV2NBBO(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker_of_the_object": "str", + "nanosecond_accuracy_s__ip_unix_timestamp": "int", + "nanosecond_accuracy_participant_exchange_unix_timestamp": "int", + "nanosecond_accuracy_t__rf": "int", + "sequence_number": "int", + "c": "List[int]", + "i": "List[int]", + "b__id_price": "int", + "b__id_exchange__id": "int", + "b__id_size": "int", + "a__sk_price": "int", + "a__sk_exchange__id": "int", + "a__sk_size": "int", + "tape_where_trade_occured": "int", + + } + + def __init__(self): self.ticker_of_the_object: str self.nanosecond_accuracy_s__ip_unix_timestamp: int self.nanosecond_accuracy_participant_exchange_unix_timestamp: int @@ -1862,12 +2371,10 @@ def __init__(self, input_json): self.a__sk_size: int self.tape_where_trade_occured: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksSnapshotAgg(BaseDefinition): - swagger_name_to_python = { +class StocksSnapshotAgg(Definition): + _swagger_name_to_python = { "c": "close_price", "h": "high_price", "l": "low_price", @@ -1876,7 +2383,7 @@ class StocksSnapshotAgg(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "close_price": True, "high_price": True, "low_price": True, @@ -1885,19 +2392,26 @@ class StocksSnapshotAgg(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "close_price": "int", + "high_price": "int", + "low_price": "int", + "open_price": "int", + "volume": "int", + + } + + def __init__(self): self.close_price: int self.high_price: int self.low_price: int self.open_price: int self.volume: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StocksSnapshotQuote(BaseDefinition): - swagger_name_to_python = { +class StocksSnapshotQuote(Definition): + _swagger_name_to_python = { "p": "bid_price", "s": "bid_size_in_lots", "P": "ask_price", @@ -1906,7 +2420,7 @@ class StocksSnapshotQuote(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "bid_price": True, "bid_size_in_lots": True, "ask_price": True, @@ -1915,19 +2429,26 @@ class StocksSnapshotQuote(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "bid_price": "int", + "bid_size_in_lots": "int", + "ask_price": "int", + "ask_size_in_lots": "int", + "last_updated_timestamp": "int", + + } + + def __init__(self): self.bid_price: int self.bid_size_in_lots: int self.ask_price: int self.ask_size_in_lots: int self.last_updated_timestamp: int - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class Aggv2(BaseDefinition): - swagger_name_to_python = { +class Aggv2(Definition): + _swagger_name_to_python = { "T": "ticker_symbol", "v": "volume", "o": "open", @@ -1939,7 +2460,7 @@ class Aggv2(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker_symbol": True, "volume": True, "open": True, @@ -1951,7 +2472,19 @@ class Aggv2(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker_symbol": "str", + "volume": "int", + "open": "int", + "close": "int", + "high": "int", + "low": "int", + "unix_msec_timestamp": "float", + "number_of_items_in_aggregate_window": "float", + + } + + def __init__(self): self.ticker_symbol: str self.volume: int self.open: int @@ -1961,12 +2494,10 @@ def __init__(self, input_json): self.unix_msec_timestamp: float self.number_of_items_in_aggregate_window: float - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class AggResponse(BaseDefinition): - swagger_name_to_python = { +class AggResponse(Definition): + _swagger_name_to_python = { "ticker": "ticker", "status": "status", "adjusted": "adjusted", @@ -1976,7 +2507,7 @@ class AggResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "ticker": True, "status": True, "adjusted": True, @@ -1986,7 +2517,17 @@ class AggResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "ticker": "str", + "status": "str", + "adjusted": "bool", + "query_count": "float", + "results_count": "float", + "results": "List[Aggv2]", + + } + + def __init__(self): self.ticker: str self.status: str self.adjusted: bool @@ -1994,255 +2535,298 @@ def __init__(self, input_json): self.results_count: float self.results: List[Aggv2] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class TickersApiResponse(BaseDefinition): - swagger_name_to_python = { - "Symbol": "symbol", +class TickersApiResponse(Definition): + _swagger_name_to_python = { + "symbol": "symbol", } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": False, } - def __init__(self, input_json): - self.symbol: List[Symbol] + _attributes_to_types = { + "symbol": "List[Symbol]", - self._unmarshal_json(input_json) + } + def __init__(self): + self.symbol: List[Symbol] + # noinspection SpellCheckingInspection -class TickerTypesApiResponse(BaseDefinition): - swagger_name_to_python = { +class TickerTypesApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "results": True, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "results": "Dict[str, str]", + + } + + def __init__(self): self.status: str self.results: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class TickerDetailsApiResponse(BaseDefinition): - swagger_name_to_python = { +class TickerDetailsApiResponse(Definition): + _swagger_name_to_python = { "company": "company", } - attribute_is_primitive = { + _attribute_is_primitive = { "company": False, } - def __init__(self, input_json): - self.company: Company + _attributes_to_types = { + "company": "Company", - self._unmarshal_json(input_json) + } + def __init__(self): + self.company: Company + # noinspection SpellCheckingInspection -class TickerNewsApiResponse(BaseDefinition): - swagger_name_to_python = { - "News": "news", +class TickerNewsApiResponse(Definition): + _swagger_name_to_python = { + "news": "news", } - attribute_is_primitive = { + _attribute_is_primitive = { "news": False, } - def __init__(self, input_json): - self.news: List[News] + _attributes_to_types = { + "news": "List[News]", - self._unmarshal_json(input_json) + } + def __init__(self): + self.news: List[News] + # noinspection SpellCheckingInspection -class MarketsApiResponse(BaseDefinition): - swagger_name_to_python = { +class MarketsApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "results": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "results": "List[Dict[str, str]]", + + } + + def __init__(self): self.status: str self.results: List[Dict[str, str]] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LocalesApiResponse(BaseDefinition): - swagger_name_to_python = { +class LocalesApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "results": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "results": "List[Dict[str, str]]", + + } + + def __init__(self): self.status: str self.results: List[Dict[str, str]] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StockSplitsApiResponse(BaseDefinition): - swagger_name_to_python = { +class StockSplitsApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "count": True, "results": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "count": "float", + "results": "List[Split]", + + } + + def __init__(self): self.status: str self.count: float self.results: List[Split] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StockDividendsApiResponse(BaseDefinition): - swagger_name_to_python = { +class StockDividendsApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "count": True, "results": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "count": "float", + "results": "List[Dividend]", + + } + + def __init__(self): self.status: str self.count: float self.results: List[Dividend] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class StockFinancialsApiResponse(BaseDefinition): - swagger_name_to_python = { +class StockFinancialsApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "count": True, "results": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "count": "float", + "results": "List[Financials]", + + } + + def __init__(self): self.status: str self.count: float self.results: List[Financials] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class MarketStatusApiResponse(BaseDefinition): - swagger_name_to_python = { +class MarketStatusApiResponse(Definition): + _swagger_name_to_python = { "marketstatus": "marketstatus", } - attribute_is_primitive = { + _attribute_is_primitive = { "marketstatus": False, } - def __init__(self, input_json): - self.marketstatus: MarketStatus + _attributes_to_types = { + "marketstatus": "MarketStatus", - self._unmarshal_json(input_json) + } + def __init__(self): + self.marketstatus: MarketStatus + # noinspection SpellCheckingInspection -class MarketHolidaysApiResponse(BaseDefinition): - swagger_name_to_python = { - "MarketHoliday": "market_holiday", +class MarketHolidaysApiResponse(Definition): + _swagger_name_to_python = { + "marketholiday": "marketholiday", } - attribute_is_primitive = { - "market_holiday": False, + _attribute_is_primitive = { + "marketholiday": False, } - def __init__(self, input_json): - self.market_holiday: List[MarketHoliday] + _attributes_to_types = { + "marketholiday": "List[MarketHoliday]", - self._unmarshal_json(input_json) + } + def __init__(self): + self.marketholiday: List[MarketHoliday] + # noinspection SpellCheckingInspection -class ExchangesApiResponse(BaseDefinition): - swagger_name_to_python = { - "Exchange": "exchange", +class ExchangesApiResponse(Definition): + _swagger_name_to_python = { + "exchange": "exchange", } - attribute_is_primitive = { + _attribute_is_primitive = { "exchange": False, } - def __init__(self, input_json): - self.exchange: List[Exchange] + _attributes_to_types = { + "exchange": "List[Exchange]", - self._unmarshal_json(input_json) + } + def __init__(self): + self.exchange: List[Exchange] + # noinspection SpellCheckingInspection -class HistoricTradesApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricTradesApiResponse(Definition): + _swagger_name_to_python = { "day": "day", "map": "map", "msLatency": "ms_latency", @@ -2252,7 +2836,7 @@ class HistoricTradesApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "day": True, "map": True, "ms_latency": True, @@ -2262,7 +2846,17 @@ class HistoricTradesApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "day": "str", + "map": "Dict[str, str]", + "ms_latency": "int", + "status": "str", + "symbol": "str", + "ticks": "List[Trade]", + + } + + def __init__(self): self.day: str self.map: Dict[str, str] self.ms_latency: int @@ -2270,12 +2864,10 @@ def __init__(self, input_json): self.symbol: str self.ticks: List[Trade] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class HistoricTradesV2ApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricTradesV2ApiResponse(Definition): + _swagger_name_to_python = { "results_count": "results_count", "db_latency": "db_latency", "success": "success", @@ -2284,7 +2876,7 @@ class HistoricTradesV2ApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "results_count": True, "db_latency": True, "success": True, @@ -2293,19 +2885,26 @@ class HistoricTradesV2ApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "results_count": "int", + "db_latency": "int", + "success": "bool", + "ticker": "str", + "results": "List[StocksV2Trade]", + + } + + def __init__(self): self.results_count: int self.db_latency: int self.success: bool self.ticker: str self.results: List[StocksV2Trade] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class HistoricQuotesApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricQuotesApiResponse(Definition): + _swagger_name_to_python = { "day": "day", "map": "map", "msLatency": "ms_latency", @@ -2315,7 +2914,7 @@ class HistoricQuotesApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "day": True, "map": True, "ms_latency": True, @@ -2325,7 +2924,17 @@ class HistoricQuotesApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "day": "str", + "map": "Dict[str, str]", + "ms_latency": "int", + "status": "str", + "symbol": "str", + "ticks": "List[Quote]", + + } + + def __init__(self): self.day: str self.map: Dict[str, str] self.ms_latency: int @@ -2333,12 +2942,10 @@ def __init__(self, input_json): self.symbol: str self.ticks: List[Quote] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class HistoricNBboQuotesV2ApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricNBboQuotesV2ApiResponse(Definition): + _swagger_name_to_python = { "results_count": "results_count", "db_latency": "db_latency", "success": "success", @@ -2347,7 +2954,7 @@ class HistoricNBboQuotesV2ApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "results_count": True, "db_latency": True, "success": True, @@ -2356,67 +2963,84 @@ class HistoricNBboQuotesV2ApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "results_count": "int", + "db_latency": "int", + "success": "bool", + "ticker": "str", + "results": "List[StocksV2NBBO]", + + } + + def __init__(self): self.results_count: int self.db_latency: int self.success: bool self.ticker: str self.results: List[StocksV2NBBO] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastTradeForASymbolApiResponse(BaseDefinition): - swagger_name_to_python = { +class LastTradeForASymbolApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "symbol": True, "last": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "symbol": "str", + "last": "LastTrade", + + } + + def __init__(self): self.status: str self.symbol: str self.last: LastTrade - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastQuoteForASymbolApiResponse(BaseDefinition): - swagger_name_to_python = { +class LastQuoteForASymbolApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "symbol": True, "last": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "symbol": "str", + "last": "LastQuote", + + } + + def __init__(self): self.status: str self.symbol: str self.last: LastQuote - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class DailyOpenCloseApiResponse(BaseDefinition): - swagger_name_to_python = { +class DailyOpenCloseApiResponse(Definition): + _swagger_name_to_python = { "symbol": "symbol", "open": "open", "close": "close", @@ -2424,7 +3048,7 @@ class DailyOpenCloseApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": True, "open": False, "close": False, @@ -2432,153 +3056,183 @@ class DailyOpenCloseApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "str", + "open": "HistTrade", + "close": "HistTrade", + "after_hours": "HistTrade", + + } + + def __init__(self): self.symbol: str self.open: HistTrade self.close: HistTrade self.after_hours: HistTrade - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class ConditionMappingsApiResponse(BaseDefinition): - swagger_name_to_python = { +class ConditionMappingsApiResponse(Definition): + _swagger_name_to_python = { "conditiontypemap": "conditiontypemap", } - attribute_is_primitive = { + _attribute_is_primitive = { "conditiontypemap": False, } - def __init__(self, input_json): - self.conditiontypemap: ConditionTypeMap + _attributes_to_types = { + "conditiontypemap": "ConditionTypeMap", - self._unmarshal_json(input_json) + } + def __init__(self): + self.conditiontypemap: ConditionTypeMap + # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotAllTickersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[StocksSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[StocksSnapshotTicker] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotSingleTickerApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotSingleTickerApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "ticker": "ticker", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "ticker": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "ticker": "StocksSnapshotTicker", + + } + + def __init__(self): self.status: str self.ticker: StocksSnapshotTicker - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotGainersLosersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[StocksSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[StocksSnapshotTicker] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class PreviousCloseApiResponse(BaseDefinition): - swagger_name_to_python = { +class PreviousCloseApiResponse(Definition): + _swagger_name_to_python = { "aggresponse": "aggresponse", } - attribute_is_primitive = { + _attribute_is_primitive = { "aggresponse": False, } - def __init__(self, input_json): - self.aggresponse: AggResponse + _attributes_to_types = { + "aggresponse": "AggResponse", - self._unmarshal_json(input_json) + } + def __init__(self): + self.aggresponse: AggResponse + # noinspection SpellCheckingInspection -class AggregatesApiResponse(BaseDefinition): - swagger_name_to_python = { +class AggregatesApiResponse(Definition): + _swagger_name_to_python = { "aggresponse": "aggresponse", } - attribute_is_primitive = { + _attribute_is_primitive = { "aggresponse": False, } - def __init__(self, input_json): - self.aggresponse: AggResponse + _attributes_to_types = { + "aggresponse": "AggResponse", - self._unmarshal_json(input_json) + } + def __init__(self): + self.aggresponse: AggResponse + # noinspection SpellCheckingInspection -class GroupedDailyApiResponse(BaseDefinition): - swagger_name_to_python = { +class GroupedDailyApiResponse(Definition): + _swagger_name_to_python = { "aggresponse": "aggresponse", } - attribute_is_primitive = { + _attribute_is_primitive = { "aggresponse": False, } - def __init__(self, input_json): - self.aggresponse: AggResponse + _attributes_to_types = { + "aggresponse": "AggResponse", - self._unmarshal_json(input_json) + } + def __init__(self): + self.aggresponse: AggResponse + # noinspection SpellCheckingInspection -class HistoricForexTicksApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricForexTicksApiResponse(Definition): + _swagger_name_to_python = { "day": "day", "map": "map", "msLatency": "ms_latency", @@ -2588,7 +3242,7 @@ class HistoricForexTicksApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "day": True, "map": True, "ms_latency": True, @@ -2598,7 +3252,17 @@ class HistoricForexTicksApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "day": "str", + "map": "Dict[str, str]", + "ms_latency": "int", + "status": "str", + "pair": "str", + "ticks": "List[Forex]", + + } + + def __init__(self): self.day: str self.map: Dict[str, str] self.ms_latency: int @@ -2606,12 +3270,10 @@ def __init__(self, input_json): self.pair: str self.ticks: List[Forex] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class RealTimeCurrencyConversionApiResponse(BaseDefinition): - swagger_name_to_python = { +class RealTimeCurrencyConversionApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "from": "from_", "to": "to_currency_symbol", @@ -2622,7 +3284,7 @@ class RealTimeCurrencyConversionApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "from_": True, "to_currency_symbol": True, @@ -2633,7 +3295,18 @@ class RealTimeCurrencyConversionApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "from_": "str", + "to_currency_symbol": "str", + "initial_amount": "float", + "converted": "float", + "last_trade": "LastForexTrade", + "symbol": "str", + + } + + def __init__(self): self.status: str self.from_: str self.to_currency_symbol: str @@ -2642,96 +3315,110 @@ def __init__(self, input_json): self.last_trade: LastForexTrade self.symbol: str - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class LastQuoteForACurrencyPairApiResponse(BaseDefinition): - swagger_name_to_python = { +class LastQuoteForACurrencyPairApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "symbol": True, "last": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "symbol": "str", + "last": "LastForexQuote", + + } + + def __init__(self): self.status: str self.symbol: str self.last: LastForexQuote - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotAllTickersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[ForexSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[ForexSnapshotTicker] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotGainersLosersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[ForexSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[ForexSnapshotTicker] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class CryptoExchangesApiResponse(BaseDefinition): - swagger_name_to_python = { - "CryptoExchange": "crypto_exchange", +class CryptoExchangesApiResponse(Definition): + _swagger_name_to_python = { + "cryptoexchange": "cryptoexchange", } - attribute_is_primitive = { - "crypto_exchange": False, + _attribute_is_primitive = { + "cryptoexchange": False, } - def __init__(self, input_json): - self.crypto_exchange: List[CryptoExchange] + _attributes_to_types = { + "cryptoexchange": "List[CryptoExchange]", - self._unmarshal_json(input_json) + } + def __init__(self): + self.cryptoexchange: List[CryptoExchange] + # noinspection SpellCheckingInspection -class LastTradeForACryptoPairApiResponse(BaseDefinition): - swagger_name_to_python = { +class LastTradeForACryptoPairApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", @@ -2739,7 +3426,7 @@ class LastTradeForACryptoPairApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "symbol": True, "last": False, @@ -2747,18 +3434,24 @@ class LastTradeForACryptoPairApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "symbol": "str", + "last": "CryptoTick", + "last_average": "Dict[str, str]", + + } + + def __init__(self): self.status: str self.symbol: str self.last: CryptoTick self.last_average: Dict[str, str] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class DailyOpenCloseApiResponse(BaseDefinition): - swagger_name_to_python = { +class DailyOpenCloseApiResponse(Definition): + _swagger_name_to_python = { "symbol": "symbol", "isUTC": "is___utc", "day": "day", @@ -2769,7 +3462,7 @@ class DailyOpenCloseApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "symbol": True, "is___utc": True, "day": True, @@ -2780,7 +3473,18 @@ class DailyOpenCloseApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "symbol": "str", + "is___utc": "bool", + "day": "str", + "open": "int", + "close": "int", + "open_trades": "List[CryptoTickJson]", + "closing_trades": "List[CryptoTickJson]", + + } + + def __init__(self): self.symbol: str self.is___utc: bool self.day: str @@ -2789,12 +3493,10 @@ def __init__(self, input_json): self.open_trades: List[CryptoTickJson] self.closing_trades: List[CryptoTickJson] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class HistoricCryptoTradesApiResponse(BaseDefinition): - swagger_name_to_python = { +class HistoricCryptoTradesApiResponse(Definition): + _swagger_name_to_python = { "day": "day", "map": "map", "msLatency": "ms_latency", @@ -2804,7 +3506,7 @@ class HistoricCryptoTradesApiResponse(BaseDefinition): } - attribute_is_primitive = { + _attribute_is_primitive = { "day": True, "map": True, "ms_latency": True, @@ -2814,7 +3516,17 @@ class HistoricCryptoTradesApiResponse(BaseDefinition): } - def __init__(self, input_json): + _attributes_to_types = { + "day": "str", + "map": "Dict[str, str]", + "ms_latency": "int", + "status": "str", + "symbol": "str", + "ticks": "List[CryptoTickJson]", + + } + + def __init__(self): self.day: str self.map: Dict[str, str] self.ms_latency: int @@ -2822,89 +3534,103 @@ def __init__(self, input_json): self.symbol: str self.ticks: List[CryptoTickJson] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotAllTickersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[CryptoSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[CryptoSnapshotTicker] - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotSingleTickerApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotSingleTickerApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "ticker": "ticker", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "ticker": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "ticker": "CryptoSnapshotTicker", + + } + + def __init__(self): self.status: str self.ticker: CryptoSnapshotTicker - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotSingleTickerFullBookApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotSingleTickerFullBookApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "data": "data", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "data": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "data": "CryptoSnapshotTickerBook", + + } + + def __init__(self): self.status: str self.data: CryptoSnapshotTickerBook - self._unmarshal_json(input_json) - # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(BaseDefinition): - swagger_name_to_python = { +class SnapshotGainersLosersApiResponse(Definition): + _swagger_name_to_python = { "status": "status", "tickers": "tickers", } - attribute_is_primitive = { + _attribute_is_primitive = { "status": True, "tickers": False, } - def __init__(self, input_json): + _attributes_to_types = { + "status": "str", + "tickers": "List[CryptoSnapshotTicker]", + + } + + def __init__(self): self.status: str self.tickers: List[CryptoSnapshotTicker] - self._unmarshal_json(input_json) - diff --git a/polygon/rest/models/unmarshal.py b/polygon/rest/models/unmarshal.py index 23603dc4..70b08a76 100644 --- a/polygon/rest/models/unmarshal.py +++ b/polygon/rest/models/unmarshal.py @@ -1,51 +1,7 @@ -from typing import Dict, Callable - from polygon.rest import models -# noinspection SpellCheckingInspection -classes: Dict[str, Callable] = { - "tickers": models.TickersApiResponse, - "ticker_types": models.TickerTypesApiResponse, - "ticker_details": models.TickerDetailsApiResponse, - "ticker_news": models.TickerNewsApiResponse, - "markets": models.MarketsApiResponse, - "locales": models.LocalesApiResponse, - "stock_splits": models.StockSplitsApiResponse, - "stock_dividends": models.StockDividendsApiResponse, - "stock_financials": models.StockFinancialsApiResponse, - "market_status": models.MarketStatusApiResponse, - "market_holidays": models.MarketHolidaysApiResponse, - "exchanges": models.ExchangesApiResponse, - "historic_trades": models.HistoricTradesApiResponse, - "historic_trades_v2": models.HistoricTradesV2ApiResponse, - "historic_quotes": models.HistoricQuotesApiResponse, - "historic_n___bbo_quotes_v2": models.HistoricNBboQuotesV2ApiResponse, - "last_trade_for_a_symbol": models.LastTradeForASymbolApiResponse, - "last_quote_for_a_symbol": models.LastQuoteForASymbolApiResponse, - "daily_open_close": models.DailyOpenCloseApiResponse, - "condition_mappings": models.ConditionMappingsApiResponse, - "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, - "snapshot_single_ticker": models.SnapshotSingleTickerApiResponse, - "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, - "previous_close": models.PreviousCloseApiResponse, - "aggregates": models.AggregatesApiResponse, - "grouped_daily": models.GroupedDailyApiResponse, - "historic_forex_ticks": models.HistoricForexTicksApiResponse, - "real_time_currency_conversion": models.RealTimeCurrencyConversionApiResponse, - "last_quote_for_a_currency_pair": models.LastQuoteForACurrencyPairApiResponse, - "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, - "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, - "crypto_exchanges": models.CryptoExchangesApiResponse, - "last_trade_for_a_crypto_pair": models.LastTradeForACryptoPairApiResponse, - "daily_open_close": models.DailyOpenCloseApiResponse, - "historic_crypto_trades": models.HistoricCryptoTradesApiResponse, - "snapshot_all_tickers": models.SnapshotAllTickersApiResponse, - "snapshot_single_ticker": models.SnapshotSingleTickerApiResponse, - "snapshot_single_ticker_full_book": models.SnapshotSingleTickerFullBookApiResponse, - "snapshot_gainers_losers": models.SnapshotGainersLosersApiResponse, - -} - -def unmarshal_json(handler, resp_json): - response_object = classes[handler](resp_json) +def unmarshal_json(response_type, resp_json) -> models.Definition: + obj = models.name_to_class[response_type]() + obj.unmarshal_json(resp_json) + return obj diff --git a/polygon/rest/tests/integration/test_api.py b/polygon/rest/tests/integration/test_api.py new file mode 100644 index 00000000..973b8f20 --- /dev/null +++ b/polygon/rest/tests/integration/test_api.py @@ -0,0 +1,169 @@ +import os +import unittest + +from polygon.rest import RESTClient + + +class TestAPI(unittest.TestCase): + def setUp(self): + api_key = os.getenv("API_KEY") + assert api_key + + self.api_client = RESTClient(api_key) + + def test_tickers(self): + resp = self.api_client.tickers() + print(resp) + + def test_ticker_types(self): + resp = self.api_client.ticker_types() + print(resp) + + def test_ticker_details(self): + resp = self.api_client.ticker_details("AAPL") + print(resp) + + def test_ticker_news(self): + resp = self.api_client.ticker_news("AAPL") + print(resp) + + def test_markets(self): + resp = self.api_client.markets() + print(resp) + + def test_locales(self): + resp = self.api_client.locales() + print(resp) + + def test_stock_splits(self): + resp = self.api_client.stock_splits("AAPL") + print(resp) + + def test_stock_dividends(self): + resp = self.api_client.stock_dividends("AAPL") + print(resp) + + def test_stock_financials(self): + resp = self.api_client.stock_financials("AAPL") + print(resp) + + def test_market_status(self): + resp = self.api_client.market_status() + print(resp) + + def test_market_holidays(self): + resp = self.api_client.market_holidays() + print(resp) + + def test_exchanges(self): + resp = self.api_client.exchanges() + print(resp) + + def test_historic_trades(self): + resp = self.api_client.historic_trades("AAPL", "2018-2-2") + print(resp) + + def test_historic_trades_v2(self): + resp = self.api_client.historic_trades_v2("AAPL", "2018-02-02") + print(resp) + + def test_historic_quotes(self): + resp = self.api_client.historic_quotes("AAPL", "2018-2-2") + print(resp) + + def test_historic_n___bbo_quotes_v2(self): + resp = self.api_client.historic_n___bbo_quotes_v2("AAPL", "2018-02-02") + print(resp) + + def test_last_trade_for_a_symbol(self): + resp = self.api_client.last_trade_for_a_symbol("AAPL") + print(resp) + + def test_last_quote_for_a_symbol(self): + resp = self.api_client.last_quote_for_a_symbol("AAPL") + print(resp) + + def test_daily_open_close(self): + resp = self.api_client.daily_open_close("AAPL", "2018-3-2") + print(resp) + + def test_condition_mappings(self): + resp = self.api_client.condition_mappings("trades") + print(resp) + + def test_snapshot_all_tickers(self): + resp = self.api_client.snapshot_all_tickers() + print(resp) + + def test_snapshot_single_ticker(self): + resp = self.api_client.snapshot_single_ticker("AAPL") + print(resp) + + def test_snapshot_gainers_losers(self): + resp = self.api_client.snapshot_gainers_losers("gainers") + print(resp) + + def test_previous_close(self): + resp = self.api_client.previous_close("AAPL") + print(resp) + + def test_aggregates(self): + resp = self.api_client.aggregates("AAPL", "1", "day", "2019-01-01", "2019-02-01") + print(resp) + + def test_grouped_daily(self): + resp = self.api_client.grouped_daily("US", "STOCKS", "2019-02-01") + print(resp) + + def test_historic_forex_ticks(self): + resp = self.api_client.historic_forex_ticks("AUD", "USD", "2018-2-2") + print(resp) + + def test_real_time_currency_conversion(self): + resp = self.api_client.real_time_currency_conversion("AUD", "USD") + print(resp) + + def test_last_quote_for_a_currency_pair(self): + resp = self.api_client.last_quote_for_a_currency_pair("AUD", "USD") + print(resp) + + def test_snapshot_all_tickers(self): + resp = self.api_client.snapshot_all_tickers() + print(resp) + + def test_snapshot_gainers_losers(self): + resp = self.api_client.snapshot_gainers_losers("gainers") + print(resp) + + def test_crypto_exchanges(self): + resp = self.api_client.crypto_exchanges() + print(resp) + + def test_last_trade_for_a_crypto_pair(self): + resp = self.api_client.last_trade_for_a_crypto_pair("BTC", "USD") + print(resp) + + def test_daily_open_close(self): + resp = self.api_client.daily_open_close("BTC", "USD", "2018-5-9") + print(resp) + + def test_historic_crypto_trades(self): + resp = self.api_client.historic_crypto_trades("BTC", "USD", "2018-5-9") + print(resp) + + def test_snapshot_all_tickers(self): + resp = self.api_client.snapshot_all_tickers() + print(resp) + + def test_snapshot_single_ticker(self): + resp = self.api_client.snapshot_single_ticker("~BTCUSD") + print(resp) + + def test_snapshot_single_ticker_full_book(self): + resp = self.api_client.snapshot_single_ticker_full_book("~BTCUSD") + print(resp) + + def test_snapshot_gainers_losers(self): + resp = self.api_client.snapshot_gainers_losers("gainers") + print(resp) + diff --git a/requirements.txt b/requirements.txt index 93fba3fd..af296fa5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,6 @@ -aiofiles==0.4.0 -aiohttp==3.6.2 -async-timeout==3.0.1 -attrs==19.3.0 -certifi==2019.9.11 -chardet==3.0.4 -idna==2.8 -multidict==4.5.2 -requests==2.22.0 -six==1.12.0 -urllib3==1.25.6 -websocket-client==0.56.0 -websockets==8.0.2 -yarl==1.3.0 +requests == 2.22.0 +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 From 4c97bbf69c794aa9db90d64cd05f3c5b27090094 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:28:08 -0500 Subject: [PATCH 10/16] Passing 31/33 endpoints Little cleanup (need to learn how to automate that on templating) Better type hinting --- polygon/rest/client.py | 176 ++--- polygon/rest/models/__init__.py | 156 ++--- polygon/rest/models/definitions.py | 751 ++++++++++----------- polygon/rest/models/unmarshal.py | 4 +- polygon/rest/tests/integration/test_api.py | 313 ++++----- 5 files changed, 712 insertions(+), 688 deletions(-) diff --git a/polygon/rest/client.py b/polygon/rest/client.py index a4fcb3a4..f3ff2ef2 100644 --- a/polygon/rest/client.py +++ b/polygon/rest/client.py @@ -1,4 +1,4 @@ -from typing import Dict +from typing import Dict, Type import requests @@ -17,165 +17,185 @@ def __init__(self, auth_key: str): self._session = requests.Session() self._session.params["apiKey"] = self.auth_key - def _handle_response(self, response_type: str, endpoint: str, params: Dict[str, str]) -> models.Definition: + def _handle_response(self, response_type: str, endpoint: str, params: Dict[str, str]) -> Type[models.AnyDefinition]: resp: requests.Response = self._session.get(endpoint, params=params) if resp.status_code == 200: return unmarshal.unmarshal_json(response_type, resp.json()) else: resp.raise_for_status() - def tickers(self, **query_params): + def reference_tickers(self, **query_params) -> models.ReferenceTickersApiResponse: endpoint = f"{self.url}/v2/reference/tickers" - return self._handle_response("TickersApiResponse", endpoint, query_params) + return self._handle_response("ReferenceTickersApiResponse", endpoint, query_params) - def ticker_types(self, **query_params): + def reference_ticker_types(self, **query_params) -> models.ReferenceTickerTypesApiResponse: endpoint = f"{self.url}/v2/reference/types" - return self._handle_response("TickerTypesApiResponse", endpoint, query_params) + return self._handle_response("ReferenceTickerTypesApiResponse", endpoint, query_params) - def ticker_details(self, symbol, **query_params): + def reference_ticker_details(self, symbol, **query_params) -> models.ReferenceTickerDetailsApiResponse: endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" - return self._handle_response("TickerDetailsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceTickerDetailsApiResponse", endpoint, query_params) - def ticker_news(self, symbol, **query_params): + def reference_ticker_news(self, symbol, **query_params) -> models.ReferenceTickerNewsApiResponse: endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" - return self._handle_response("TickerNewsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceTickerNewsApiResponse", endpoint, query_params) - def markets(self, **query_params): + def reference_markets(self, **query_params) -> models.ReferenceMarketsApiResponse: endpoint = f"{self.url}/v2/reference/markets" - return self._handle_response("MarketsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceMarketsApiResponse", endpoint, query_params) - def locales(self, **query_params): + def reference_locales(self, **query_params) -> models.ReferenceLocalesApiResponse: endpoint = f"{self.url}/v2/reference/locales" - return self._handle_response("LocalesApiResponse", endpoint, query_params) + return self._handle_response("ReferenceLocalesApiResponse", endpoint, query_params) - def stock_splits(self, symbol, **query_params): + def reference_stock_splits(self, symbol, **query_params) -> models.ReferenceStockSplitsApiResponse: endpoint = f"{self.url}/v2/reference/splits/{symbol}" - return self._handle_response("StockSplitsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceStockSplitsApiResponse", endpoint, query_params) - def stock_dividends(self, symbol, **query_params): + def reference_stock_dividends(self, symbol, **query_params) -> models.ReferenceStockDividendsApiResponse: endpoint = f"{self.url}/v2/reference/dividends/{symbol}" - return self._handle_response("StockDividendsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceStockDividendsApiResponse", endpoint, query_params) - def stock_financials(self, symbol, **query_params): + def reference_stock_financials(self, symbol, **query_params) -> models.ReferenceStockFinancialsApiResponse: endpoint = f"{self.url}/v2/reference/financials/{symbol}" - return self._handle_response("StockFinancialsApiResponse", endpoint, query_params) + return self._handle_response("ReferenceStockFinancialsApiResponse", endpoint, query_params) - def market_status(self, **query_params): + def reference_market_status(self, **query_params) -> models.ReferenceMarketStatusApiResponse: endpoint = f"{self.url}/v1/marketstatus/now" - return self._handle_response("MarketStatusApiResponse", endpoint, query_params) + return self._handle_response("ReferenceMarketStatusApiResponse", endpoint, query_params) - def market_holidays(self, **query_params): + def reference_market_holidays(self, **query_params) -> models.ReferenceMarketHolidaysApiResponse: endpoint = f"{self.url}/v1/marketstatus/upcoming" - return self._handle_response("MarketHolidaysApiResponse", endpoint, query_params) + return self._handle_response("ReferenceMarketHolidaysApiResponse", endpoint, query_params) - def exchanges(self, **query_params): + def stocks_equities_exchanges(self, **query_params) -> models.StocksEquitiesExchangesApiResponse: endpoint = f"{self.url}/v1/meta/exchanges" - return self._handle_response("ExchangesApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesExchangesApiResponse", endpoint, query_params) - def historic_trades(self, symbol, date, **query_params): + def stocks_equities_historic_trades(self, symbol, date, + **query_params) -> models.StocksEquitiesHistoricTradesApiResponse: endpoint = f"{self.url}/v1/historic/trades/{symbol}/{date}" - return self._handle_response("HistoricTradesApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesHistoricTradesApiResponse", endpoint, query_params) - def historic_trades_v2(self, ticker, date, **query_params): + def historic_trades_v2(self, ticker, date, **query_params) -> models.HistoricTradesV2ApiResponse: endpoint = f"{self.url}/v2/ticks/stocks/trades/{ticker}/{date}" return self._handle_response("HistoricTradesV2ApiResponse", endpoint, query_params) - def historic_quotes(self, symbol, date, **query_params): + def stocks_equities_historic_quotes(self, symbol, date, + **query_params) -> models.StocksEquitiesHistoricQuotesApiResponse: endpoint = f"{self.url}/v1/historic/quotes/{symbol}/{date}" - return self._handle_response("HistoricQuotesApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesHistoricQuotesApiResponse", endpoint, query_params) - def historic_n___bbo_quotes_v2(self, ticker, date, **query_params): + def historic_n___bbo_quotes_v2(self, ticker, date, **query_params) -> models.HistoricNBboQuotesV2ApiResponse: endpoint = f"{self.url}/v2/ticks/stocks/nbbo/{ticker}/{date}" return self._handle_response("HistoricNBboQuotesV2ApiResponse", endpoint, query_params) - def last_trade_for_a_symbol(self, symbol, **query_params): + def stocks_equities_last_trade_for_a_symbol(self, symbol, + **query_params) -> models.StocksEquitiesLastTradeForASymbolApiResponse: endpoint = f"{self.url}/v1/last/stocks/{symbol}" - return self._handle_response("LastTradeForASymbolApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesLastTradeForASymbolApiResponse", endpoint, query_params) - def last_quote_for_a_symbol(self, symbol, **query_params): + def stocks_equities_last_quote_for_a_symbol(self, symbol, + **query_params) -> models.StocksEquitiesLastQuoteForASymbolApiResponse: endpoint = f"{self.url}/v1/last_quote/stocks/{symbol}" - return self._handle_response("LastQuoteForASymbolApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesLastQuoteForASymbolApiResponse", endpoint, query_params) - def daily_open_close(self, symbol, date, **query_params): + def stocks_equities_daily_open_close(self, symbol, date, + **query_params) -> models.StocksEquitiesDailyOpenCloseApiResponse: endpoint = f"{self.url}/v1/open-close/{symbol}/{date}" - return self._handle_response("DailyOpenCloseApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesDailyOpenCloseApiResponse", endpoint, query_params) - def condition_mappings(self, ticktype, **query_params): + def stocks_equities_condition_mappings(self, ticktype, + **query_params) -> models.StocksEquitiesConditionMappingsApiResponse: endpoint = f"{self.url}/v1/meta/conditions/{ticktype}" - return self._handle_response("ConditionMappingsApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesConditionMappingsApiResponse", endpoint, query_params) - def snapshot_all_tickers(self, **query_params): + def stocks_equities_snapshot_all_tickers(self, + **query_params) -> models.StocksEquitiesSnapshotAllTickersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers" - return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesSnapshotAllTickersApiResponse", endpoint, query_params) - def snapshot_single_ticker(self, ticker, **query_params): + def stocks_equities_snapshot_single_ticker(self, ticker, + **query_params) -> models.StocksEquitiesSnapshotSingleTickerApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}" - return self._handle_response("SnapshotSingleTickerApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesSnapshotSingleTickerApiResponse", endpoint, query_params) - def snapshot_gainers_losers(self, direction, **query_params): + def stocks_equities_snapshot_gainers_losers(self, direction, + **query_params) -> models.StocksEquitiesSnapshotGainersLosersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/{direction}" - return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesSnapshotGainersLosersApiResponse", endpoint, query_params) - def previous_close(self, ticker, **query_params): + def stocks_equities_previous_close(self, ticker, **query_params) -> models.StocksEquitiesPreviousCloseApiResponse: endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._handle_response("PreviousCloseApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesPreviousCloseApiResponse", endpoint, query_params) - def aggregates(self, ticker, multiplier, timespan, from_, to, **query_params): + def stocks_equities_aggregates(self, ticker, multiplier, timespan, from_, to, + **query_params) -> models.StocksEquitiesAggregatesApiResponse: endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._handle_response("AggregatesApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesAggregatesApiResponse", endpoint, query_params) - def grouped_daily(self, locale, market, date, **query_params): + def stocks_equities_grouped_daily(self, locale, market, date, + **query_params) -> models.StocksEquitiesGroupedDailyApiResponse: endpoint = f"{self.url}/v2/aggs/grouped/locale/{locale}/market/{market}/{date}" - return self._handle_response("GroupedDailyApiResponse", endpoint, query_params) + return self._handle_response("StocksEquitiesGroupedDailyApiResponse", endpoint, query_params) - def historic_forex_ticks(self, from_, to, date, **query_params): + def forex_currencies_historic_forex_ticks(self, from_, to, date, + **query_params) -> models.ForexCurrenciesHistoricForexTicksApiResponse: endpoint = f"{self.url}/v1/historic/forex/{from_}/{to}/{date}" - return self._handle_response("HistoricForexTicksApiResponse", endpoint, query_params) + return self._handle_response("ForexCurrenciesHistoricForexTicksApiResponse", endpoint, query_params) - def real_time_currency_conversion(self, from_, to, **query_params): + def forex_currencies_real_time_currency_conversion(self, from_, to, + **query_params) -> models.ForexCurrenciesRealTimeCurrencyConversionApiResponse: endpoint = f"{self.url}/v1/conversion/{from_}/{to}" - return self._handle_response("RealTimeCurrencyConversionApiResponse", endpoint, query_params) + return self._handle_response("ForexCurrenciesRealTimeCurrencyConversionApiResponse", endpoint, query_params) - def last_quote_for_a_currency_pair(self, from_, to, **query_params): + def forex_currencies_last_quote_for_a_currency_pair(self, from_, to, + **query_params) -> models.ForexCurrenciesLastQuoteForACurrencyPairApiResponse: endpoint = f"{self.url}/v1/last_quote/currencies/{from_}/{to}" - return self._handle_response("LastQuoteForACurrencyPairApiResponse", endpoint, query_params) + return self._handle_response("ForexCurrenciesLastQuoteForACurrencyPairApiResponse", endpoint, query_params) - def snapshot_all_tickers(self, **query_params): + def forex_currencies_snapshot_all_tickers(self, + **query_params) -> models.ForexCurrenciesSnapshotAllTickersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers" - return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) + return self._handle_response("ForexCurrenciesSnapshotAllTickersApiResponse", endpoint, query_params) - def snapshot_gainers_losers(self, direction, **query_params): + def forex_currencies_snapshot_gainers_losers(self, direction, + **query_params) -> models.ForexCurrenciesSnapshotGainersLosersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/{direction}" - return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) + return self._handle_response("ForexCurrenciesSnapshotGainersLosersApiResponse", endpoint, query_params) - def crypto_exchanges(self, **query_params): + def crypto_crypto_exchanges(self, **query_params) -> models.CryptoCryptoExchangesApiResponse: endpoint = f"{self.url}/v1/meta/crypto-exchanges" - return self._handle_response("CryptoExchangesApiResponse", endpoint, query_params) + return self._handle_response("CryptoCryptoExchangesApiResponse", endpoint, query_params) - def last_trade_for_a_crypto_pair(self, from_, to, **query_params): + def crypto_last_trade_for_a_crypto_pair(self, from_, to, + **query_params) -> models.CryptoLastTradeForACryptoPairApiResponse: endpoint = f"{self.url}/v1/last/crypto/{from_}/{to}" - return self._handle_response("LastTradeForACryptoPairApiResponse", endpoint, query_params) + return self._handle_response("CryptoLastTradeForACryptoPairApiResponse", endpoint, query_params) - def daily_open_close(self, from_, to, date, **query_params): + def crypto_daily_open_close(self, from_, to, date, **query_params) -> models.CryptoDailyOpenCloseApiResponse: endpoint = f"{self.url}/v1/open-close/crypto/{from_}/{to}/{date}" - return self._handle_response("DailyOpenCloseApiResponse", endpoint, query_params) + return self._handle_response("CryptoDailyOpenCloseApiResponse", endpoint, query_params) - def historic_crypto_trades(self, from_, to, date, **query_params): + def crypto_historic_crypto_trades(self, from_, to, date, + **query_params) -> models.CryptoHistoricCryptoTradesApiResponse: endpoint = f"{self.url}/v1/historic/crypto/{from_}/{to}/{date}" - return self._handle_response("HistoricCryptoTradesApiResponse", endpoint, query_params) + return self._handle_response("CryptoHistoricCryptoTradesApiResponse", endpoint, query_params) - def snapshot_all_tickers(self, **query_params): + def crypto_snapshot_all_tickers(self, **query_params) -> models.CryptoSnapshotAllTickersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers" - return self._handle_response("SnapshotAllTickersApiResponse", endpoint, query_params) + return self._handle_response("CryptoSnapshotAllTickersApiResponse", endpoint, query_params) - def snapshot_single_ticker(self, ticker, **query_params): + def crypto_snapshot_single_ticker(self, ticker, **query_params) -> models.CryptoSnapshotSingleTickerApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}" - return self._handle_response("SnapshotSingleTickerApiResponse", endpoint, query_params) + return self._handle_response("CryptoSnapshotSingleTickerApiResponse", endpoint, query_params) - def snapshot_single_ticker_full_book(self, ticker, **query_params): + def crypto_snapshot_single_ticker_full_book(self, ticker, + **query_params) -> models.CryptoSnapshotSingleTickerFullBookApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" - return self._handle_response("SnapshotSingleTickerFullBookApiResponse", endpoint, query_params) + return self._handle_response("CryptoSnapshotSingleTickerFullBookApiResponse", endpoint, query_params) - def snapshot_gainers_losers(self, direction, **query_params): + def crypto_snapshot_gainers_losers(self, direction, + **query_params) -> models.CryptoSnapshotGainersLosersApiResponse: endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/{direction}" - return self._handle_response("SnapshotGainersLosersApiResponse", endpoint, query_params) + return self._handle_response("CryptoSnapshotGainersLosersApiResponse", endpoint, query_params) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py index 05f7fcdf..a0b94dd5 100644 --- a/polygon/rest/models/__init__.py +++ b/polygon/rest/models/__init__.py @@ -44,45 +44,45 @@ from .definitions import StocksSnapshotQuote from .definitions import Aggv2 from .definitions import AggResponse -from .definitions import TickersApiResponse -from .definitions import TickerTypesApiResponse -from .definitions import TickerDetailsApiResponse -from .definitions import TickerNewsApiResponse -from .definitions import MarketsApiResponse -from .definitions import LocalesApiResponse -from .definitions import StockSplitsApiResponse -from .definitions import StockDividendsApiResponse -from .definitions import StockFinancialsApiResponse -from .definitions import MarketStatusApiResponse -from .definitions import MarketHolidaysApiResponse -from .definitions import ExchangesApiResponse -from .definitions import HistoricTradesApiResponse +from .definitions import ReferenceTickersApiResponse +from .definitions import ReferenceTickerTypesApiResponse +from .definitions import ReferenceTickerDetailsApiResponse +from .definitions import ReferenceTickerNewsApiResponse +from .definitions import ReferenceMarketsApiResponse +from .definitions import ReferenceLocalesApiResponse +from .definitions import ReferenceStockSplitsApiResponse +from .definitions import ReferenceStockDividendsApiResponse +from .definitions import ReferenceStockFinancialsApiResponse +from .definitions import ReferenceMarketStatusApiResponse +from .definitions import ReferenceMarketHolidaysApiResponse +from .definitions import StocksEquitiesExchangesApiResponse +from .definitions import StocksEquitiesHistoricTradesApiResponse from .definitions import HistoricTradesV2ApiResponse -from .definitions import HistoricQuotesApiResponse +from .definitions import StocksEquitiesHistoricQuotesApiResponse from .definitions import HistoricNBboQuotesV2ApiResponse -from .definitions import LastTradeForASymbolApiResponse -from .definitions import LastQuoteForASymbolApiResponse -from .definitions import DailyOpenCloseApiResponse -from .definitions import ConditionMappingsApiResponse -from .definitions import SnapshotAllTickersApiResponse -from .definitions import SnapshotSingleTickerApiResponse -from .definitions import SnapshotGainersLosersApiResponse -from .definitions import PreviousCloseApiResponse -from .definitions import AggregatesApiResponse -from .definitions import GroupedDailyApiResponse -from .definitions import HistoricForexTicksApiResponse -from .definitions import RealTimeCurrencyConversionApiResponse -from .definitions import LastQuoteForACurrencyPairApiResponse -from .definitions import SnapshotAllTickersApiResponse -from .definitions import SnapshotGainersLosersApiResponse -from .definitions import CryptoExchangesApiResponse -from .definitions import LastTradeForACryptoPairApiResponse -from .definitions import DailyOpenCloseApiResponse -from .definitions import HistoricCryptoTradesApiResponse -from .definitions import SnapshotAllTickersApiResponse -from .definitions import SnapshotSingleTickerApiResponse -from .definitions import SnapshotSingleTickerFullBookApiResponse -from .definitions import SnapshotGainersLosersApiResponse +from .definitions import StocksEquitiesLastTradeForASymbolApiResponse +from .definitions import StocksEquitiesLastQuoteForASymbolApiResponse +from .definitions import StocksEquitiesDailyOpenCloseApiResponse +from .definitions import StocksEquitiesConditionMappingsApiResponse +from .definitions import StocksEquitiesSnapshotAllTickersApiResponse +from .definitions import StocksEquitiesSnapshotSingleTickerApiResponse +from .definitions import StocksEquitiesSnapshotGainersLosersApiResponse +from .definitions import StocksEquitiesPreviousCloseApiResponse +from .definitions import StocksEquitiesAggregatesApiResponse +from .definitions import StocksEquitiesGroupedDailyApiResponse +from .definitions import ForexCurrenciesHistoricForexTicksApiResponse +from .definitions import ForexCurrenciesRealTimeCurrencyConversionApiResponse +from .definitions import ForexCurrenciesLastQuoteForACurrencyPairApiResponse +from .definitions import ForexCurrenciesSnapshotAllTickersApiResponse +from .definitions import ForexCurrenciesSnapshotGainersLosersApiResponse +from .definitions import CryptoCryptoExchangesApiResponse +from .definitions import CryptoLastTradeForACryptoPairApiResponse +from .definitions import CryptoDailyOpenCloseApiResponse +from .definitions import CryptoHistoricCryptoTradesApiResponse +from .definitions import CryptoSnapshotAllTickersApiResponse +from .definitions import CryptoSnapshotSingleTickerApiResponse +from .definitions import CryptoSnapshotSingleTickerFullBookApiResponse +from .definitions import CryptoSnapshotGainersLosersApiResponse from .definitions import StockSymbol from .definitions import ConditionTypeMap from .definitions import SymbolTypeMap @@ -93,8 +93,10 @@ from .definitions import Definition +AnyDefinition = typing.TypeVar("AnyDefinition", bound=Definition) + # noinspection SpellCheckingInspection -name_to_class: typing.Dict[str, typing.Callable[[], Definition]] = { +name_to_class: typing.Dict[str, typing.Callable[[], typing.Type[AnyDefinition]]] = { "LastTrade": LastTrade, "LastQuote": LastQuote, "HistTrade": HistTrade, @@ -141,46 +143,46 @@ "StocksSnapshotQuote": StocksSnapshotQuote, "Aggv2": Aggv2, "AggResponse": AggResponse, - "TickersApiResponse": TickersApiResponse, - "TickerTypesApiResponse": TickerTypesApiResponse, - "TickerDetailsApiResponse": TickerDetailsApiResponse, - "TickerNewsApiResponse": TickerNewsApiResponse, - "MarketsApiResponse": MarketsApiResponse, - "LocalesApiResponse": LocalesApiResponse, - "StockSplitsApiResponse": StockSplitsApiResponse, - "StockDividendsApiResponse": StockDividendsApiResponse, - "StockFinancialsApiResponse": StockFinancialsApiResponse, - "MarketStatusApiResponse": MarketStatusApiResponse, - "MarketHolidaysApiResponse": MarketHolidaysApiResponse, - "ExchangesApiResponse": ExchangesApiResponse, - "HistoricTradesApiResponse": HistoricTradesApiResponse, + "ReferenceTickersApiResponse": ReferenceTickersApiResponse, + "ReferenceTickerTypesApiResponse": ReferenceTickerTypesApiResponse, + "ReferenceTickerDetailsApiResponse": ReferenceTickerDetailsApiResponse, + "ReferenceTickerNewsApiResponse": ReferenceTickerNewsApiResponse, + "ReferenceMarketsApiResponse": ReferenceMarketsApiResponse, + "ReferenceLocalesApiResponse": ReferenceLocalesApiResponse, + "ReferenceStockSplitsApiResponse": ReferenceStockSplitsApiResponse, + "ReferenceStockDividendsApiResponse": ReferenceStockDividendsApiResponse, + "ReferenceStockFinancialsApiResponse": ReferenceStockFinancialsApiResponse, + "ReferenceMarketStatusApiResponse": ReferenceMarketStatusApiResponse, + "ReferenceMarketHolidaysApiResponse": ReferenceMarketHolidaysApiResponse, + "StocksEquitiesExchangesApiResponse": StocksEquitiesExchangesApiResponse, + "StocksEquitiesHistoricTradesApiResponse": StocksEquitiesHistoricTradesApiResponse, "HistoricTradesV2ApiResponse": HistoricTradesV2ApiResponse, - "HistoricQuotesApiResponse": HistoricQuotesApiResponse, + "StocksEquitiesHistoricQuotesApiResponse": StocksEquitiesHistoricQuotesApiResponse, "HistoricNBboQuotesV2ApiResponse": HistoricNBboQuotesV2ApiResponse, - "LastTradeForASymbolApiResponse": LastTradeForASymbolApiResponse, - "LastQuoteForASymbolApiResponse": LastQuoteForASymbolApiResponse, - "DailyOpenCloseApiResponse": DailyOpenCloseApiResponse, - "ConditionMappingsApiResponse": ConditionMappingsApiResponse, - "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, - "SnapshotSingleTickerApiResponse": SnapshotSingleTickerApiResponse, - "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, - "PreviousCloseApiResponse": PreviousCloseApiResponse, - "AggregatesApiResponse": AggregatesApiResponse, - "GroupedDailyApiResponse": GroupedDailyApiResponse, - "HistoricForexTicksApiResponse": HistoricForexTicksApiResponse, - "RealTimeCurrencyConversionApiResponse": RealTimeCurrencyConversionApiResponse, - "LastQuoteForACurrencyPairApiResponse": LastQuoteForACurrencyPairApiResponse, - "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, - "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, - "CryptoExchangesApiResponse": CryptoExchangesApiResponse, - "LastTradeForACryptoPairApiResponse": LastTradeForACryptoPairApiResponse, - "DailyOpenCloseApiResponse": DailyOpenCloseApiResponse, - "HistoricCryptoTradesApiResponse": HistoricCryptoTradesApiResponse, - "SnapshotAllTickersApiResponse": SnapshotAllTickersApiResponse, - "SnapshotSingleTickerApiResponse": SnapshotSingleTickerApiResponse, - "SnapshotSingleTickerFullBookApiResponse": SnapshotSingleTickerFullBookApiResponse, - "SnapshotGainersLosersApiResponse": SnapshotGainersLosersApiResponse, - + "StocksEquitiesLastTradeForASymbolApiResponse": StocksEquitiesLastTradeForASymbolApiResponse, + "StocksEquitiesLastQuoteForASymbolApiResponse": StocksEquitiesLastQuoteForASymbolApiResponse, + "StocksEquitiesDailyOpenCloseApiResponse": StocksEquitiesDailyOpenCloseApiResponse, + "StocksEquitiesConditionMappingsApiResponse": StocksEquitiesConditionMappingsApiResponse, + "StocksEquitiesSnapshotAllTickersApiResponse": StocksEquitiesSnapshotAllTickersApiResponse, + "StocksEquitiesSnapshotSingleTickerApiResponse": StocksEquitiesSnapshotSingleTickerApiResponse, + "StocksEquitiesSnapshotGainersLosersApiResponse": StocksEquitiesSnapshotGainersLosersApiResponse, + "StocksEquitiesPreviousCloseApiResponse": StocksEquitiesPreviousCloseApiResponse, + "StocksEquitiesAggregatesApiResponse": StocksEquitiesAggregatesApiResponse, + "StocksEquitiesGroupedDailyApiResponse": StocksEquitiesGroupedDailyApiResponse, + "ForexCurrenciesHistoricForexTicksApiResponse": ForexCurrenciesHistoricForexTicksApiResponse, + "ForexCurrenciesRealTimeCurrencyConversionApiResponse": ForexCurrenciesRealTimeCurrencyConversionApiResponse, + "ForexCurrenciesLastQuoteForACurrencyPairApiResponse": ForexCurrenciesLastQuoteForACurrencyPairApiResponse, + "ForexCurrenciesSnapshotAllTickersApiResponse": ForexCurrenciesSnapshotAllTickersApiResponse, + "ForexCurrenciesSnapshotGainersLosersApiResponse": ForexCurrenciesSnapshotGainersLosersApiResponse, + "CryptoCryptoExchangesApiResponse": CryptoCryptoExchangesApiResponse, + "CryptoLastTradeForACryptoPairApiResponse": CryptoLastTradeForACryptoPairApiResponse, + "CryptoDailyOpenCloseApiResponse": CryptoDailyOpenCloseApiResponse, + "CryptoHistoricCryptoTradesApiResponse": CryptoHistoricCryptoTradesApiResponse, + "CryptoSnapshotAllTickersApiResponse": CryptoSnapshotAllTickersApiResponse, + "CryptoSnapshotSingleTickerApiResponse": CryptoSnapshotSingleTickerApiResponse, + "CryptoSnapshotSingleTickerFullBookApiResponse": CryptoSnapshotSingleTickerFullBookApiResponse, + "CryptoSnapshotGainersLosersApiResponse": CryptoSnapshotGainersLosersApiResponse, + } # noinspection SpellCheckingInspection @@ -189,5 +191,5 @@ "ConditionTypeMap": ConditionTypeMap, "SymbolTypeMap": SymbolTypeMap, "TickerSymbol": TickerSymbol, - + } \ No newline at end of file diff --git a/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py index cf14763d..b90fd7f5 100644 --- a/polygon/rest/models/definitions.py +++ b/polygon/rest/models/definitions.py @@ -61,7 +61,7 @@ class LastTrade(Definition): "cond3": "cond3", "cond4": "cond4", "timestamp": "timestamp", - + } _attribute_is_primitive = { @@ -73,7 +73,7 @@ class LastTrade(Definition): "cond3": True, "cond4": True, "timestamp": True, - + } _attributes_to_types = { @@ -85,7 +85,7 @@ class LastTrade(Definition): "cond3": "int", "cond4": "int", "timestamp": "int", - + } def __init__(self): @@ -97,7 +97,7 @@ def __init__(self): self.cond3: int self.cond4: int self.timestamp: int - + # noinspection SpellCheckingInspection class LastQuote(Definition): @@ -120,7 +120,7 @@ class LastQuote(Definition): "bidsize": True, "bidexchange": True, "timestamp": True, - + } _attributes_to_types = { @@ -131,7 +131,7 @@ class LastQuote(Definition): "bidsize": "int", "bidexchange": "int", "timestamp": "int", - + } def __init__(self): @@ -142,7 +142,7 @@ def __init__(self): self.bidsize: int self.bidexchange: int self.timestamp: int - + # noinspection SpellCheckingInspection class HistTrade(Definition): @@ -155,7 +155,7 @@ class HistTrade(Definition): "price": "price", "size": "size", "timestamp": "timestamp", - + } _attribute_is_primitive = { @@ -167,7 +167,7 @@ class HistTrade(Definition): "price": True, "size": True, "timestamp": True, - + } _attributes_to_types = { @@ -179,7 +179,7 @@ class HistTrade(Definition): "price": "int", "size": "int", "timestamp": "str", - + } def __init__(self): @@ -191,7 +191,7 @@ def __init__(self): self.price: int self.size: int self.timestamp: str - + # noinspection SpellCheckingInspection class Quote(Definition): @@ -204,7 +204,7 @@ class Quote(Definition): "bS": "bid_size", "aS": "ask_size", "t": "timestamp_of_this_trade", - + } _attribute_is_primitive = { @@ -216,7 +216,7 @@ class Quote(Definition): "bid_size": True, "ask_size": True, "timestamp_of_this_trade": True, - + } _attributes_to_types = { @@ -228,7 +228,7 @@ class Quote(Definition): "bid_size": "int", "ask_size": "int", "timestamp_of_this_trade": "int", - + } def __init__(self): @@ -240,7 +240,7 @@ def __init__(self): self.bid_size: int self.ask_size: int self.timestamp_of_this_trade: int - + # noinspection SpellCheckingInspection class Aggregate(Definition): @@ -252,7 +252,7 @@ class Aggregate(Definition): "v": "total_volume_of_all_trades", "k": "transactions", "t": "timestamp_of_this_aggregation", - + } _attribute_is_primitive = { @@ -263,7 +263,7 @@ class Aggregate(Definition): "total_volume_of_all_trades": True, "transactions": True, "timestamp_of_this_aggregation": True, - + } _attributes_to_types = { @@ -274,7 +274,7 @@ class Aggregate(Definition): "total_volume_of_all_trades": "int", "transactions": "int", "timestamp_of_this_aggregation": "int", - + } def __init__(self): @@ -285,7 +285,7 @@ def __init__(self): self.total_volume_of_all_trades: int self.transactions: int self.timestamp_of_this_aggregation: int - + # noinspection SpellCheckingInspection class Company(Definition): @@ -312,7 +312,7 @@ class Company(Definition): "similar": "similar", "tags": "tags", "updated": "updated", - + } _attribute_is_primitive = { @@ -338,7 +338,7 @@ class Company(Definition): "similar": False, "tags": False, "updated": True, - + } _attributes_to_types = { @@ -364,7 +364,7 @@ class Company(Definition): "similar": "List[StockSymbol]", "tags": "List[str]", "updated": "str", - + } def __init__(self): @@ -390,7 +390,7 @@ def __init__(self): self.similar: List[StockSymbol] self.tags: List[str] self.updated: str - + # noinspection SpellCheckingInspection class Symbol(Definition): @@ -401,7 +401,7 @@ class Symbol(Definition): "url": "url", "updated": "updated", "isOTC": "is___otc", - + } _attribute_is_primitive = { @@ -411,7 +411,7 @@ class Symbol(Definition): "url": True, "updated": True, "is___otc": True, - + } _attributes_to_types = { @@ -421,7 +421,7 @@ class Symbol(Definition): "url": "str", "updated": "str", "is___otc": "bool", - + } def __init__(self): @@ -431,7 +431,7 @@ def __init__(self): self.url: str self.updated: str self.is___otc: bool - + # noinspection SpellCheckingInspection class Dividend(Definition): @@ -445,7 +445,7 @@ class Dividend(Definition): "amount": "amount", "qualified": "qualified", "flag": "flag", - + } _attribute_is_primitive = { @@ -458,7 +458,7 @@ class Dividend(Definition): "amount": True, "qualified": True, "flag": True, - + } _attributes_to_types = { @@ -471,7 +471,7 @@ class Dividend(Definition): "amount": "float", "qualified": "str", "flag": "str", - + } def __init__(self): @@ -484,7 +484,7 @@ def __init__(self): self.amount: float self.qualified: str self.flag: str - + # noinspection SpellCheckingInspection class News(Definition): @@ -497,7 +497,7 @@ class News(Definition): "image": "image", "timestamp": "timestamp", "keywords": "keywords", - + } _attribute_is_primitive = { @@ -509,7 +509,7 @@ class News(Definition): "image": True, "timestamp": True, "keywords": False, - + } _attributes_to_types = { @@ -521,7 +521,7 @@ class News(Definition): "image": "str", "timestamp": "str", "keywords": "List[str]", - + } def __init__(self): @@ -533,7 +533,7 @@ def __init__(self): self.image: str self.timestamp: str self.keywords: List[str] - + # noinspection SpellCheckingInspection class Earning(Definition): @@ -552,7 +552,7 @@ class Earning(Definition): "yearAgo": "year_ago", "yearAgoChangePercent": "year_ag_ochan_gepercent", "estimatedChangePercent": "estimated_chang_epercent", - + } _attribute_is_primitive = { @@ -570,7 +570,7 @@ class Earning(Definition): "year_ago": True, "year_ag_ochan_gepercent": True, "estimated_chang_epercent": True, - + } _attributes_to_types = { @@ -588,7 +588,7 @@ class Earning(Definition): "year_ago": "float", "year_ag_ochan_gepercent": "float", "estimated_chang_epercent": "float", - + } def __init__(self): @@ -606,7 +606,7 @@ def __init__(self): self.year_ago: float self.year_ag_ochan_gepercent: float self.estimated_chang_epercent: float - + # noinspection SpellCheckingInspection class Financial(Definition): @@ -633,7 +633,7 @@ class Financial(Definition): "cashChange": "cash_change", "cashFlow": "cash_flow", "operatingGainsLosses": "operating_gain_slosses", - + } _attribute_is_primitive = { @@ -659,7 +659,7 @@ class Financial(Definition): "cash_change": True, "cash_flow": True, "operating_gain_slosses": True, - + } _attributes_to_types = { @@ -685,7 +685,7 @@ class Financial(Definition): "cash_change": "float", "cash_flow": "float", "operating_gain_slosses": "float", - + } def __init__(self): @@ -711,7 +711,7 @@ def __init__(self): self.cash_change: float self.cash_flow: float self.operating_gain_slosses: float - + # noinspection SpellCheckingInspection class Exchange(Definition): @@ -722,7 +722,7 @@ class Exchange(Definition): "mic": "mic", "name": "name", "tape": "tape", - + } _attribute_is_primitive = { @@ -732,7 +732,7 @@ class Exchange(Definition): "mic": True, "name": True, "tape": True, - + } _attributes_to_types = { @@ -742,7 +742,7 @@ class Exchange(Definition): "mic": "str", "name": "str", "tape": "str", - + } def __init__(self): @@ -752,7 +752,7 @@ def __init__(self): self.mic: str self.name: str self.tape: str - + # noinspection SpellCheckingInspection class Error(Definition): @@ -760,91 +760,91 @@ class Error(Definition): "code": "code", "message": "message", "fields": "fields", - + } _attribute_is_primitive = { "code": True, "message": True, "fields": True, - + } _attributes_to_types = { "code": "int", "message": "str", "fields": "str", - + } def __init__(self): self.code: int self.message: str self.fields: str - + # noinspection SpellCheckingInspection class NotFound(Definition): _swagger_name_to_python = { "message": "message", - + } _attribute_is_primitive = { "message": True, - + } _attributes_to_types = { "message": "str", - + } def __init__(self): self.message: str - + # noinspection SpellCheckingInspection class Conflict(Definition): _swagger_name_to_python = { "message": "message", - + } _attribute_is_primitive = { "message": True, - + } _attributes_to_types = { "message": "str", - + } def __init__(self): self.message: str - + # noinspection SpellCheckingInspection class Unauthorized(Definition): _swagger_name_to_python = { "message": "message", - + } _attribute_is_primitive = { "message": True, - + } _attributes_to_types = { "message": "str", - + } def __init__(self): self.message: str - + # noinspection SpellCheckingInspection class MarketStatus(Definition): @@ -853,7 +853,7 @@ class MarketStatus(Definition): "serverTime": "server_time", "exchanges": "exchanges", "currencies": "currencies", - + } _attribute_is_primitive = { @@ -861,7 +861,7 @@ class MarketStatus(Definition): "server_time": True, "exchanges": True, "currencies": True, - + } _attributes_to_types = { @@ -869,7 +869,7 @@ class MarketStatus(Definition): "server_time": "str", "exchanges": "Dict[str, str]", "currencies": "Dict[str, str]", - + } def __init__(self): @@ -877,7 +877,7 @@ def __init__(self): self.server_time: str self.exchanges: Dict[str, str] self.currencies: Dict[str, str] - + # noinspection SpellCheckingInspection class MarketHoliday(Definition): @@ -888,7 +888,7 @@ class MarketHoliday(Definition): "date": "date", "open": "open", "close": "close", - + } _attribute_is_primitive = { @@ -898,7 +898,7 @@ class MarketHoliday(Definition): "date": True, "open": True, "close": True, - + } _attributes_to_types = { @@ -908,7 +908,7 @@ class MarketHoliday(Definition): "date": "str", "open": "str", "close": "str", - + } def __init__(self): @@ -918,7 +918,7 @@ def __init__(self): self.date: str self.open: str self.close: str - + # noinspection SpellCheckingInspection class AnalystRatings(Definition): @@ -932,7 +932,7 @@ class AnalystRatings(Definition): "sell": "sell", "strongSell": "strong_sell", "updated": "updated", - + } _attribute_is_primitive = { @@ -945,7 +945,7 @@ class AnalystRatings(Definition): "sell": False, "strong_sell": False, "updated": True, - + } _attributes_to_types = { @@ -958,7 +958,7 @@ class AnalystRatings(Definition): "sell": "RatingSection", "strong_sell": "RatingSection", "updated": "str", - + } def __init__(self): @@ -971,7 +971,7 @@ def __init__(self): self.sell: RatingSection self.strong_sell: RatingSection self.updated: str - + # noinspection SpellCheckingInspection class RatingSection(Definition): @@ -982,7 +982,7 @@ class RatingSection(Definition): "month3": "month3", "month4": "month4", "month5": "month5", - + } _attribute_is_primitive = { @@ -992,7 +992,7 @@ class RatingSection(Definition): "month3": True, "month4": True, "month5": True, - + } _attributes_to_types = { @@ -1002,7 +1002,7 @@ class RatingSection(Definition): "month3": "float", "month4": "float", "month5": "float", - + } def __init__(self): @@ -1012,7 +1012,7 @@ def __init__(self): self.month3: float self.month4: float self.month5: float - + # noinspection SpellCheckingInspection class CryptoTick(Definition): @@ -1022,7 +1022,7 @@ class CryptoTick(Definition): "exchange": "exchange", "conditions": "conditions", "timestamp": "timestamp", - + } _attribute_is_primitive = { @@ -1031,7 +1031,7 @@ class CryptoTick(Definition): "exchange": True, "conditions": False, "timestamp": True, - + } _attributes_to_types = { @@ -1040,7 +1040,7 @@ class CryptoTick(Definition): "exchange": "int", "conditions": "List[int]", "timestamp": "int", - + } def __init__(self): @@ -1049,7 +1049,7 @@ def __init__(self): self.exchange: int self.conditions: List[int] self.timestamp: int - + # noinspection SpellCheckingInspection class CryptoTickJson(Definition): @@ -1059,7 +1059,7 @@ class CryptoTickJson(Definition): "x": "exchange_the_trade_occured_on", "c": "c", "t": "timestamp_of_this_trade", - + } _attribute_is_primitive = { @@ -1068,7 +1068,7 @@ class CryptoTickJson(Definition): "exchange_the_trade_occured_on": True, "c": False, "timestamp_of_this_trade": True, - + } _attributes_to_types = { @@ -1077,7 +1077,7 @@ class CryptoTickJson(Definition): "exchange_the_trade_occured_on": "int", "c": "List[int]", "timestamp_of_this_trade": "int", - + } def __init__(self): @@ -1086,7 +1086,7 @@ def __init__(self): self.exchange_the_trade_occured_on: int self.c: List[int] self.timestamp_of_this_trade: int - + # noinspection SpellCheckingInspection class CryptoExchange(Definition): @@ -1096,7 +1096,7 @@ class CryptoExchange(Definition): "market": "market", "name": "name", "url": "url", - + } _attribute_is_primitive = { @@ -1105,7 +1105,7 @@ class CryptoExchange(Definition): "market": True, "name": True, "url": True, - + } _attributes_to_types = { @@ -1114,7 +1114,7 @@ class CryptoExchange(Definition): "market": "str", "name": "str", "url": "str", - + } def __init__(self): @@ -1123,7 +1123,7 @@ def __init__(self): self.market: str self.name: str self.url: str - + # noinspection SpellCheckingInspection class CryptoSnapshotTicker(Definition): @@ -1136,7 +1136,7 @@ class CryptoSnapshotTicker(Definition): "todaysChange": "todays_change", "todaysChangePerc": "todays_chang_eperc", "updated": "updated", - + } _attribute_is_primitive = { @@ -1148,7 +1148,7 @@ class CryptoSnapshotTicker(Definition): "todays_change": True, "todays_chang_eperc": True, "updated": True, - + } _attributes_to_types = { @@ -1160,7 +1160,7 @@ class CryptoSnapshotTicker(Definition): "todays_change": "int", "todays_chang_eperc": "int", "updated": "int", - + } def __init__(self): @@ -1172,32 +1172,32 @@ def __init__(self): self.todays_change: int self.todays_chang_eperc: int self.updated: int - + # noinspection SpellCheckingInspection class CryptoSnapshotBookItem(Definition): _swagger_name_to_python = { "p": "price_of_this_book_level", "x": "exchange_to_size_of_this_price_level", - + } _attribute_is_primitive = { "price_of_this_book_level": True, "exchange_to_size_of_this_price_level": True, - + } _attributes_to_types = { "price_of_this_book_level": "int", "exchange_to_size_of_this_price_level": "Dict[str, str]", - + } def __init__(self): self.price_of_this_book_level: int self.exchange_to_size_of_this_price_level: Dict[str, str] - + # noinspection SpellCheckingInspection class CryptoSnapshotTickerBook(Definition): @@ -1209,7 +1209,7 @@ class CryptoSnapshotTickerBook(Definition): "askCount": "ask_count", "spread": "spread", "updated": "updated", - + } _attribute_is_primitive = { @@ -1220,7 +1220,7 @@ class CryptoSnapshotTickerBook(Definition): "ask_count": True, "spread": True, "updated": True, - + } _attributes_to_types = { @@ -1231,7 +1231,7 @@ class CryptoSnapshotTickerBook(Definition): "ask_count": "int", "spread": "int", "updated": "int", - + } def __init__(self): @@ -1242,7 +1242,7 @@ def __init__(self): self.ask_count: int self.spread: int self.updated: int - + # noinspection SpellCheckingInspection class CryptoSnapshotAgg(Definition): @@ -1252,7 +1252,7 @@ class CryptoSnapshotAgg(Definition): "l": "low_price", "o": "open_price", "v": "volume", - + } _attribute_is_primitive = { @@ -1261,7 +1261,7 @@ class CryptoSnapshotAgg(Definition): "low_price": True, "open_price": True, "volume": True, - + } _attributes_to_types = { @@ -1270,7 +1270,7 @@ class CryptoSnapshotAgg(Definition): "low_price": "int", "open_price": "int", "volume": "int", - + } def __init__(self): @@ -1279,7 +1279,7 @@ def __init__(self): self.low_price: int self.open_price: int self.volume: int - + # noinspection SpellCheckingInspection class Forex(Definition): @@ -1287,28 +1287,28 @@ class Forex(Definition): "a": "ask_price", "b": "bid_price", "t": "timestamp_of_this_trade", - + } _attribute_is_primitive = { "ask_price": True, "bid_price": True, "timestamp_of_this_trade": True, - + } _attributes_to_types = { "ask_price": "int", "bid_price": "int", "timestamp_of_this_trade": "int", - + } def __init__(self): self.ask_price: int self.bid_price: int self.timestamp_of_this_trade: int - + # noinspection SpellCheckingInspection class LastForexTrade(Definition): @@ -1316,28 +1316,28 @@ class LastForexTrade(Definition): "price": "price", "exchange": "exchange", "timestamp": "timestamp", - + } _attribute_is_primitive = { "price": True, "exchange": True, "timestamp": True, - + } _attributes_to_types = { "price": "int", "exchange": "int", "timestamp": "int", - + } def __init__(self): self.price: int self.exchange: int self.timestamp: int - + # noinspection SpellCheckingInspection class LastForexQuote(Definition): @@ -1346,7 +1346,7 @@ class LastForexQuote(Definition): "bid": "bid", "exchange": "exchange", "timestamp": "timestamp", - + } _attribute_is_primitive = { @@ -1354,7 +1354,7 @@ class LastForexQuote(Definition): "bid": True, "exchange": True, "timestamp": True, - + } _attributes_to_types = { @@ -1362,7 +1362,7 @@ class LastForexQuote(Definition): "bid": "int", "exchange": "int", "timestamp": "int", - + } def __init__(self): @@ -1370,7 +1370,7 @@ def __init__(self): self.bid: int self.exchange: int self.timestamp: int - + # noinspection SpellCheckingInspection class ForexAggregate(Definition): @@ -1381,7 +1381,7 @@ class ForexAggregate(Definition): "h": "high_price", "v": "volume_of_all_trades", "t": "timestamp_of_this_aggregation", - + } _attribute_is_primitive = { @@ -1391,7 +1391,7 @@ class ForexAggregate(Definition): "high_price": True, "volume_of_all_trades": True, "timestamp_of_this_aggregation": True, - + } _attributes_to_types = { @@ -1401,7 +1401,7 @@ class ForexAggregate(Definition): "high_price": "int", "volume_of_all_trades": "int", "timestamp_of_this_aggregation": "int", - + } def __init__(self): @@ -1411,7 +1411,7 @@ def __init__(self): self.high_price: int self.volume_of_all_trades: int self.timestamp_of_this_aggregation: int - + # noinspection SpellCheckingInspection class ForexSnapshotTicker(Definition): @@ -1424,7 +1424,7 @@ class ForexSnapshotTicker(Definition): "todaysChange": "todays_change", "todaysChangePerc": "todays_chang_eperc", "updated": "updated", - + } _attribute_is_primitive = { @@ -1436,7 +1436,7 @@ class ForexSnapshotTicker(Definition): "todays_change": True, "todays_chang_eperc": True, "updated": True, - + } _attributes_to_types = { @@ -1448,7 +1448,7 @@ class ForexSnapshotTicker(Definition): "todays_change": "int", "todays_chang_eperc": "int", "updated": "int", - + } def __init__(self): @@ -1460,7 +1460,7 @@ def __init__(self): self.todays_change: int self.todays_chang_eperc: int self.updated: int - + # noinspection SpellCheckingInspection class ForexSnapshotAgg(Definition): @@ -1470,7 +1470,7 @@ class ForexSnapshotAgg(Definition): "l": "low_price", "o": "open_price", "v": "volume", - + } _attribute_is_primitive = { @@ -1479,7 +1479,7 @@ class ForexSnapshotAgg(Definition): "low_price": True, "open_price": True, "volume": True, - + } _attributes_to_types = { @@ -1488,7 +1488,7 @@ class ForexSnapshotAgg(Definition): "low_price": "int", "open_price": "int", "volume": "int", - + } def __init__(self): @@ -1497,7 +1497,7 @@ def __init__(self): self.low_price: int self.open_price: int self.volume: int - + # noinspection SpellCheckingInspection class Ticker(Definition): @@ -1513,7 +1513,7 @@ class Ticker(Definition): "updated": "updated", "attrs": "attrs", "codes": "codes", - + } _attribute_is_primitive = { @@ -1528,7 +1528,7 @@ class Ticker(Definition): "updated": True, "attrs": True, "codes": True, - + } _attributes_to_types = { @@ -1543,7 +1543,7 @@ class Ticker(Definition): "updated": "str", "attrs": "Dict[str, str]", "codes": "Dict[str, str]", - + } def __init__(self): @@ -1558,7 +1558,7 @@ def __init__(self): self.updated: str self.attrs: Dict[str, str] self.codes: Dict[str, str] - + # noinspection SpellCheckingInspection class Split(Definition): @@ -1571,7 +1571,7 @@ class Split(Definition): "ratio": "ratio", "tofactor": "tofactor", "forfactor": "forfactor", - + } _attribute_is_primitive = { @@ -1583,7 +1583,7 @@ class Split(Definition): "ratio": True, "tofactor": True, "forfactor": True, - + } _attributes_to_types = { @@ -1595,7 +1595,7 @@ class Split(Definition): "ratio": "float", "tofactor": "float", "forfactor": "float", - + } def __init__(self): @@ -1607,7 +1607,7 @@ def __init__(self): self.ratio: float self.tofactor: float self.forfactor: float - + # noinspection SpellCheckingInspection class Financials(Definition): @@ -1722,7 +1722,7 @@ class Financials(Definition): "taxLiabilities": "tax_liabilities", "tangibleAssetsBookValuePerShare": "tangible_asset_sbo_okva_lu_epershare", "workingCapital": "working_capital", - + } _attribute_is_primitive = { @@ -1836,7 +1836,7 @@ class Financials(Definition): "tax_liabilities": True, "tangible_asset_sbo_okva_lu_epershare": True, "working_capital": True, - + } _attributes_to_types = { @@ -1950,7 +1950,7 @@ class Financials(Definition): "tax_liabilities": "int", "tangible_asset_sbo_okva_lu_epershare": "int", "working_capital": "int", - + } def __init__(self): @@ -2064,7 +2064,7 @@ def __init__(self): self.tax_liabilities: int self.tangible_asset_sbo_okva_lu_epershare: int self.working_capital: int - + # noinspection SpellCheckingInspection class Trade(Definition): @@ -2077,7 +2077,7 @@ class Trade(Definition): "p": "price_of_the_trade", "s": "size_of_the_trade", "t": "timestamp_of_this_trade", - + } _attribute_is_primitive = { @@ -2089,7 +2089,7 @@ class Trade(Definition): "price_of_the_trade": True, "size_of_the_trade": True, "timestamp_of_this_trade": True, - + } _attributes_to_types = { @@ -2101,7 +2101,7 @@ class Trade(Definition): "price_of_the_trade": "int", "size_of_the_trade": "int", "timestamp_of_this_trade": "int", - + } def __init__(self): @@ -2113,7 +2113,7 @@ def __init__(self): self.price_of_the_trade: int self.size_of_the_trade: int self.timestamp_of_this_trade: int - + # noinspection SpellCheckingInspection class StocksSnapshotTicker(Definition): @@ -2127,7 +2127,7 @@ class StocksSnapshotTicker(Definition): "todaysChange": "todays_change", "todaysChangePerc": "todays_chang_eperc", "updated": "updated", - + } _attribute_is_primitive = { @@ -2140,7 +2140,7 @@ class StocksSnapshotTicker(Definition): "todays_change": True, "todays_chang_eperc": True, "updated": True, - + } _attributes_to_types = { @@ -2153,7 +2153,7 @@ class StocksSnapshotTicker(Definition): "todays_change": "int", "todays_chang_eperc": "int", "updated": "int", - + } def __init__(self): @@ -2166,32 +2166,32 @@ def __init__(self): self.todays_change: int self.todays_chang_eperc: int self.updated: int - + # noinspection SpellCheckingInspection class StocksSnapshotBookItem(Definition): _swagger_name_to_python = { "p": "price_of_this_book_level", "x": "exchange_to_size_of_this_price_level", - + } _attribute_is_primitive = { "price_of_this_book_level": True, "exchange_to_size_of_this_price_level": True, - + } _attributes_to_types = { "price_of_this_book_level": "int", "exchange_to_size_of_this_price_level": "Dict[str, str]", - + } def __init__(self): self.price_of_this_book_level: int self.exchange_to_size_of_this_price_level: Dict[str, str] - + # noinspection SpellCheckingInspection class StocksSnapshotTickerBook(Definition): @@ -2203,7 +2203,7 @@ class StocksSnapshotTickerBook(Definition): "askCount": "ask_count", "spread": "spread", "updated": "updated", - + } _attribute_is_primitive = { @@ -2214,7 +2214,7 @@ class StocksSnapshotTickerBook(Definition): "ask_count": True, "spread": True, "updated": True, - + } _attributes_to_types = { @@ -2225,7 +2225,7 @@ class StocksSnapshotTickerBook(Definition): "ask_count": "int", "spread": "int", "updated": "int", - + } def __init__(self): @@ -2236,7 +2236,7 @@ def __init__(self): self.ask_count: int self.spread: int self.updated: int - + # noinspection SpellCheckingInspection class StocksV2Trade(Definition): @@ -2252,7 +2252,7 @@ class StocksV2Trade(Definition): "c": "c", "p": "price_of_the_trade", "z": "tape_where_trade_occured", - + } _attribute_is_primitive = { @@ -2267,7 +2267,7 @@ class StocksV2Trade(Definition): "c": False, "price_of_the_trade": True, "tape_where_trade_occured": True, - + } _attributes_to_types = { @@ -2282,7 +2282,7 @@ class StocksV2Trade(Definition): "c": "List[int]", "price_of_the_trade": "int", "tape_where_trade_occured": "int", - + } def __init__(self): @@ -2297,7 +2297,7 @@ def __init__(self): self.c: List[int] self.price_of_the_trade: int self.tape_where_trade_occured: int - + # noinspection SpellCheckingInspection class StocksV2NBBO(Definition): @@ -2316,7 +2316,7 @@ class StocksV2NBBO(Definition): "X": "a__sk_exchange__id", "S": "a__sk_size", "z": "tape_where_trade_occured", - + } _attribute_is_primitive = { @@ -2334,7 +2334,7 @@ class StocksV2NBBO(Definition): "a__sk_exchange__id": True, "a__sk_size": True, "tape_where_trade_occured": True, - + } _attributes_to_types = { @@ -2352,7 +2352,7 @@ class StocksV2NBBO(Definition): "a__sk_exchange__id": "int", "a__sk_size": "int", "tape_where_trade_occured": "int", - + } def __init__(self): @@ -2370,7 +2370,7 @@ def __init__(self): self.a__sk_exchange__id: int self.a__sk_size: int self.tape_where_trade_occured: int - + # noinspection SpellCheckingInspection class StocksSnapshotAgg(Definition): @@ -2380,7 +2380,7 @@ class StocksSnapshotAgg(Definition): "l": "low_price", "o": "open_price", "v": "volume", - + } _attribute_is_primitive = { @@ -2389,7 +2389,7 @@ class StocksSnapshotAgg(Definition): "low_price": True, "open_price": True, "volume": True, - + } _attributes_to_types = { @@ -2398,7 +2398,7 @@ class StocksSnapshotAgg(Definition): "low_price": "int", "open_price": "int", "volume": "int", - + } def __init__(self): @@ -2407,7 +2407,7 @@ def __init__(self): self.low_price: int self.open_price: int self.volume: int - + # noinspection SpellCheckingInspection class StocksSnapshotQuote(Definition): @@ -2417,7 +2417,7 @@ class StocksSnapshotQuote(Definition): "P": "ask_price", "S": "ask_size_in_lots", "t": "last_updated_timestamp", - + } _attribute_is_primitive = { @@ -2426,7 +2426,7 @@ class StocksSnapshotQuote(Definition): "ask_price": True, "ask_size_in_lots": True, "last_updated_timestamp": True, - + } _attributes_to_types = { @@ -2435,7 +2435,7 @@ class StocksSnapshotQuote(Definition): "ask_price": "int", "ask_size_in_lots": "int", "last_updated_timestamp": "int", - + } def __init__(self): @@ -2444,7 +2444,7 @@ def __init__(self): self.ask_price: int self.ask_size_in_lots: int self.last_updated_timestamp: int - + # noinspection SpellCheckingInspection class Aggv2(Definition): @@ -2457,7 +2457,7 @@ class Aggv2(Definition): "l": "low", "t": "unix_msec_timestamp", "n": "number_of_items_in_aggregate_window", - + } _attribute_is_primitive = { @@ -2469,7 +2469,7 @@ class Aggv2(Definition): "low": True, "unix_msec_timestamp": True, "number_of_items_in_aggregate_window": True, - + } _attributes_to_types = { @@ -2481,7 +2481,7 @@ class Aggv2(Definition): "low": "int", "unix_msec_timestamp": "float", "number_of_items_in_aggregate_window": "float", - + } def __init__(self): @@ -2493,7 +2493,7 @@ def __init__(self): self.low: int self.unix_msec_timestamp: float self.number_of_items_in_aggregate_window: float - + # noinspection SpellCheckingInspection class AggResponse(Definition): @@ -2504,7 +2504,7 @@ class AggResponse(Definition): "queryCount": "query_count", "resultsCount": "results_count", "results": "results", - + } _attribute_is_primitive = { @@ -2514,7 +2514,7 @@ class AggResponse(Definition): "query_count": True, "results_count": True, "results": False, - + } _attributes_to_types = { @@ -2524,7 +2524,7 @@ class AggResponse(Definition): "query_count": "float", "results_count": "float", "results": "List[Aggv2]", - + } def __init__(self): @@ -2534,298 +2534,298 @@ def __init__(self): self.query_count: float self.results_count: float self.results: List[Aggv2] - + # noinspection SpellCheckingInspection -class TickersApiResponse(Definition): +class ReferenceTickersApiResponse(Definition): _swagger_name_to_python = { "symbol": "symbol", - + } _attribute_is_primitive = { "symbol": False, - + } _attributes_to_types = { "symbol": "List[Symbol]", - + } def __init__(self): self.symbol: List[Symbol] - + # noinspection SpellCheckingInspection -class TickerTypesApiResponse(Definition): +class ReferenceTickerTypesApiResponse(Definition): _swagger_name_to_python = { "status": "status", "results": "results", - + } _attribute_is_primitive = { "status": True, "results": True, - + } _attributes_to_types = { "status": "str", "results": "Dict[str, str]", - + } def __init__(self): self.status: str self.results: Dict[str, str] - + # noinspection SpellCheckingInspection -class TickerDetailsApiResponse(Definition): +class ReferenceTickerDetailsApiResponse(Definition): _swagger_name_to_python = { "company": "company", - + } _attribute_is_primitive = { "company": False, - + } _attributes_to_types = { "company": "Company", - + } def __init__(self): self.company: Company - + # noinspection SpellCheckingInspection -class TickerNewsApiResponse(Definition): +class ReferenceTickerNewsApiResponse(Definition): _swagger_name_to_python = { "news": "news", - + } _attribute_is_primitive = { "news": False, - + } _attributes_to_types = { "news": "List[News]", - + } def __init__(self): self.news: List[News] - + # noinspection SpellCheckingInspection -class MarketsApiResponse(Definition): +class ReferenceMarketsApiResponse(Definition): _swagger_name_to_python = { "status": "status", "results": "results", - + } _attribute_is_primitive = { "status": True, "results": False, - + } _attributes_to_types = { "status": "str", "results": "List[Dict[str, str]]", - + } def __init__(self): self.status: str self.results: List[Dict[str, str]] - + # noinspection SpellCheckingInspection -class LocalesApiResponse(Definition): +class ReferenceLocalesApiResponse(Definition): _swagger_name_to_python = { "status": "status", "results": "results", - + } _attribute_is_primitive = { "status": True, "results": False, - + } _attributes_to_types = { "status": "str", "results": "List[Dict[str, str]]", - + } def __init__(self): self.status: str self.results: List[Dict[str, str]] - + # noinspection SpellCheckingInspection -class StockSplitsApiResponse(Definition): +class ReferenceStockSplitsApiResponse(Definition): _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", - + } _attribute_is_primitive = { "status": True, "count": True, "results": False, - + } _attributes_to_types = { "status": "str", "count": "float", "results": "List[Split]", - + } def __init__(self): self.status: str self.count: float self.results: List[Split] - + # noinspection SpellCheckingInspection -class StockDividendsApiResponse(Definition): +class ReferenceStockDividendsApiResponse(Definition): _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", - + } _attribute_is_primitive = { "status": True, "count": True, "results": False, - + } _attributes_to_types = { "status": "str", "count": "float", "results": "List[Dividend]", - + } def __init__(self): self.status: str self.count: float self.results: List[Dividend] - + # noinspection SpellCheckingInspection -class StockFinancialsApiResponse(Definition): +class ReferenceStockFinancialsApiResponse(Definition): _swagger_name_to_python = { "status": "status", "count": "count", "results": "results", - + } _attribute_is_primitive = { "status": True, "count": True, "results": False, - + } _attributes_to_types = { "status": "str", "count": "float", "results": "List[Financials]", - + } def __init__(self): self.status: str self.count: float self.results: List[Financials] - + # noinspection SpellCheckingInspection -class MarketStatusApiResponse(Definition): +class ReferenceMarketStatusApiResponse(Definition): _swagger_name_to_python = { "marketstatus": "marketstatus", - + } _attribute_is_primitive = { "marketstatus": False, - + } _attributes_to_types = { "marketstatus": "MarketStatus", - + } def __init__(self): self.marketstatus: MarketStatus - + # noinspection SpellCheckingInspection -class MarketHolidaysApiResponse(Definition): +class ReferenceMarketHolidaysApiResponse(Definition): _swagger_name_to_python = { "marketholiday": "marketholiday", - + } _attribute_is_primitive = { "marketholiday": False, - + } _attributes_to_types = { "marketholiday": "List[MarketHoliday]", - + } def __init__(self): self.marketholiday: List[MarketHoliday] - + # noinspection SpellCheckingInspection -class ExchangesApiResponse(Definition): +class StocksEquitiesExchangesApiResponse(Definition): _swagger_name_to_python = { "exchange": "exchange", - + } _attribute_is_primitive = { "exchange": False, - + } _attributes_to_types = { "exchange": "List[Exchange]", - + } def __init__(self): self.exchange: List[Exchange] - + # noinspection SpellCheckingInspection -class HistoricTradesApiResponse(Definition): +class StocksEquitiesHistoricTradesApiResponse(Definition): _swagger_name_to_python = { "day": "day", "map": "map", @@ -2833,7 +2833,7 @@ class HistoricTradesApiResponse(Definition): "status": "status", "symbol": "symbol", "ticks": "ticks", - + } _attribute_is_primitive = { @@ -2843,7 +2843,7 @@ class HistoricTradesApiResponse(Definition): "status": True, "symbol": True, "ticks": False, - + } _attributes_to_types = { @@ -2853,7 +2853,7 @@ class HistoricTradesApiResponse(Definition): "status": "str", "symbol": "str", "ticks": "List[Trade]", - + } def __init__(self): @@ -2863,7 +2863,7 @@ def __init__(self): self.status: str self.symbol: str self.ticks: List[Trade] - + # noinspection SpellCheckingInspection class HistoricTradesV2ApiResponse(Definition): @@ -2873,7 +2873,7 @@ class HistoricTradesV2ApiResponse(Definition): "success": "success", "ticker": "ticker", "results": "results", - + } _attribute_is_primitive = { @@ -2882,7 +2882,7 @@ class HistoricTradesV2ApiResponse(Definition): "success": True, "ticker": True, "results": False, - + } _attributes_to_types = { @@ -2891,7 +2891,7 @@ class HistoricTradesV2ApiResponse(Definition): "success": "bool", "ticker": "str", "results": "List[StocksV2Trade]", - + } def __init__(self): @@ -2900,10 +2900,10 @@ def __init__(self): self.success: bool self.ticker: str self.results: List[StocksV2Trade] - + # noinspection SpellCheckingInspection -class HistoricQuotesApiResponse(Definition): +class StocksEquitiesHistoricQuotesApiResponse(Definition): _swagger_name_to_python = { "day": "day", "map": "map", @@ -2911,7 +2911,7 @@ class HistoricQuotesApiResponse(Definition): "status": "status", "symbol": "symbol", "ticks": "ticks", - + } _attribute_is_primitive = { @@ -2921,7 +2921,7 @@ class HistoricQuotesApiResponse(Definition): "status": True, "symbol": True, "ticks": False, - + } _attributes_to_types = { @@ -2931,7 +2931,7 @@ class HistoricQuotesApiResponse(Definition): "status": "str", "symbol": "str", "ticks": "List[Quote]", - + } def __init__(self): @@ -2941,7 +2941,7 @@ def __init__(self): self.status: str self.symbol: str self.ticks: List[Quote] - + # noinspection SpellCheckingInspection class HistoricNBboQuotesV2ApiResponse(Definition): @@ -2951,7 +2951,7 @@ class HistoricNBboQuotesV2ApiResponse(Definition): "success": "success", "ticker": "ticker", "results": "results", - + } _attribute_is_primitive = { @@ -2960,7 +2960,7 @@ class HistoricNBboQuotesV2ApiResponse(Definition): "success": True, "ticker": True, "results": False, - + } _attributes_to_types = { @@ -2969,7 +2969,7 @@ class HistoricNBboQuotesV2ApiResponse(Definition): "success": "bool", "ticker": "str", "results": "List[StocksV2NBBO]", - + } def __init__(self): @@ -2978,74 +2978,74 @@ def __init__(self): self.success: bool self.ticker: str self.results: List[StocksV2NBBO] - + # noinspection SpellCheckingInspection -class LastTradeForASymbolApiResponse(Definition): +class StocksEquitiesLastTradeForASymbolApiResponse(Definition): _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", - + } _attribute_is_primitive = { "status": True, "symbol": True, "last": False, - + } _attributes_to_types = { "status": "str", "symbol": "str", "last": "LastTrade", - + } def __init__(self): self.status: str self.symbol: str self.last: LastTrade - + # noinspection SpellCheckingInspection -class LastQuoteForASymbolApiResponse(Definition): +class StocksEquitiesLastQuoteForASymbolApiResponse(Definition): _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", - + } _attribute_is_primitive = { "status": True, "symbol": True, "last": False, - + } _attributes_to_types = { "status": "str", "symbol": "str", "last": "LastQuote", - + } def __init__(self): self.status: str self.symbol: str self.last: LastQuote - + # noinspection SpellCheckingInspection -class DailyOpenCloseApiResponse(Definition): +class StocksEquitiesDailyOpenCloseApiResponse(Definition): _swagger_name_to_python = { "symbol": "symbol", "open": "open", "close": "close", "afterHours": "after_hours", - + } _attribute_is_primitive = { @@ -3053,7 +3053,7 @@ class DailyOpenCloseApiResponse(Definition): "open": False, "close": False, "after_hours": False, - + } _attributes_to_types = { @@ -3061,7 +3061,7 @@ class DailyOpenCloseApiResponse(Definition): "open": "HistTrade", "close": "HistTrade", "after_hours": "HistTrade", - + } def __init__(self): @@ -3069,169 +3069,169 @@ def __init__(self): self.open: HistTrade self.close: HistTrade self.after_hours: HistTrade - + # noinspection SpellCheckingInspection -class ConditionMappingsApiResponse(Definition): +class StocksEquitiesConditionMappingsApiResponse(Definition): _swagger_name_to_python = { "conditiontypemap": "conditiontypemap", - + } _attribute_is_primitive = { "conditiontypemap": False, - + } _attributes_to_types = { "conditiontypemap": "ConditionTypeMap", - + } def __init__(self): self.conditiontypemap: ConditionTypeMap - + # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(Definition): +class StocksEquitiesSnapshotAllTickersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[StocksSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[StocksSnapshotTicker] - + # noinspection SpellCheckingInspection -class SnapshotSingleTickerApiResponse(Definition): +class StocksEquitiesSnapshotSingleTickerApiResponse(Definition): _swagger_name_to_python = { "status": "status", "ticker": "ticker", - + } _attribute_is_primitive = { "status": True, "ticker": False, - + } _attributes_to_types = { "status": "str", "ticker": "StocksSnapshotTicker", - + } def __init__(self): self.status: str self.ticker: StocksSnapshotTicker - + # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(Definition): +class StocksEquitiesSnapshotGainersLosersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[StocksSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[StocksSnapshotTicker] - + # noinspection SpellCheckingInspection -class PreviousCloseApiResponse(Definition): +class StocksEquitiesPreviousCloseApiResponse(Definition): _swagger_name_to_python = { "aggresponse": "aggresponse", - + } _attribute_is_primitive = { "aggresponse": False, - + } _attributes_to_types = { "aggresponse": "AggResponse", - + } def __init__(self): self.aggresponse: AggResponse - + # noinspection SpellCheckingInspection -class AggregatesApiResponse(Definition): +class StocksEquitiesAggregatesApiResponse(Definition): _swagger_name_to_python = { "aggresponse": "aggresponse", - + } _attribute_is_primitive = { "aggresponse": False, - + } _attributes_to_types = { "aggresponse": "AggResponse", - + } def __init__(self): self.aggresponse: AggResponse - + # noinspection SpellCheckingInspection -class GroupedDailyApiResponse(Definition): +class StocksEquitiesGroupedDailyApiResponse(Definition): _swagger_name_to_python = { "aggresponse": "aggresponse", - + } _attribute_is_primitive = { "aggresponse": False, - + } _attributes_to_types = { "aggresponse": "AggResponse", - + } def __init__(self): self.aggresponse: AggResponse - + # noinspection SpellCheckingInspection -class HistoricForexTicksApiResponse(Definition): +class ForexCurrenciesHistoricForexTicksApiResponse(Definition): _swagger_name_to_python = { "day": "day", "map": "map", @@ -3239,7 +3239,7 @@ class HistoricForexTicksApiResponse(Definition): "status": "status", "pair": "pair", "ticks": "ticks", - + } _attribute_is_primitive = { @@ -3249,7 +3249,7 @@ class HistoricForexTicksApiResponse(Definition): "status": True, "pair": True, "ticks": False, - + } _attributes_to_types = { @@ -3259,7 +3259,7 @@ class HistoricForexTicksApiResponse(Definition): "status": "str", "pair": "str", "ticks": "List[Forex]", - + } def __init__(self): @@ -3269,10 +3269,10 @@ def __init__(self): self.status: str self.pair: str self.ticks: List[Forex] - + # noinspection SpellCheckingInspection -class RealTimeCurrencyConversionApiResponse(Definition): +class ForexCurrenciesRealTimeCurrencyConversionApiResponse(Definition): _swagger_name_to_python = { "status": "status", "from": "from_", @@ -3281,7 +3281,7 @@ class RealTimeCurrencyConversionApiResponse(Definition): "converted": "converted", "lastTrade": "last_trade", "symbol": "symbol", - + } _attribute_is_primitive = { @@ -3292,7 +3292,7 @@ class RealTimeCurrencyConversionApiResponse(Definition): "converted": True, "last_trade": False, "symbol": True, - + } _attributes_to_types = { @@ -3303,7 +3303,7 @@ class RealTimeCurrencyConversionApiResponse(Definition): "converted": "float", "last_trade": "LastForexTrade", "symbol": "str", - + } def __init__(self): @@ -3314,116 +3314,116 @@ def __init__(self): self.converted: float self.last_trade: LastForexTrade self.symbol: str - + # noinspection SpellCheckingInspection -class LastQuoteForACurrencyPairApiResponse(Definition): +class ForexCurrenciesLastQuoteForACurrencyPairApiResponse(Definition): _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", - + } _attribute_is_primitive = { "status": True, "symbol": True, "last": False, - + } _attributes_to_types = { "status": "str", "symbol": "str", "last": "LastForexQuote", - + } def __init__(self): self.status: str self.symbol: str self.last: LastForexQuote - + # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(Definition): +class ForexCurrenciesSnapshotAllTickersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[ForexSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[ForexSnapshotTicker] - + # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(Definition): +class ForexCurrenciesSnapshotGainersLosersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[ForexSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[ForexSnapshotTicker] - + # noinspection SpellCheckingInspection -class CryptoExchangesApiResponse(Definition): +class CryptoCryptoExchangesApiResponse(Definition): _swagger_name_to_python = { "cryptoexchange": "cryptoexchange", - + } _attribute_is_primitive = { "cryptoexchange": False, - + } _attributes_to_types = { "cryptoexchange": "List[CryptoExchange]", - + } def __init__(self): self.cryptoexchange: List[CryptoExchange] - + # noinspection SpellCheckingInspection -class LastTradeForACryptoPairApiResponse(Definition): +class CryptoLastTradeForACryptoPairApiResponse(Definition): _swagger_name_to_python = { "status": "status", "symbol": "symbol", "last": "last", "lastAverage": "last_average", - + } _attribute_is_primitive = { @@ -3431,7 +3431,7 @@ class LastTradeForACryptoPairApiResponse(Definition): "symbol": True, "last": False, "last_average": True, - + } _attributes_to_types = { @@ -3439,7 +3439,7 @@ class LastTradeForACryptoPairApiResponse(Definition): "symbol": "str", "last": "CryptoTick", "last_average": "Dict[str, str]", - + } def __init__(self): @@ -3447,10 +3447,10 @@ def __init__(self): self.symbol: str self.last: CryptoTick self.last_average: Dict[str, str] - + # noinspection SpellCheckingInspection -class DailyOpenCloseApiResponse(Definition): +class CryptoDailyOpenCloseApiResponse(Definition): _swagger_name_to_python = { "symbol": "symbol", "isUTC": "is___utc", @@ -3459,7 +3459,7 @@ class DailyOpenCloseApiResponse(Definition): "close": "close", "openTrades": "open_trades", "closingTrades": "closing_trades", - + } _attribute_is_primitive = { @@ -3470,7 +3470,7 @@ class DailyOpenCloseApiResponse(Definition): "close": True, "open_trades": False, "closing_trades": False, - + } _attributes_to_types = { @@ -3481,7 +3481,7 @@ class DailyOpenCloseApiResponse(Definition): "close": "int", "open_trades": "List[CryptoTickJson]", "closing_trades": "List[CryptoTickJson]", - + } def __init__(self): @@ -3492,10 +3492,10 @@ def __init__(self): self.close: int self.open_trades: List[CryptoTickJson] self.closing_trades: List[CryptoTickJson] - + # noinspection SpellCheckingInspection -class HistoricCryptoTradesApiResponse(Definition): +class CryptoHistoricCryptoTradesApiResponse(Definition): _swagger_name_to_python = { "day": "day", "map": "map", @@ -3503,7 +3503,7 @@ class HistoricCryptoTradesApiResponse(Definition): "status": "status", "symbol": "symbol", "ticks": "ticks", - + } _attribute_is_primitive = { @@ -3513,7 +3513,7 @@ class HistoricCryptoTradesApiResponse(Definition): "status": True, "symbol": True, "ticks": False, - + } _attributes_to_types = { @@ -3523,7 +3523,7 @@ class HistoricCryptoTradesApiResponse(Definition): "status": "str", "symbol": "str", "ticks": "List[CryptoTickJson]", - + } def __init__(self): @@ -3533,104 +3533,103 @@ def __init__(self): self.status: str self.symbol: str self.ticks: List[CryptoTickJson] - + # noinspection SpellCheckingInspection -class SnapshotAllTickersApiResponse(Definition): +class CryptoSnapshotAllTickersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[CryptoSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[CryptoSnapshotTicker] - + # noinspection SpellCheckingInspection -class SnapshotSingleTickerApiResponse(Definition): +class CryptoSnapshotSingleTickerApiResponse(Definition): _swagger_name_to_python = { "status": "status", "ticker": "ticker", - + } _attribute_is_primitive = { "status": True, "ticker": False, - + } _attributes_to_types = { "status": "str", "ticker": "CryptoSnapshotTicker", - + } def __init__(self): self.status: str self.ticker: CryptoSnapshotTicker - + # noinspection SpellCheckingInspection -class SnapshotSingleTickerFullBookApiResponse(Definition): +class CryptoSnapshotSingleTickerFullBookApiResponse(Definition): _swagger_name_to_python = { "status": "status", "data": "data", - + } _attribute_is_primitive = { "status": True, "data": False, - + } _attributes_to_types = { "status": "str", "data": "CryptoSnapshotTickerBook", - + } def __init__(self): self.status: str self.data: CryptoSnapshotTickerBook - + # noinspection SpellCheckingInspection -class SnapshotGainersLosersApiResponse(Definition): +class CryptoSnapshotGainersLosersApiResponse(Definition): _swagger_name_to_python = { "status": "status", "tickers": "tickers", - + } _attribute_is_primitive = { "status": True, "tickers": False, - + } _attributes_to_types = { "status": "str", "tickers": "List[CryptoSnapshotTicker]", - + } def __init__(self): self.status: str self.tickers: List[CryptoSnapshotTicker] - diff --git a/polygon/rest/models/unmarshal.py b/polygon/rest/models/unmarshal.py index 70b08a76..720fe7c0 100644 --- a/polygon/rest/models/unmarshal.py +++ b/polygon/rest/models/unmarshal.py @@ -1,7 +1,9 @@ +from typing import Type + from polygon.rest import models -def unmarshal_json(response_type, resp_json) -> models.Definition: +def unmarshal_json(response_type, resp_json) -> Type[models.AnyDefinition]: obj = models.name_to_class[response_type]() obj.unmarshal_json(resp_json) return obj diff --git a/polygon/rest/tests/integration/test_api.py b/polygon/rest/tests/integration/test_api.py index 973b8f20..2d7683ce 100644 --- a/polygon/rest/tests/integration/test_api.py +++ b/polygon/rest/tests/integration/test_api.py @@ -2,168 +2,169 @@ import unittest from polygon.rest import RESTClient +from polygon.rest import models class TestAPI(unittest.TestCase): + """ The tests checks is the response was correctly unmarshalled and that no error occurred """ + def setUp(self): api_key = os.getenv("API_KEY") assert api_key - self.api_client = RESTClient(api_key) - - def test_tickers(self): - resp = self.api_client.tickers() - print(resp) - - def test_ticker_types(self): - resp = self.api_client.ticker_types() - print(resp) - - def test_ticker_details(self): - resp = self.api_client.ticker_details("AAPL") - print(resp) - - def test_ticker_news(self): - resp = self.api_client.ticker_news("AAPL") - print(resp) - - def test_markets(self): - resp = self.api_client.markets() - print(resp) - - def test_locales(self): - resp = self.api_client.locales() - print(resp) - - def test_stock_splits(self): - resp = self.api_client.stock_splits("AAPL") - print(resp) - - def test_stock_dividends(self): - resp = self.api_client.stock_dividends("AAPL") - print(resp) - - def test_stock_financials(self): - resp = self.api_client.stock_financials("AAPL") - print(resp) - - def test_market_status(self): - resp = self.api_client.market_status() - print(resp) - - def test_market_holidays(self): - resp = self.api_client.market_holidays() - print(resp) - - def test_exchanges(self): - resp = self.api_client.exchanges() - print(resp) - - def test_historic_trades(self): - resp = self.api_client.historic_trades("AAPL", "2018-2-2") - print(resp) - + + def test_reference_tickers(self): + resp = self.api_client.reference_tickers(sort="ticker", perpage="50", page="1") + assert isinstance(resp, models.ReferenceTickersApiResponse) + + def test_reference_ticker_types(self): + resp = self.api_client.reference_ticker_types() + assert isinstance(resp, models.ReferenceTickerTypesApiResponse) + + def test_reference_ticker_details(self): + resp = self.api_client.reference_ticker_details("AAPL") + assert isinstance(resp, models.ReferenceTickerDetailsApiResponse) + + def test_reference_ticker_news(self): + resp = self.api_client.reference_ticker_news("AAPL", perpage="50", page="1") + assert isinstance(resp, models.ReferenceTickerNewsApiResponse) + + def test_reference_markets(self): + resp = self.api_client.reference_markets() + assert isinstance(resp, models.ReferenceMarketsApiResponse) + + def test_reference_locales(self): + resp = self.api_client.reference_locales() + assert isinstance(resp, models.ReferenceLocalesApiResponse) + + def test_reference_stock_splits(self): + resp = self.api_client.reference_stock_splits("AAPL") + assert isinstance(resp, models.ReferenceStockSplitsApiResponse) + + def test_reference_stock_dividends(self): + resp = self.api_client.reference_stock_dividends("AAPL") + assert isinstance(resp, models.ReferenceStockDividendsApiResponse) + + def test_reference_stock_financials(self): + resp = self.api_client.reference_stock_financials("AAPL", limit="5") + assert isinstance(resp, models.ReferenceStockFinancialsApiResponse) + + def test_reference_market_status(self): + resp = self.api_client.reference_market_status() + assert isinstance(resp, models.ReferenceMarketStatusApiResponse) + + def test_reference_market_holidays(self): + resp = self.api_client.reference_market_holidays() + assert isinstance(resp, models.ReferenceMarketHolidaysApiResponse) + + def test_stocks_equities_exchanges(self): + resp = self.api_client.stocks_equities_exchanges() + assert isinstance(resp, models.StocksEquitiesExchangesApiResponse) + + def test_stocks_equities_historic_trades(self): + resp = self.api_client.stocks_equities_historic_trades("AAPL", "2018-2-2", limit="100") + assert isinstance(resp, models.StocksEquitiesHistoricTradesApiResponse) + def test_historic_trades_v2(self): - resp = self.api_client.historic_trades_v2("AAPL", "2018-02-02") - print(resp) - - def test_historic_quotes(self): - resp = self.api_client.historic_quotes("AAPL", "2018-2-2") - print(resp) - + resp = self.api_client.historic_trades_v2("AAPL", "2018-02-02", limit="100") + assert isinstance(resp, models.HistoricTradesV2ApiResponse) + + def test_stocks_equities_historic_quotes(self): + resp = self.api_client.stocks_equities_historic_quotes("AAPL", "2018-2-2", limit="100") + assert isinstance(resp, models.StocksEquitiesHistoricQuotesApiResponse) + def test_historic_n___bbo_quotes_v2(self): - resp = self.api_client.historic_n___bbo_quotes_v2("AAPL", "2018-02-02") - print(resp) - - def test_last_trade_for_a_symbol(self): - resp = self.api_client.last_trade_for_a_symbol("AAPL") - print(resp) - - def test_last_quote_for_a_symbol(self): - resp = self.api_client.last_quote_for_a_symbol("AAPL") - print(resp) - - def test_daily_open_close(self): - resp = self.api_client.daily_open_close("AAPL", "2018-3-2") - print(resp) - - def test_condition_mappings(self): - resp = self.api_client.condition_mappings("trades") - print(resp) - - def test_snapshot_all_tickers(self): - resp = self.api_client.snapshot_all_tickers() - print(resp) - - def test_snapshot_single_ticker(self): - resp = self.api_client.snapshot_single_ticker("AAPL") - print(resp) - - def test_snapshot_gainers_losers(self): - resp = self.api_client.snapshot_gainers_losers("gainers") - print(resp) - - def test_previous_close(self): - resp = self.api_client.previous_close("AAPL") - print(resp) - - def test_aggregates(self): - resp = self.api_client.aggregates("AAPL", "1", "day", "2019-01-01", "2019-02-01") - print(resp) - - def test_grouped_daily(self): - resp = self.api_client.grouped_daily("US", "STOCKS", "2019-02-01") - print(resp) - - def test_historic_forex_ticks(self): - resp = self.api_client.historic_forex_ticks("AUD", "USD", "2018-2-2") - print(resp) - - def test_real_time_currency_conversion(self): - resp = self.api_client.real_time_currency_conversion("AUD", "USD") - print(resp) - - def test_last_quote_for_a_currency_pair(self): - resp = self.api_client.last_quote_for_a_currency_pair("AUD", "USD") - print(resp) - - def test_snapshot_all_tickers(self): - resp = self.api_client.snapshot_all_tickers() - print(resp) - - def test_snapshot_gainers_losers(self): - resp = self.api_client.snapshot_gainers_losers("gainers") - print(resp) - - def test_crypto_exchanges(self): - resp = self.api_client.crypto_exchanges() - print(resp) - - def test_last_trade_for_a_crypto_pair(self): - resp = self.api_client.last_trade_for_a_crypto_pair("BTC", "USD") - print(resp) - - def test_daily_open_close(self): - resp = self.api_client.daily_open_close("BTC", "USD", "2018-5-9") - print(resp) - - def test_historic_crypto_trades(self): - resp = self.api_client.historic_crypto_trades("BTC", "USD", "2018-5-9") - print(resp) - - def test_snapshot_all_tickers(self): - resp = self.api_client.snapshot_all_tickers() - print(resp) - - def test_snapshot_single_ticker(self): - resp = self.api_client.snapshot_single_ticker("~BTCUSD") - print(resp) - - def test_snapshot_single_ticker_full_book(self): - resp = self.api_client.snapshot_single_ticker_full_book("~BTCUSD") - print(resp) - - def test_snapshot_gainers_losers(self): - resp = self.api_client.snapshot_gainers_losers("gainers") - print(resp) - + resp = self.api_client.historic_n___bbo_quotes_v2("AAPL", "2018-02-02", limit="100") + assert isinstance(resp, models.HistoricNBboQuotesV2ApiResponse) + + def test_stocks_equities_last_trade_for_a_symbol(self): + resp = self.api_client.stocks_equities_last_trade_for_a_symbol("AAPL") + assert isinstance(resp, models.StocksEquitiesLastTradeForASymbolApiResponse) + + def test_stocks_equities_last_quote_for_a_symbol(self): + resp = self.api_client.stocks_equities_last_quote_for_a_symbol("AAPL") + assert isinstance(resp, models.StocksEquitiesLastQuoteForASymbolApiResponse) + + def test_stocks_equities_daily_open_close(self): + resp = self.api_client.stocks_equities_daily_open_close("AAPL", "2018-3-2") + assert isinstance(resp, models.StocksEquitiesDailyOpenCloseApiResponse) + + def test_stocks_equities_condition_mappings(self): + resp = self.api_client.stocks_equities_condition_mappings("trades") + assert isinstance(resp, models.StocksEquitiesConditionMappingsApiResponse) + + def test_stocks_equities_snapshot_all_tickers(self): + resp = self.api_client.stocks_equities_snapshot_all_tickers() + assert isinstance(resp, models.StocksEquitiesSnapshotAllTickersApiResponse) + + def test_stocks_equities_snapshot_single_ticker(self): + resp = self.api_client.stocks_equities_snapshot_single_ticker("AAPL") + assert isinstance(resp, models.StocksEquitiesSnapshotSingleTickerApiResponse) + + def test_stocks_equities_snapshot_gainers_losers(self): + resp = self.api_client.stocks_equities_snapshot_gainers_losers("gainers") + assert isinstance(resp, models.StocksEquitiesSnapshotGainersLosersApiResponse) + + def test_stocks_equities_previous_close(self): + resp = self.api_client.stocks_equities_previous_close("AAPL") + assert isinstance(resp, models.StocksEquitiesPreviousCloseApiResponse) + + def test_stocks_equities_aggregates(self): + resp = self.api_client.stocks_equities_aggregates("AAPL", "1", "day", "2019-01-01", "2019-02-01") + assert isinstance(resp, models.StocksEquitiesAggregatesApiResponse) + + def test_stocks_equities_grouped_daily(self): + resp = self.api_client.stocks_equities_grouped_daily("US", "STOCKS", "2019-02-01") + assert isinstance(resp, models.StocksEquitiesGroupedDailyApiResponse) + + def test_forex_currencies_historic_forex_ticks(self): + resp = self.api_client.forex_currencies_historic_forex_ticks("AUD", "USD", "2018-2-2", limit="100") + assert isinstance(resp, models.ForexCurrenciesHistoricForexTicksApiResponse) + + def test_forex_currencies_real_time_currency_conversion(self): + resp = self.api_client.forex_currencies_real_time_currency_conversion("AUD", "USD", amount="100", precision="2") + assert isinstance(resp, models.ForexCurrenciesRealTimeCurrencyConversionApiResponse) + + def test_forex_currencies_last_quote_for_a_currency_pair(self): + resp = self.api_client.forex_currencies_last_quote_for_a_currency_pair("AUD", "USD") + assert isinstance(resp, models.ForexCurrenciesLastQuoteForACurrencyPairApiResponse) + + def test_forex_currencies_snapshot_all_tickers(self): + resp = self.api_client.forex_currencies_snapshot_all_tickers() + assert isinstance(resp, models.ForexCurrenciesSnapshotAllTickersApiResponse) + + def test_forex_currencies_snapshot_gainers_losers(self): + resp = self.api_client.forex_currencies_snapshot_gainers_losers("gainers") + assert isinstance(resp, models.ForexCurrenciesSnapshotGainersLosersApiResponse) + + def test_crypto_crypto_exchanges(self): + resp = self.api_client.crypto_crypto_exchanges() + assert isinstance(resp, models.CryptoCryptoExchangesApiResponse) + + def test_crypto_last_trade_for_a_crypto_pair(self): + resp = self.api_client.crypto_last_trade_for_a_crypto_pair("BTC", "USD") + assert isinstance(resp, models.CryptoLastTradeForACryptoPairApiResponse) + + def test_crypto_daily_open_close(self): + resp = self.api_client.crypto_daily_open_close("BTC", "USD", "2018-5-9") + assert isinstance(resp, models.CryptoDailyOpenCloseApiResponse) + + def test_crypto_historic_crypto_trades(self): + resp = self.api_client.crypto_historic_crypto_trades("BTC", "USD", "2018-5-9", limit="100") + assert isinstance(resp, models.CryptoHistoricCryptoTradesApiResponse) + + def test_crypto_snapshot_all_tickers(self): + resp = self.api_client.crypto_snapshot_all_tickers() + assert isinstance(resp, models.CryptoSnapshotAllTickersApiResponse) + + def test_crypto_snapshot_single_ticker(self): + resp = self.api_client.crypto_snapshot_single_ticker("~BTCUSD") + assert isinstance(resp, models.CryptoSnapshotSingleTickerApiResponse) + + def test_crypto_snapshot_single_ticker_full_book(self): + resp = self.api_client.crypto_snapshot_single_ticker_full_book("~BTCUSD") + assert isinstance(resp, models.CryptoSnapshotSingleTickerFullBookApiResponse) + + def test_crypto_snapshot_gainers_losers(self): + resp = self.api_client.crypto_snapshot_gainers_losers("gainers") + assert isinstance(resp, models.CryptoSnapshotGainersLosersApiResponse) From 77c7953a1e6ab9204ef642338499c707acf04597 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:28:12 -0500 Subject: [PATCH 11/16] Better unmarshaling. Need to update code gen as well Moved some stuff around in the base definition class --- polygon/rest/models/__init__.py | 1 + polygon/rest/models/definitions.py | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py index a0b94dd5..a3dec9b9 100644 --- a/polygon/rest/models/__init__.py +++ b/polygon/rest/models/__init__.py @@ -93,6 +93,7 @@ from .definitions import Definition + AnyDefinition = typing.TypeVar("AnyDefinition", bound=Definition) # noinspection SpellCheckingInspection diff --git a/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py index b90fd7f5..dbcab997 100644 --- a/polygon/rest/models/definitions.py +++ b/polygon/rest/models/definitions.py @@ -1,12 +1,8 @@ -from typing import List, Dict, Any, Optional +import keyword +from typing import List, Dict, Any from polygon.rest import models -StockSymbol = str -ConditionTypeMap = Dict[str, str] -SymbolTypeMap = Dict[str, str] -TickerSymbol = str - class Definition: _swagger_name_to_python: Dict[str, str] @@ -23,8 +19,12 @@ def unmarshal_json(self, input_json): else: list_items = input_json self.__setattr__(list_attribute_name, list_items) + return self elif isinstance(input_json, dict): self._unmarshal_json_object(input_json) + return self + elif isinstance(input_json, float) or isinstance(input_json, int): + return input_json @staticmethod def _unmarshal_json_list(input_json, known_type): @@ -40,11 +40,13 @@ def _unmarshal_json_object(self, input_json): if key in self._swagger_name_to_python: attribute_name = self._swagger_name_to_python[key] if not self._attribute_is_primitive[attribute_name]: - if attribute_name in models.name_to_class: - value = models.name_to_class[attribute_name]() - value.unmarshal_json(input_json[key]) + if attribute_name in self._attributes_to_types: + attribute_type = self._attributes_to_types[attribute_name] + if attribute_type in models.name_to_class: + model = models.name_to_class[attribute_type]() + value = model.unmarshal_json(input_json[key]) else: - attribute_name = key + attribute_name = key + "_" if keyword.iskeyword(key) else "" self.__setattr__(attribute_name, value) return self @@ -109,7 +111,7 @@ class LastQuote(Definition): "bidsize": "bidsize", "bidexchange": "bidexchange", "timestamp": "timestamp", - + } _attribute_is_primitive = { @@ -3633,3 +3635,9 @@ class CryptoSnapshotGainersLosersApiResponse(Definition): def __init__(self): self.status: str self.tickers: List[CryptoSnapshotTicker] + + +StockSymbol = str +ConditionTypeMap = Dict[str, str] +SymbolTypeMap = Dict[str, str] +TickerSymbol = str From 97da4bca07b029ffe68ac02f0959ace6baa320cc Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:28:14 -0500 Subject: [PATCH 12/16] Added rest example --- README.md | 30 ++++++++++++++++++++++++++---- rest-example.py | 13 +++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 rest-example.py diff --git a/README.md b/README.md index b7fccbc3..86ac9cff 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,17 @@ # A Python client library for Polgyon's WebSocket and RESTful APIs -Currently this repo only supports the WebSocket API - ## Getting Started For a basic product overview, check out our [setup and use documentation](https://polygon.io/sockets) -## Simple Demo +## Simple WebSocket Demo ```python import time -from polygon_client import WebSocketClient, STOCKS_CLUSTER +from polygon import WebSocketClient, STOCKS_CLUSTER def my_customer_process_message(message): @@ -36,3 +34,27 @@ if __name__ == "__main__": main() ``` + +## Simple REST Demo +```python +from polygon import RESTClient + + +def main(): + key = "your api key" + client = RESTClient(key) + + resp = client.stocks_equities_daily_open_close("AAPL", "2018-3-2") + print(f"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}") + + +if __name__ == '__main__': + main() +``` + + +## Notes about the REST Client + +We use swagger as our API spec and we used this swagger to generate most of the code that defines the REST client. +We made this decision due to the size of our API, many endpoints and object definitions, and to accommodate future changes. + diff --git a/rest-example.py b/rest-example.py new file mode 100644 index 00000000..ffb917cf --- /dev/null +++ b/rest-example.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + + +def main(): + key = "your api key" + client = RESTClient(key) + + resp = client.stocks_equities_daily_open_close("AAPL", "2018-3-2") + print(f"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}") + + +if __name__ == '__main__': + main() From dbd68588a7c4dd35a7673c5db64a8d7c3dd0cfaa Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:33:38 -0500 Subject: [PATCH 13/16] moved tests to top level --- {polygon/rest/tests => tests}/integration/test_api.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {polygon/rest/tests => tests}/integration/test_api.py (100%) diff --git a/polygon/rest/tests/integration/test_api.py b/tests/integration/test_api.py similarity index 100% rename from polygon/rest/tests/integration/test_api.py rename to tests/integration/test_api.py From a8b9156c37d3654b6758e120d239bf9630fec221 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 16:25:36 -0500 Subject: [PATCH 14/16] trying out src, set up setup.py, tox can now run tests --- polygon/__init__.py | 2 -- polygon/websocket/__init__.py | 1 - requirements.txt | 24 ++++++++++++++----- setup.py | 6 ++++- src/polygon/__init__.py | 2 ++ {polygon => src/polygon}/rest/__init__.py | 0 {polygon => src/polygon}/rest/client.py | 0 .../polygon}/rest/models/__init__.py | 0 .../polygon}/rest/models/definitions.py | 0 .../polygon}/rest/models/unmarshal.py | 0 src/polygon/websocket/__init__.py | 1 + .../polygon}/websocket/websocket_client.py | 0 tests/__init__.py | 0 tests/integration/__init__.py | 0 .../{test_api.py => test_rest_api.py} | 15 ++++++------ tox.ini | 6 +++-- 16 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 polygon/__init__.py delete mode 100644 polygon/websocket/__init__.py create mode 100644 src/polygon/__init__.py rename {polygon => src/polygon}/rest/__init__.py (100%) rename {polygon => src/polygon}/rest/client.py (100%) rename {polygon => src/polygon}/rest/models/__init__.py (100%) rename {polygon => src/polygon}/rest/models/definitions.py (100%) rename {polygon => src/polygon}/rest/models/unmarshal.py (100%) create mode 100644 src/polygon/websocket/__init__.py rename {polygon => src/polygon}/websocket/websocket_client.py (100%) create mode 100644 tests/__init__.py create mode 100644 tests/integration/__init__.py rename tests/integration/{test_api.py => test_rest_api.py} (97%) diff --git a/polygon/__init__.py b/polygon/__init__.py deleted file mode 100644 index 4287cf1e..00000000 --- a/polygon/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from polygon.websocket import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER -from polygon.rest import RESTClient diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py deleted file mode 100644 index 8f068910..00000000 --- a/polygon/websocket/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from polygon.websocket.websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER diff --git a/requirements.txt b/requirements.txt index af296fa5..b71ddcd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,18 @@ -requests == 2.22.0 -certifi >= 14.05.14 -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.15.1 +atomicwrites==1.3.0 +attrs==19.3.0 +certifi==2019.9.11 +chardet==3.0.4 +idna==2.8 +importlib-metadata==0.23 +more-itertools==7.2.0 +packaging==19.2 +pluggy==0.13.0 +py==1.8.0 +pyparsing==2.4.4 +pytest==5.2.2 +requests==2.22.0 +six==1.13.0 +urllib3==1.25.6 +wcwidth==0.1.7 +websocket-client==0.56.0 +zipp==0.6.0 diff --git a/setup.py b/setup.py index 1bc25fff..11bb0e98 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + from setuptools import setup, find_packages setup( @@ -7,6 +9,8 @@ author_email="ricky@polygon.io", url="", keywords=["Polygon API"], - packages=find_packages(), + packages=find_packages("src"), + package_dir={"": "src"}, + py_modules=["polygon"], include_package_data=True ) diff --git a/src/polygon/__init__.py b/src/polygon/__init__.py new file mode 100644 index 00000000..9eb4d89a --- /dev/null +++ b/src/polygon/__init__.py @@ -0,0 +1,2 @@ +from .websocket import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER +from .rest import RESTClient diff --git a/polygon/rest/__init__.py b/src/polygon/rest/__init__.py similarity index 100% rename from polygon/rest/__init__.py rename to src/polygon/rest/__init__.py diff --git a/polygon/rest/client.py b/src/polygon/rest/client.py similarity index 100% rename from polygon/rest/client.py rename to src/polygon/rest/client.py diff --git a/polygon/rest/models/__init__.py b/src/polygon/rest/models/__init__.py similarity index 100% rename from polygon/rest/models/__init__.py rename to src/polygon/rest/models/__init__.py diff --git a/polygon/rest/models/definitions.py b/src/polygon/rest/models/definitions.py similarity index 100% rename from polygon/rest/models/definitions.py rename to src/polygon/rest/models/definitions.py diff --git a/polygon/rest/models/unmarshal.py b/src/polygon/rest/models/unmarshal.py similarity index 100% rename from polygon/rest/models/unmarshal.py rename to src/polygon/rest/models/unmarshal.py diff --git a/src/polygon/websocket/__init__.py b/src/polygon/websocket/__init__.py new file mode 100644 index 00000000..a0f9603a --- /dev/null +++ b/src/polygon/websocket/__init__.py @@ -0,0 +1 @@ +from .websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER diff --git a/polygon/websocket/websocket_client.py b/src/polygon/websocket/websocket_client.py similarity index 100% rename from polygon/websocket/websocket_client.py rename to src/polygon/websocket/websocket_client.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/integration/test_api.py b/tests/integration/test_rest_api.py similarity index 97% rename from tests/integration/test_api.py rename to tests/integration/test_rest_api.py index 2d7683ce..1f3edd18 100644 --- a/tests/integration/test_api.py +++ b/tests/integration/test_rest_api.py @@ -1,17 +1,16 @@ import os -import unittest + +import pytest from polygon.rest import RESTClient from polygon.rest import models -class TestAPI(unittest.TestCase): +class TestAPI: """ The tests checks is the response was correctly unmarshalled and that no error occurred """ - - def setUp(self): - api_key = os.getenv("API_KEY") - assert api_key - self.api_client = RESTClient(api_key) + api_key = os.getenv("API_KEY") + assert api_key + api_client = RESTClient(api_key) def test_reference_tickers(self): resp = self.api_client.reference_tickers(sort="ticker", perpage="50", page="1") @@ -157,10 +156,12 @@ def test_crypto_snapshot_all_tickers(self): resp = self.api_client.crypto_snapshot_all_tickers() assert isinstance(resp, models.CryptoSnapshotAllTickersApiResponse) + @pytest.mark.skip(reason="server 404's") def test_crypto_snapshot_single_ticker(self): resp = self.api_client.crypto_snapshot_single_ticker("~BTCUSD") assert isinstance(resp, models.CryptoSnapshotSingleTickerApiResponse) + @pytest.mark.skip(reason="server 409's") def test_crypto_snapshot_single_ticker_full_book(self): resp = self.api_client.crypto_snapshot_single_ticker_full_book("~BTCUSD") assert isinstance(resp, models.CryptoSnapshotSingleTickerFullBookApiResponse) diff --git a/tox.ini b/tox.ini index 927c2db4..8fa455ad 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,7 @@ [tox] envlist = py3 + [testenv] -deps = pytest -commands = pytest \ No newline at end of file +deps = -r requirements.txt +commands = pytest +passenv = API_KEY From 2e6eaa1ac23066762319b10db85286e8b66b0676 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Wed, 6 Nov 2019 16:27:05 -0500 Subject: [PATCH 15/16] drone calls tox --- .drone.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c892b338..8f6665d8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,8 +10,14 @@ platform: steps: - name: test image: python:3.7.5-alpine + environment: + API_KEY: + from_secret: TEST_API_KEY + MY_NEW_ENV: "hello world" commands: - - echo "testing" + - pip install -U tox + - env + - tox trigger: branch: From b213969f878ee353eb0b472b8233e7b5112cec9a Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Thu, 7 Nov 2019 11:14:50 -0500 Subject: [PATCH 16/16] Made it pip installable --- .drone.yml | 5 - LICENSE | 19 ++ README.md | 5 +- {src/polygon => polygon}/__init__.py | 0 {src/polygon => polygon}/rest/__init__.py | 0 {src/polygon => polygon}/rest/client.py | 0 .../rest/models/__init__.py | 0 .../rest/models/definitions.py | 0 .../rest/models/unmarshal.py | 0 .../polygon => polygon}/websocket/__init__.py | 0 .../websocket/websocket_client.py | 0 setup.py | 15 +- tests/__init__.py | 0 tests/integration/__init__.py | 0 tests/integration/test_rest_api.py | 171 ------------------ 15 files changed, 31 insertions(+), 184 deletions(-) create mode 100644 LICENSE rename {src/polygon => polygon}/__init__.py (100%) rename {src/polygon => polygon}/rest/__init__.py (100%) rename {src/polygon => polygon}/rest/client.py (100%) rename {src/polygon => polygon}/rest/models/__init__.py (100%) rename {src/polygon => polygon}/rest/models/definitions.py (100%) rename {src/polygon => polygon}/rest/models/unmarshal.py (100%) rename {src/polygon => polygon}/websocket/__init__.py (100%) rename {src/polygon => polygon}/websocket/websocket_client.py (100%) delete mode 100644 tests/__init__.py delete mode 100644 tests/integration/__init__.py delete mode 100644 tests/integration/test_rest_api.py diff --git a/.drone.yml b/.drone.yml index 8f6665d8..6965bfcf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,13 +10,8 @@ platform: steps: - name: test image: python:3.7.5-alpine - environment: - API_KEY: - from_secret: TEST_API_KEY - MY_NEW_ENV: "hello world" commands: - pip install -U tox - - env - tox trigger: diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..96f1555d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018 The Python Packaging Authority + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +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 86ac9cff..85daaa3c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ [![Build Status](https://drone.polygon.io/api/badges/Polygon-io/polygon-client-python/status.svg)](https://drone.polygon.io/Polygon-io/polygon-client-python) -# A Python client library for Polgyon's WebSocket and RESTful APIs +# A Python client library for Polygon's WebSocket and RESTful APIs ## Getting Started For a basic product overview, check out our [setup and use documentation](https://polygon.io/sockets) +### Install + +`pip install polygon-api-client` ## Simple WebSocket Demo ```python diff --git a/src/polygon/__init__.py b/polygon/__init__.py similarity index 100% rename from src/polygon/__init__.py rename to polygon/__init__.py diff --git a/src/polygon/rest/__init__.py b/polygon/rest/__init__.py similarity index 100% rename from src/polygon/rest/__init__.py rename to polygon/rest/__init__.py diff --git a/src/polygon/rest/client.py b/polygon/rest/client.py similarity index 100% rename from src/polygon/rest/client.py rename to polygon/rest/client.py diff --git a/src/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py similarity index 100% rename from src/polygon/rest/models/__init__.py rename to polygon/rest/models/__init__.py diff --git a/src/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py similarity index 100% rename from src/polygon/rest/models/definitions.py rename to polygon/rest/models/definitions.py diff --git a/src/polygon/rest/models/unmarshal.py b/polygon/rest/models/unmarshal.py similarity index 100% rename from src/polygon/rest/models/unmarshal.py rename to polygon/rest/models/unmarshal.py diff --git a/src/polygon/websocket/__init__.py b/polygon/websocket/__init__.py similarity index 100% rename from src/polygon/websocket/__init__.py rename to polygon/websocket/__init__.py diff --git a/src/polygon/websocket/websocket_client.py b/polygon/websocket/websocket_client.py similarity index 100% rename from src/polygon/websocket/websocket_client.py rename to polygon/websocket/websocket_client.py diff --git a/setup.py b/setup.py index 11bb0e98..5d48c248 100644 --- a/setup.py +++ b/setup.py @@ -3,14 +3,15 @@ from setuptools import setup, find_packages setup( - name="polygon", + name="polygon-api-client", version="0.0.1", description="Polygon API client", author_email="ricky@polygon.io", - url="", - keywords=["Polygon API"], - packages=find_packages("src"), - package_dir={"": "src"}, - py_modules=["polygon"], - include_package_data=True + url="https://github.com/Polygon-io/polygon-client-python", + packages=find_packages(), + classifiers=[ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + ], ) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/integration/test_rest_api.py b/tests/integration/test_rest_api.py deleted file mode 100644 index 1f3edd18..00000000 --- a/tests/integration/test_rest_api.py +++ /dev/null @@ -1,171 +0,0 @@ -import os - -import pytest - -from polygon.rest import RESTClient -from polygon.rest import models - - -class TestAPI: - """ The tests checks is the response was correctly unmarshalled and that no error occurred """ - api_key = os.getenv("API_KEY") - assert api_key - api_client = RESTClient(api_key) - - def test_reference_tickers(self): - resp = self.api_client.reference_tickers(sort="ticker", perpage="50", page="1") - assert isinstance(resp, models.ReferenceTickersApiResponse) - - def test_reference_ticker_types(self): - resp = self.api_client.reference_ticker_types() - assert isinstance(resp, models.ReferenceTickerTypesApiResponse) - - def test_reference_ticker_details(self): - resp = self.api_client.reference_ticker_details("AAPL") - assert isinstance(resp, models.ReferenceTickerDetailsApiResponse) - - def test_reference_ticker_news(self): - resp = self.api_client.reference_ticker_news("AAPL", perpage="50", page="1") - assert isinstance(resp, models.ReferenceTickerNewsApiResponse) - - def test_reference_markets(self): - resp = self.api_client.reference_markets() - assert isinstance(resp, models.ReferenceMarketsApiResponse) - - def test_reference_locales(self): - resp = self.api_client.reference_locales() - assert isinstance(resp, models.ReferenceLocalesApiResponse) - - def test_reference_stock_splits(self): - resp = self.api_client.reference_stock_splits("AAPL") - assert isinstance(resp, models.ReferenceStockSplitsApiResponse) - - def test_reference_stock_dividends(self): - resp = self.api_client.reference_stock_dividends("AAPL") - assert isinstance(resp, models.ReferenceStockDividendsApiResponse) - - def test_reference_stock_financials(self): - resp = self.api_client.reference_stock_financials("AAPL", limit="5") - assert isinstance(resp, models.ReferenceStockFinancialsApiResponse) - - def test_reference_market_status(self): - resp = self.api_client.reference_market_status() - assert isinstance(resp, models.ReferenceMarketStatusApiResponse) - - def test_reference_market_holidays(self): - resp = self.api_client.reference_market_holidays() - assert isinstance(resp, models.ReferenceMarketHolidaysApiResponse) - - def test_stocks_equities_exchanges(self): - resp = self.api_client.stocks_equities_exchanges() - assert isinstance(resp, models.StocksEquitiesExchangesApiResponse) - - def test_stocks_equities_historic_trades(self): - resp = self.api_client.stocks_equities_historic_trades("AAPL", "2018-2-2", limit="100") - assert isinstance(resp, models.StocksEquitiesHistoricTradesApiResponse) - - def test_historic_trades_v2(self): - resp = self.api_client.historic_trades_v2("AAPL", "2018-02-02", limit="100") - assert isinstance(resp, models.HistoricTradesV2ApiResponse) - - def test_stocks_equities_historic_quotes(self): - resp = self.api_client.stocks_equities_historic_quotes("AAPL", "2018-2-2", limit="100") - assert isinstance(resp, models.StocksEquitiesHistoricQuotesApiResponse) - - def test_historic_n___bbo_quotes_v2(self): - resp = self.api_client.historic_n___bbo_quotes_v2("AAPL", "2018-02-02", limit="100") - assert isinstance(resp, models.HistoricNBboQuotesV2ApiResponse) - - def test_stocks_equities_last_trade_for_a_symbol(self): - resp = self.api_client.stocks_equities_last_trade_for_a_symbol("AAPL") - assert isinstance(resp, models.StocksEquitiesLastTradeForASymbolApiResponse) - - def test_stocks_equities_last_quote_for_a_symbol(self): - resp = self.api_client.stocks_equities_last_quote_for_a_symbol("AAPL") - assert isinstance(resp, models.StocksEquitiesLastQuoteForASymbolApiResponse) - - def test_stocks_equities_daily_open_close(self): - resp = self.api_client.stocks_equities_daily_open_close("AAPL", "2018-3-2") - assert isinstance(resp, models.StocksEquitiesDailyOpenCloseApiResponse) - - def test_stocks_equities_condition_mappings(self): - resp = self.api_client.stocks_equities_condition_mappings("trades") - assert isinstance(resp, models.StocksEquitiesConditionMappingsApiResponse) - - def test_stocks_equities_snapshot_all_tickers(self): - resp = self.api_client.stocks_equities_snapshot_all_tickers() - assert isinstance(resp, models.StocksEquitiesSnapshotAllTickersApiResponse) - - def test_stocks_equities_snapshot_single_ticker(self): - resp = self.api_client.stocks_equities_snapshot_single_ticker("AAPL") - assert isinstance(resp, models.StocksEquitiesSnapshotSingleTickerApiResponse) - - def test_stocks_equities_snapshot_gainers_losers(self): - resp = self.api_client.stocks_equities_snapshot_gainers_losers("gainers") - assert isinstance(resp, models.StocksEquitiesSnapshotGainersLosersApiResponse) - - def test_stocks_equities_previous_close(self): - resp = self.api_client.stocks_equities_previous_close("AAPL") - assert isinstance(resp, models.StocksEquitiesPreviousCloseApiResponse) - - def test_stocks_equities_aggregates(self): - resp = self.api_client.stocks_equities_aggregates("AAPL", "1", "day", "2019-01-01", "2019-02-01") - assert isinstance(resp, models.StocksEquitiesAggregatesApiResponse) - - def test_stocks_equities_grouped_daily(self): - resp = self.api_client.stocks_equities_grouped_daily("US", "STOCKS", "2019-02-01") - assert isinstance(resp, models.StocksEquitiesGroupedDailyApiResponse) - - def test_forex_currencies_historic_forex_ticks(self): - resp = self.api_client.forex_currencies_historic_forex_ticks("AUD", "USD", "2018-2-2", limit="100") - assert isinstance(resp, models.ForexCurrenciesHistoricForexTicksApiResponse) - - def test_forex_currencies_real_time_currency_conversion(self): - resp = self.api_client.forex_currencies_real_time_currency_conversion("AUD", "USD", amount="100", precision="2") - assert isinstance(resp, models.ForexCurrenciesRealTimeCurrencyConversionApiResponse) - - def test_forex_currencies_last_quote_for_a_currency_pair(self): - resp = self.api_client.forex_currencies_last_quote_for_a_currency_pair("AUD", "USD") - assert isinstance(resp, models.ForexCurrenciesLastQuoteForACurrencyPairApiResponse) - - def test_forex_currencies_snapshot_all_tickers(self): - resp = self.api_client.forex_currencies_snapshot_all_tickers() - assert isinstance(resp, models.ForexCurrenciesSnapshotAllTickersApiResponse) - - def test_forex_currencies_snapshot_gainers_losers(self): - resp = self.api_client.forex_currencies_snapshot_gainers_losers("gainers") - assert isinstance(resp, models.ForexCurrenciesSnapshotGainersLosersApiResponse) - - def test_crypto_crypto_exchanges(self): - resp = self.api_client.crypto_crypto_exchanges() - assert isinstance(resp, models.CryptoCryptoExchangesApiResponse) - - def test_crypto_last_trade_for_a_crypto_pair(self): - resp = self.api_client.crypto_last_trade_for_a_crypto_pair("BTC", "USD") - assert isinstance(resp, models.CryptoLastTradeForACryptoPairApiResponse) - - def test_crypto_daily_open_close(self): - resp = self.api_client.crypto_daily_open_close("BTC", "USD", "2018-5-9") - assert isinstance(resp, models.CryptoDailyOpenCloseApiResponse) - - def test_crypto_historic_crypto_trades(self): - resp = self.api_client.crypto_historic_crypto_trades("BTC", "USD", "2018-5-9", limit="100") - assert isinstance(resp, models.CryptoHistoricCryptoTradesApiResponse) - - def test_crypto_snapshot_all_tickers(self): - resp = self.api_client.crypto_snapshot_all_tickers() - assert isinstance(resp, models.CryptoSnapshotAllTickersApiResponse) - - @pytest.mark.skip(reason="server 404's") - def test_crypto_snapshot_single_ticker(self): - resp = self.api_client.crypto_snapshot_single_ticker("~BTCUSD") - assert isinstance(resp, models.CryptoSnapshotSingleTickerApiResponse) - - @pytest.mark.skip(reason="server 409's") - def test_crypto_snapshot_single_ticker_full_book(self): - resp = self.api_client.crypto_snapshot_single_ticker_full_book("~BTCUSD") - assert isinstance(resp, models.CryptoSnapshotSingleTickerFullBookApiResponse) - - def test_crypto_snapshot_gainers_losers(self): - resp = self.api_client.crypto_snapshot_gainers_losers("gainers") - assert isinstance(resp, models.CryptoSnapshotGainersLosersApiResponse)