From b603e64fddb8d6b9bca9e45277d049e4ed079978 Mon Sep 17 00:00:00 2001 From: MarketDataApp Date: Fri, 16 Feb 2024 13:45:28 -0300 Subject: [PATCH] doc updates --- indices_candles.go | 10 +++++----- indices_quotes.go | 16 ++++++++-------- markets_status.go | 16 ++++++++-------- options_chain.go | 19 +++++++++---------- options_expirations.go | 6 +++--- options_lookup.go | 6 +++--- options_quotes.go | 6 +++--- options_strikes.go | 6 +++--- stocks_bulkcandles.go | 16 ++++++++-------- stocks_bulkquotes.go | 16 ++++++++-------- stocks_candles.go | 20 ++++++++++---------- stocks_earnings.go | 20 ++++++++++---------- stocks_news.go | 16 ++++++++-------- stocks_quotes.go | 6 +++--- 14 files changed, 89 insertions(+), 90 deletions(-) diff --git a/indices_candles.go b/indices_candles.go index 9354bff..d69119e 100644 --- a/indices_candles.go +++ b/indices_candles.go @@ -4,11 +4,11 @@ // // Use [IndicesCandlesRequest] to make requests to the endpoint using any of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]Candle` | Directly returns a slice of `[]Candle`, making it straightforward to access each candle individually. | -// | **Packed** | Intermediate | `IndicesCandlesResponse` | Returns a packed `IndicesCandlesResponse` object. Must be unpacked to access the `[]Candle` slice. | -// | **Raw** | Low-level | `resty.Response` | Provides the raw `resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]Candle` | Directly returns a slice of `[]Candle`, making it straightforward to access each candle individually. | +// | **Packed** | Intermediate | `*IndicesCandlesResponse` | Returns a packed `*IndicesCandlesResponse` object. Must be unpacked to access the `[]Candle` slice. | +// | **Raw** | Low-level | `*resty.Response` | Provides the raw `*resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( diff --git a/indices_quotes.go b/indices_quotes.go index 49ae28f..888c794 100644 --- a/indices_quotes.go +++ b/indices_quotes.go @@ -4,11 +4,11 @@ // // Utilize [IndexQuoteRequest] to make requests to the endpoint through one of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]IndexQuote` | Directly returns a slice of `[]IndexQuote`, facilitating individual access to each quote. | -// | **Packed** | Intermediate | `IndexQuotesResponse` | Returns a packed `IndexQuotesResponse` object. Must be unpacked to access the `[]IndexQuote` slice. | -// | **Raw** | Low-level | `resty.Response` | Offers the raw `resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]IndexQuote` | Directly returns a slice of `[]IndexQuote`, facilitating individual access to each quote. | +// | **Packed** | Intermediate | `*IndexQuotesResponse` | Returns a packed `*IndexQuotesResponse` object. Must be unpacked to access the `[]IndexQuote` slice. | +// | **Raw** | Low-level | `*resty.Response` | Offers the raw `*resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -39,9 +39,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndexQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]IndexQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]IndexQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*IndexQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/indices/quotes/]: https://www.marketdata.app/docs/api/indices/quotes type IndexQuoteRequest struct { diff --git a/markets_status.go b/markets_status.go index 706c8d8..4162edc 100644 --- a/markets_status.go +++ b/markets_status.go @@ -4,11 +4,11 @@ // // Utilize [MarketStatusRequest] to make requests to the endpoint through one of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]MarketStatusReport` | Directly returns a slice of `[]MarketStatus`, facilitating individual access to each market status entry. | -// | **Packed** | Intermediate | `MarketStatusResponse` | Returns a packed `MarketStatusResponse` object. Must be unpacked to access the `[]MarketStatus` slice. | -// | **Raw** | Low-level | `resty.Response` | Offers the raw `resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]MarketStatusReport` | Directly returns a slice of `[]MarketStatusReport`, facilitating individual access to each market status entry. | +// | **Packed** | Intermediate | `*MarketStatusResponse` | Returns a packed `*MarketStatusResponse` object. Must be unpacked to access the `[]MarketStatusReport` slice. | +// | **Raw** | Low-level | `*resty.Response` | Offers the raw `*resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -39,9 +39,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]MarketStatusReport, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*MarketStatusResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/markets/status/]: https://www.marketdata.app/docs/api/markets/status type MarketStatusRequest struct { diff --git a/options_chain.go b/options_chain.go index ae58c34..9a6747a 100644 --- a/options_chain.go +++ b/options_chain.go @@ -5,12 +5,11 @@ // // Utilize [OptionChainRequest] for querying the endpoint through one of the three available methods: // -// | Method | Execution Level | Return Type | Description | -// |------------|-----------------|------------------------------|----------------------------------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]OptionQuote` | Immediately fetches a slice of `[]models.OptionQuote`, allowing direct access to the options chain data. | -// | **Packed** | Intermediate | `*OptionQuotesResponse` | Delivers a `*models.OptionQuotesResponse` object containing the data, which requires unpacking to access the `OptionQuote` data. | -// | **Raw** | Low-level | `*resty.Response` | Offers the unprocessed `*resty.Response` for those seeking full control and access to the raw JSON or `*http.Response`. | -// +// | Method | Execution Level | Return Type | Description | +// |------------|-----------------|------------------------------|----------------------------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]OptionQuote` | Immediately fetches a slice of `[]models.OptionQuote`, allowing direct access to the options chain data. | +// | **Packed** | Intermediate | `*OptionQuotesResponse` | Delivers a `*models.OptionQuotesResponse` object containing the data, which requires unpacking to access the `OptionQuote` data. | +// | **Raw** | Low-level | `*resty.Response` | Offers the unprocessed `*resty.Response` for those seeking full control and access to the raw JSON or `*http.Response`. | package client import ( @@ -58,11 +57,11 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Get() ([]OptionQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. -// - Packed() (*OptionQuotesResponse, error): Packs the request parameters and sends the request, returning a *OptionQuotesResponse response. -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. +// - Get(...*MarketDataClient) ([]OptionQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*OptionQuotesResponse, error): Packs the request parameters and sends the request, returning a *OptionQuotesResponse response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // -//[/v1/options/chain/]: https://www.marketdata.app/docs/api/options/chain +// [/v1/options/chain/]: https://www.marketdata.app/docs/api/options/chain type OptionChainRequest struct { *baseRequest symbolParams *parameters.SymbolParams diff --git a/options_expirations.go b/options_expirations.go index 035b1df..bd6d0cd 100644 --- a/options_expirations.go +++ b/options_expirations.go @@ -38,9 +38,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Get() ([]time.Time, error): Sends the request, unpacks the response, and returns []time.Time allowing direct-access to the data. -// - Packed() (*OptionsExpirationsResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. +// - Get(...*MarketDataClient) ([]time.Time, error): Sends the request, unpacks the response, and returns []time.Time allowing direct-access to the data. +// - Packed(...*MarketDataClient) (*OptionsExpirationsResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/options/expirations/]: https://www.marketdata.app/docs/api/options/expirations type OptionsExpirationsRequest struct { diff --git a/options_lookup.go b/options_lookup.go index 2a6e485..96f0b95 100644 --- a/options_lookup.go +++ b/options_lookup.go @@ -35,9 +35,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Get() (string, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. -// - Packed() (*OptionLookupResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. +// - Get(...*MarketDataClient) (string, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*OptionLookupResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/options/lookup/]: https://www.marketdata.app/docs/api/options/lookup type OptionLookupRequest struct { diff --git a/options_quotes.go b/options_quotes.go index 86f3617..2341b01 100644 --- a/options_quotes.go +++ b/options_quotes.go @@ -38,9 +38,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Get() ([]OptionQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. -// - Packed() (*OptionQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. +// - Get(...*MarketDataClient) ([]OptionQuote, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*OptionQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/options/quotes/]: https://www.marketdata.app/docs/api/options/quotes type OptionQuoteRequest struct { diff --git a/options_strikes.go b/options_strikes.go index 7de52dc..d681ab5 100644 --- a/options_strikes.go +++ b/options_strikes.go @@ -34,9 +34,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Get() ([]OptionStrikes, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. -// - Packed() (*OptionStrikesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. +// - Get(...*MarketDataClient) ([]OptionStrikes, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*OptionStrikesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/options/strikes/]: https://www.marketdata.app/docs/api/options/strikes type OptionStrikesRequest struct { diff --git a/stocks_bulkcandles.go b/stocks_bulkcandles.go index c5cbf21..cb4c3b6 100644 --- a/stocks_bulkcandles.go +++ b/stocks_bulkcandles.go @@ -5,11 +5,11 @@ // // Utilize the [BulkStockCandlesRequest] for querying the endpoint through one of the three available methods: // -// | Method | Execution Level | Return Type | Description | -// |------------|-----------------|----------------------------|------------------------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]Candle` | Immediately fetches and returns a slice of `[]Candle`, allowing direct access to each candle's data. | -// | **Packed** | Intermediate | `BulkStockCandlesResponse` | Delivers a `StockCandlesResponse` object containing the data, which requires unpacking to access the `[]Candle` slice. | -// | **Raw** | Low-level | `resty.Response` | Offers the unprocessed `resty.Response` for those seeking full control and access to the raw JSON or `*http.Response`. | +// | Method | Execution Level | Return Type | Description | +// |------------|-----------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]Candle` | Immediately fetches and returns a slice of `[]Candle`, allowing direct access to each candle's data. | +// | **Packed** | Intermediate | `*BulkStockCandlesResponse` | Delivers a `*StockCandlesResponse` object containing the data, which requires unpacking to access the `[]Candle` slice. | +// | **Raw** | Low-level | `*resty.Response` | Offers the unprocessed `*resty.Response` for those seeking full control and access to the raw JSON or `*http.Response`. | package client import ( @@ -42,9 +42,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*BulkStockCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*BulkStockCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/stocks/bulkcandles/]: https://www.marketdata.app/docs/api/stocks/bulkcandles type BulkStockCandlesRequest struct { diff --git a/stocks_bulkquotes.go b/stocks_bulkquotes.go index dc1f6b6..d8bc4fb 100644 --- a/stocks_bulkquotes.go +++ b/stocks_bulkquotes.go @@ -5,11 +5,11 @@ // // Utilize [BulkStockQuotesRequest] to make requests to the endpoint through one of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]StockQuote` | Directly returns a slice of `[]StockQuote`, facilitating individual access to each stock quote. | -// | **Packed** | Intermediate | `StockQuotesResponse` | Returns a packed `StockQuotesResponse` object. Must be unpacked to access the `[]StockQuote` slice. | -// | **Raw** | Low-level | `resty.Response` | Offers the raw `resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]StockQuote` | Directly returns a slice of `[]StockQuote`, facilitating individual access to each stock quote. | +// | **Packed** | Intermediate | `*StockQuotesResponse` | Returns a packed `*StockQuotesResponse` object. Must be unpacked to access the `[]StockQuote` slice. | +// | **Raw** | Low-level | `*resty.Response` | Offers the raw `*resty.Response` for utmost flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -37,9 +37,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*StockQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*StockQuotesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [v1/stocks/bulkquotes/]: https://www.marketdata.app/docs/api/stocks/bulkquotes type BulkStockQuotesRequest struct { diff --git a/stocks_candles.go b/stocks_candles.go index f98e6cb..197557c 100644 --- a/stocks_candles.go +++ b/stocks_candles.go @@ -4,11 +4,11 @@ // // Use [StockCandlesRequest] to make requests to the endpoint using any of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]Candle` | Directly returns a slice of `[]Candle`, facilitating individual access to each candle. | -// | **Packed** | Intermediate | `StockCandlesResponse` | Returns a packed `StockCandlesResponse` object. Must be unpacked to access the `[]Candle` slice. | -// | **Raw** | Low-level | `resty.Response` | Provides the raw `resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]Candle` | Directly returns a slice of `[]Candle`, facilitating individual access to each candle. | +// | **Packed** | Intermediate | `*StockCandlesResponse` | Returns a packed `*StockCandlesResponse` object. Must be unpacked to access the `[]Candle` slice. | +// | **Raw** | Low-level | `*resty.Response` | Provides the raw `*resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -18,7 +18,7 @@ import ( "github.com/MarketDataApp/sdk-go/models" ) -// StockCandlesRequest represents a request to the [/v1/stocks/candles] endpoint. +// StockCandlesRequest represents a request to the [/v1/stocks/candles/] endpoint. // It encapsulates parameters for resolution, symbol, date, and additional stock-specific parameters to be used in the request. // This struct provides methods such as Resolution(), Symbol(), Date(), From(), To(), Countback(), AdjustSplits(), AdjustDividends(), Extended(), and Exchange() to set these parameters respectively. // @@ -44,11 +44,11 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*StockCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // -// [/v1/stocks/candles]: https://www.marketdata.app/docs/api/stocks/candles +// [/v1/stocks/candles/]: https://www.marketdata.app/docs/api/stocks/candles type StockCandlesRequest struct { *baseRequest stockCandleParams *parameters.StockCandleParams diff --git a/stocks_earnings.go b/stocks_earnings.go index da6d83b..8d28738 100644 --- a/stocks_earnings.go +++ b/stocks_earnings.go @@ -5,11 +5,11 @@ // // Use [StockEarningsRequest] to make requests to the endpoint using any of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|----------------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]StockEarningsReport` | Directly returns a slice of `[]StockEarningsReport`, facilitating individual access to each earnings report. | -// | **Packed** | Intermediate | `StockEarningsResponse` | Returns a packed `StockEarningsResponse` object. Must be unpacked to access the `[]StockEarningsReport` slice. | -// | **Raw** | Low-level | `resty.Response` | Provides the raw `resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]StockEarningsReport` | Directly returns a slice of `[]StockEarningsReport`, facilitating individual access to each earnings report. | +// | **Packed** | Intermediate | `*StockEarningsResponse` | Returns a packed `*StockEarningsResponse` object. Must be unpacked to access the `[]StockEarningsReport` slice. | +// | **Raw** | Low-level | `*resty.Response` | Provides the raw `*resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -19,7 +19,7 @@ import ( "github.com/MarketDataApp/sdk-go/models" ) -// StockEarningsRequest represents a request to the [v1/stocks/earnings/] endpoint. +// StockEarningsRequest represents a request to the [/v1/stocks/earnings/] endpoint. // It encapsulates parameters for symbol, report type, and date to be used in the request. // This struct provides methods such as Report(), Symbol(), Date(), From(), To(), and Countback() to set these parameters respectively. // @@ -41,11 +41,11 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]StockEarningsReport, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]StockEarningsReport, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*StockEarningsResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // -// [v1/stocks/earnings/]: https://www.marketdata.app/docs/api/stocks/earnings +// [/v1/stocks/earnings/]: https://www.marketdata.app/docs/api/stocks/earnings type StockEarningsRequest struct { *baseRequest symbolParams *parameters.SymbolParams diff --git a/stocks_news.go b/stocks_news.go index ad0f130..f614aa2 100644 --- a/stocks_news.go +++ b/stocks_news.go @@ -5,11 +5,11 @@ // // Use [StockNewsRequest] to make requests to the endpoint using any of the three supported execution methods: // -// | Method | Execution | Return Type | Description | -// |------------|---------------|----------------------------|-----------------------------------------------------------------------------------------------------------| -// | **Get** | Direct | `[]StockNews ` | Directly returns a slice of `[]StockNews`, facilitating individual access to each news article. | -// | **Packed** | Intermediate | `StockNewsResponse` | Returns a packed `StockNewsResponse` object. Must be unpacked to access the `[]StockNews` slice. | -// | **Raw** | Low-level | `resty.Response` | Provides the raw `resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | +// | Method | Execution | Return Type | Description | +// |------------|---------------|-----------------------------|------------------------------------------------------------------------------------------------------------| +// | **Get** | Direct | `[]StockNews ` | Directly returns a slice of `[]StockNews`, facilitating individual access to each news article. | +// | **Packed** | Intermediate | `*StockNewsResponse` | Returns a packed `*StockNewsResponse` object. Must be unpacked to access the `[]StockNews` slice. | +// | **Raw** | Low-level | `*resty.Response` | Provides the raw `*resty.Response` for maximum flexibility. Direct access to raw JSON or `*http.Response`. | package client import ( @@ -36,9 +36,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]StockNews, error): Initiates the request, processes the response, and provides an slice of `StockNews` objects for straightforward access to news articles. +// - Packed(...*MarketDataClient) (*StockNewsResponse, error): Delivers a packed `StockNewsResponse` object containing slices of data that directly correspond to the JSON structure returned by the Market Data API. +// - Raw(...*MarketDataClient) (*resty.Response, error): Executes the request in its raw form and retrieves the raw HTTP response for maximum flexibility. // // [/v1/stocks/news/]: https://www.marketdata.app/docs/api/stocks/news type StockNewsRequest struct { diff --git a/stocks_quotes.go b/stocks_quotes.go index 847b309..0b8c4bf 100644 --- a/stocks_quotes.go +++ b/stocks_quotes.go @@ -33,9 +33,9 @@ import ( // These methods are used to send the request in different formats or retrieve the data. // They handle the actual communication with the API endpoint. // -// - Raw() (*resty.Response, error): Sends the request as is and returns the raw HTTP response. -// - Packed() (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. -// - Get() ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Get(...*MarketDataClient) ([]Candle, error): Sends the request, unpacks the response, and returns the data in a user-friendly format. +// - Packed(...*MarketDataClient) (*IndicesCandlesResponse, error): Returns a struct that contains equal-length slices of primitives. This packed response mirrors Market Data's JSON response. +// - Raw(...*MarketDataClient) (*resty.Response, error): Sends the request as is and returns the raw HTTP response. // // [/v1/stocks/quotes/]: https://www.marketdata.app/docs/api/stocks/quotes type StockQuoteRequest struct {