diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/available_indices.py b/openbb_sdk/providers/fmp/openbb_fmp/models/available_indices.py index 7f3c5101943..f971260362e 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/available_indices.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/available_indices.py @@ -3,34 +3,31 @@ from typing import Dict, List, Optional -from openbb_provider.abstract.data import Data, QueryParams from openbb_provider.abstract.fetcher import Fetcher from openbb_provider.helpers import data_transformer from openbb_provider.models.available_indices import ( AvailableIndicesData, AvailableIndicesQueryParams, ) -from pydantic import Field from openbb_fmp.utils.helpers import get_data_many -class FMPAvailableIndicesQueryParams(QueryParams): - """FMP Available Indices query. +class FMPAvailableIndicesQueryParams(AvailableIndicesQueryParams): + """FMP Available Indices Query. Source: https://site.financialmodelingprep.com/developer/docs/#Historical-stock-index-prices - """ -class FMPAvailableIndicesData(Data): - """FMP Available Indices data.""" +class FMPAvailableIndicesData(AvailableIndicesData): + """FMP Available Indices Data.""" - symbol: str - name: Optional[str] - currency: Optional[str] - stockExchange: str = Field(alias="stock_exchange") - exchangeShortName: str = Field(alias="exchange_short_name") + class Config: + fields = { + "stock_exchange": "stockExchange", + "exchange_short_name": "exchangeShortName", + } class FMPAvailableIndicesFetcher( diff --git a/openbb_sdk/sdk/provider/openbb_provider/models/available_indices.py b/openbb_sdk/sdk/provider/openbb_provider/models/available_indices.py index 3fa735288f5..09e2ae50253 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/models/available_indices.py +++ b/openbb_sdk/sdk/provider/openbb_provider/models/available_indices.py @@ -4,33 +4,26 @@ from typing import Optional from openbb_provider.abstract.data import Data, QueryParams +from openbb_provider.models.base import BaseSymbol + +from pydantic import Field class AvailableIndicesQueryParams(QueryParams): - """Available Indices query.""" + """Available Indices Query.""" -class AvailableIndicesData(Data): - """Available Indices data. +class AvailableIndicesData(Data, BaseSymbol): + """Available Indices Data. Returns the major indices from Dow Jones, Nasdaq and, S&P 500. - - Returns - ------- - symbol : str - The symbol of the index. - name : Optional[str] - The name of the index. - currency : Optional[str] - The currency the index is traded in. - stock_exchange : str - The stock exchange where the index is listed. - exchange_short_name : str - The short name of the stock exchange where the index is listed. """ - symbol: str - name: Optional[str] - currency: Optional[str] - stock_exchange: str - exchange_short_name: str + name: Optional[str] = Field(description="The name of the index.") + currency: Optional[str] = Field(description="The currency the index is traded in.") + stock_exchange: str = Field( + description="The stock exchange where the index is listed." + ) + exchange_short_name: str = Field( + description="The short name of the stock exchange where the index is listed." + )