twelve_data_client/apis/
analysis_api.rs

1/*
2 * Twelve Data API
3 *
4 * ## Overview  Welcome to Twelve Data developer docs — your gateway to comprehensive financial market data through a powerful and easy-to-use API. Twelve Data provides access to financial markets across over 50 global countries, covering more than 1 million public instruments, including stocks, forex, ETFs, mutual funds, commodities, and cryptocurrencies.  ## Quickstart  To get started, you'll need to sign up for an API key. Once you have your API key, you can start making requests to the API.  ### Step 1: Create Twelve Data account  Sign up on the Twelve Data website to create your account [here](https://twelvedata.com/register). This gives you access to the API dashboard and your API key.  ### Step 2: Get your API key  After signing in, navigate to your [dashboard](https://twelvedata.com/account/api-keys) to find your unique API key. This key is required to authenticate all API and WebSocket requests.  ### Step 3: Make your first request  Try a simple API call with cURL to fetch the latest price for Apple (AAPL):  ``` curl \"https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key\" ```  ### Step 4: Make a request from Python or Javascript  Use our client libraries or standard HTTP clients to make API calls programmatically. Here’s an example in [Python](https://github.com/twelvedata/twelvedata-python) and JavaScript:  #### Python (using official Twelve Data SDK):  ```python from twelvedata import TDClient  # Initialize client with your API key td = TDClient(apikey=\"your_api_key\")  # Get latest price for Apple price = td.price(symbol=\"AAPL\").as_json()  print(price) ```  #### JavaScript (Node.js):  ```javascript const fetch = require('node-fetch');  fetch('https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key') &nbsp;&nbsp;.then(response => response.json()) &nbsp;&nbsp;.then(data => console.log(data)); ```  ### Step 5: Perform correlation analysis between Tesla and Microsoft prices  Fetch historical price data for Tesla (TSLA) and Microsoft (MSFT) and calculate the correlation of their closing prices:  ```python from twelvedata import TDClient import pandas as pd  # Initialize client with your API key td = TDClient(apikey=\"your_api_key\")  # Fetch historical price data for Tesla tsla_ts = td.time_series( &nbsp;&nbsp;&nbsp;&nbsp;symbol=\"TSLA\", &nbsp;&nbsp;&nbsp;&nbsp;interval=\"1day\", &nbsp;&nbsp;&nbsp;&nbsp;outputsize=100 ).as_pandas()  # Fetch historical price data for Microsoft msft_ts = td.time_series( &nbsp;&nbsp;&nbsp;&nbsp;symbol=\"MSFT\", &nbsp;&nbsp;&nbsp;&nbsp;interval=\"1day\", &nbsp;&nbsp;&nbsp;&nbsp;outputsize=100 ).as_pandas()  # Align data on datetime index combined = pd.concat( &nbsp;&nbsp;&nbsp;&nbsp;[tsla_ts['close'].astype(float), msft_ts['close'].astype(float)], &nbsp;&nbsp;&nbsp;&nbsp;axis=1, &nbsp;&nbsp;&nbsp;&nbsp;keys=[\"TSLA\", \"MSFT\"] ).dropna()  # Calculate correlation correlation = combined[\"TSLA\"].corr(combined[\"MSFT\"]) print(f\"Correlation of closing prices between TSLA and MSFT: {correlation:.2f}\") ```  ### Authentication  Authenticate your requests using one of these methods:  #### Query parameter method ``` GET https://api.twelvedata.com/endpoint?symbol=AAPL&apikey=your_api_key ```  #### HTTP header method (recommended) ``` Authorization: apikey your_api_key ```  ##### API key useful information <ul> <li> Demo API key (<code>apikey=demo</code>) available for demo requests</li> <li> Personal API key required for full access</li> <li> Premium endpoints and data require higher-tier plans (testable with <a href=\"https://twelvedata.com/exchanges\">trial symbols</a>)</li> </ul>  ### API endpoints   Service | Base URL | ---------|----------|  REST API | `https://api.twelvedata.com` |  WebSocket | `wss://ws.twelvedata.com` |  ### Parameter guidelines <ul> <li><b>Separator:</b> Use <code>&</code> to separate multiple parameters</li> <li><b>Case sensitivity:</b> Parameter names are case-insensitive</li>  <ul><li><code>symbol=AAPL</code> = <code>symbol=aapl</code></li></ul>  <li><b>Multiple values:</b> Separate with commas where supported</li> </ul>  ### Response handling  #### Default format All responses return JSON format by default unless otherwise specified.  #### Null values <b>Important:</b> Some response fields may contain `null` values when data is unavailable for specific metrics. This is expected behavior, not an error.  ##### Best Practices: <ul> <li>Always implement <code>null</code> value handling in your application</li> <li>Use defensive programming techniques for data processing</li> <li>Consider fallback values or error handling for critical metrics</li> </ul>  #### Error handling Structure your code to gracefully handle: <ul> <li>Network timeouts</li> <li>Rate limiting responses</li> <li>Invalid parameter errors</li> <li>Data unavailability periods</li> </ul>  ##### Best practices <ul> <li><b>Rate limits:</b> Adhere to your plan’s rate limits to avoid throttling. Check your dashboard for details.</li> <li><b>Error handling:</b> Implement retry logic for transient errors (e.g., <code>429 Too Many Requests</code>).</li> <li><b>Caching:</b> Cache responses for frequently accessed data to reduce API calls and improve performance.</li> <li><b>Secure storage:</b> Store your API key securely and never expose it in client-side code or public repositories.</li> </ul>  ## Errors  Twelve Data API employs a standardized error response format, delivering a JSON object with `code`, `message`, and `status` keys for clear and consistent error communication.  ### Codes  Below is a table of possible error codes, their HTTP status, meanings, and resolution steps:   Code | status | Meaning | Resolution |  --- | --- | --- | --- |  **400** | Bad Request | Invalid or incorrect parameter(s) provided. | Check the `message` in the response for details. Refer to the API Documenta­tion to correct the input. |  **401** | Unauthor­ized | Invalid or incorrect API key. | Verify your API key is correct. Sign up for a key <a href=\"https://twelvedata.com/account/api-keys\">here</a>. |  **403** | Forbidden | API key lacks permissions for the requested resource (upgrade required). | Upgrade your plan <a href=\"https://twelvedata.com/pricing\">here</a>. |  **404** | Not Found | Requested data could not be found. | Adjust parameters to be less strict as they may be too restrictive. |  **414** | Parameter Too Long | Input parameter array exceeds the allowed length. | Follow the `message` guidance to adjust the parameter length. |  **429** | Too Many Requests | API request limit reached for your key. | Wait briefly or upgrade your plan <a href=\"https://twelvedata.com/pricing\">here</a>. |  **500** | Internal Server Error | Server-side issue occurred; retry later. | Contact support <a href=\"https://twelvedata.com/contact\">here</a> for assistance. |  ### Example error response  Consider the following invalid request:  ``` https://api.twelvedata.com/time_series?symbol=AAPL&interval=0.99min&apikey=your_api_key ```  Due to the incorrect `interval` value, the API returns:  ```json { &nbsp;&nbsp;\"code\": 400, &nbsp;&nbsp;\"message\": \"Invalid **interval** provided: 0.99min. Supported intervals: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 8h, 1day, 1week, 1month\", &nbsp;&nbsp;\"status\": \"error\" } ```  Refer to the API Documentation for valid parameter values to resolve such errors.  ## Libraries  Twelve Data provides a growing ecosystem of libraries and integrations to help you build faster and smarter in your preferred environment. Official libraries are actively maintained by the Twelve Data team, while selected community-built libraries offer additional flexibility.  A full list is available on our [GitHub profile](https://github.com/search?q=twelvedata).  ### Official SDKs <ul> <li><b>Python:</b> <a href=\"https://github.com/twelvedata/twelvedata-python\">twelvedata-python</a></li> <li><b>R:</b> <a href=\"https://github.com/twelvedata/twelvedata-r-sdk\">twelvedata-r-sdk</a></li> </ul>  ### AI integrations <ul> <li><b>Twelve Data MCP Server:</b> <a href=\"https://github.com/twelvedata/mcp\">Repository</a> — Model Context Protocol (MCP) server that provides seamless integration with AI assistants and language models, enabling direct access to Twelve Data's financial market data within conversational interfaces and AI workflows.</li> </ul>  ### Spreadsheet add-ons <ul> <li><b>Excel:</b> <a href=\"https://twelvedata.com/excel\">Excel Add-in</a></li> <li><b>Google Sheets:</b> <a href=\"https://twelvedata.com/google-sheets\">Google Sheets Add-on</a></li> </ul>  ### Community libraries  The community has developed libraries in several popular languages. You can explore more community libraries on [GitHub](https://github.com/search?q=twelvedata). <ul> <li><b>C#:</b> <a href=\"https://github.com/pseudomarkets/TwelveDataSharp\">TwelveDataSharp</a></li> <li><b>JavaScript:</b> <a href=\"https://github.com/evzaboun/twelvedata\">twelvedata</a></li> <li><b>PHP:</b> <a href=\"https://github.com/ingelby/twelvedata\">twelvedata</a></li> <li><b>Go:</b> <a href=\"https://github.com/soulgarden/twelvedata\">twelvedata</a></li> <li><b>TypeScript:</b> <a href=\"https://github.com/Clyde-Goodall/twelve-data-wrapper\">twelve-data-wrapper</a></li> </ul>  ### Other Twelve Data repositories <ul> <li><b>searchindex</b> <i>(Go)</i>: <a href=\"https://github.com/twelvedata/searchindex\">Repository</a> — In-memory search index by strings</li> <li><b>ws-tools</b> <i>(Python)</i>: <a href=\"https://github.com/twelvedata/ws-tools\">Repository</a> — Utility tools for WebSocket stream handling</li> </ul>  ### API specification <ul> <li><b>OpenAPI / Swagger:</b> Access the <a href=\"https://api.twelvedata.com/doc/swagger/openapi.json\">complete API specification</a> in OpenAPI format. You can use this file to automatically generate client libraries in your preferred programming language, explore the API interactively via Swagger tools, or integrate Twelve Data seamlessly into your AI and LLM workflows.</li> </ul>
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17/// struct for passing parameters to the method [`get_analyst_ratings_light`]
18#[derive(Clone, Debug, Default, Serialize, Deserialize)]
19pub struct GetAnalystRatingsLightParams {
20    /// Filter by symbol
21    pub symbol: Option<String>,
22    /// Filter by financial instrument global identifier (FIGI)
23    pub figi: Option<String>,
24    /// Filter by international securities identification number (ISIN)
25    pub isin: Option<String>,
26    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
27    pub cusip: Option<String>,
28    /// Filter by exchange name
29    pub exchange: Option<String>,
30    /// Filter by rating change action
31    pub rating_change: Option<String>,
32    /// Number of records in response
33    pub outputsize: Option<i64>,
34    /// Filter by country name or alpha code, e.g., `United States` or `US`
35    pub country: Option<String>
36}
37
38impl GetAnalystRatingsLightParams {
39    /// Create a new builder for this parameter struct
40    pub fn builder() -> GetAnalystRatingsLightParamsBuilder {
41        GetAnalystRatingsLightParamsBuilder::default()
42    }
43}
44
45/// Builder for [`GetAnalystRatingsLightParams`]
46#[derive(Clone, Debug, Default)]
47pub struct GetAnalystRatingsLightParamsBuilder {
48    /// Filter by symbol
49    symbol: Option<String>,
50    /// Filter by financial instrument global identifier (FIGI)
51    figi: Option<String>,
52    /// Filter by international securities identification number (ISIN)
53    isin: Option<String>,
54    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
55    cusip: Option<String>,
56    /// Filter by exchange name
57    exchange: Option<String>,
58    /// Filter by rating change action
59    rating_change: Option<String>,
60    /// Number of records in response
61    outputsize: Option<i64>,
62    /// Filter by country name or alpha code, e.g., `United States` or `US`
63    country: Option<String>
64}
65
66impl GetAnalystRatingsLightParamsBuilder {
67    /// Filter by symbol
68    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
69        self.symbol = Some(symbol.into());
70        self
71    }
72    /// Filter by financial instrument global identifier (FIGI)
73    pub fn figi(mut self, figi: impl Into<String>) -> Self {
74        self.figi = Some(figi.into());
75        self
76    }
77    /// Filter by international securities identification number (ISIN)
78    pub fn isin(mut self, isin: impl Into<String>) -> Self {
79        self.isin = Some(isin.into());
80        self
81    }
82    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
83    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
84        self.cusip = Some(cusip.into());
85        self
86    }
87    /// Filter by exchange name
88    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
89        self.exchange = Some(exchange.into());
90        self
91    }
92    /// Filter by rating change action
93    pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
94        self.rating_change = Some(rating_change.into());
95        self
96    }
97    /// Number of records in response
98    pub fn outputsize(mut self, outputsize: i64) -> Self {
99        self.outputsize = Some(outputsize);
100        self
101    }
102    /// Filter by country name or alpha code, e.g., `United States` or `US`
103    pub fn country(mut self, country: impl Into<String>) -> Self {
104        self.country = Some(country.into());
105        self
106    }
107
108    /// Build the parameter struct
109    pub fn build(self) -> GetAnalystRatingsLightParams {
110        GetAnalystRatingsLightParams {
111            symbol: self.symbol,
112            figi: self.figi,
113            isin: self.isin,
114            cusip: self.cusip,
115            exchange: self.exchange,
116            rating_change: self.rating_change,
117            outputsize: self.outputsize,
118            country: self.country
119        }
120    }
121}
122
123/// struct for passing parameters to the method [`get_analyst_ratings_us_equities`]
124#[derive(Clone, Debug, Default, Serialize, Deserialize)]
125pub struct GetAnalystRatingsUsEquitiesParams {
126    /// Filter by symbol
127    pub symbol: Option<String>,
128    /// Filter by financial instrument global identifier (FIGI)
129    pub figi: Option<String>,
130    /// Filter by international securities identification number (ISIN)
131    pub isin: Option<String>,
132    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
133    pub cusip: Option<String>,
134    /// Filter by exchange name
135    pub exchange: Option<String>,
136    /// Filter by rating change action
137    pub rating_change: Option<String>,
138    /// Number of records in response
139    pub outputsize: Option<i64>
140}
141
142impl GetAnalystRatingsUsEquitiesParams {
143    /// Create a new builder for this parameter struct
144    pub fn builder() -> GetAnalystRatingsUsEquitiesParamsBuilder {
145        GetAnalystRatingsUsEquitiesParamsBuilder::default()
146    }
147}
148
149/// Builder for [`GetAnalystRatingsUsEquitiesParams`]
150#[derive(Clone, Debug, Default)]
151pub struct GetAnalystRatingsUsEquitiesParamsBuilder {
152    /// Filter by symbol
153    symbol: Option<String>,
154    /// Filter by financial instrument global identifier (FIGI)
155    figi: Option<String>,
156    /// Filter by international securities identification number (ISIN)
157    isin: Option<String>,
158    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
159    cusip: Option<String>,
160    /// Filter by exchange name
161    exchange: Option<String>,
162    /// Filter by rating change action
163    rating_change: Option<String>,
164    /// Number of records in response
165    outputsize: Option<i64>
166}
167
168impl GetAnalystRatingsUsEquitiesParamsBuilder {
169    /// Filter by symbol
170    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
171        self.symbol = Some(symbol.into());
172        self
173    }
174    /// Filter by financial instrument global identifier (FIGI)
175    pub fn figi(mut self, figi: impl Into<String>) -> Self {
176        self.figi = Some(figi.into());
177        self
178    }
179    /// Filter by international securities identification number (ISIN)
180    pub fn isin(mut self, isin: impl Into<String>) -> Self {
181        self.isin = Some(isin.into());
182        self
183    }
184    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
185    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
186        self.cusip = Some(cusip.into());
187        self
188    }
189    /// Filter by exchange name
190    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
191        self.exchange = Some(exchange.into());
192        self
193    }
194    /// Filter by rating change action
195    pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
196        self.rating_change = Some(rating_change.into());
197        self
198    }
199    /// Number of records in response
200    pub fn outputsize(mut self, outputsize: i64) -> Self {
201        self.outputsize = Some(outputsize);
202        self
203    }
204
205    /// Build the parameter struct
206    pub fn build(self) -> GetAnalystRatingsUsEquitiesParams {
207        GetAnalystRatingsUsEquitiesParams {
208            symbol: self.symbol,
209            figi: self.figi,
210            isin: self.isin,
211            cusip: self.cusip,
212            exchange: self.exchange,
213            rating_change: self.rating_change,
214            outputsize: self.outputsize
215        }
216    }
217}
218
219/// struct for passing parameters to the method [`get_earnings_estimate`]
220#[derive(Clone, Debug, Default, Serialize, Deserialize)]
221pub struct GetEarningsEstimateParams {
222    /// Filter by symbol
223    pub symbol: Option<String>,
224    /// The FIGI of an instrument for which data is requested
225    pub figi: Option<String>,
226    /// Filter by international securities identification number (ISIN)
227    pub isin: Option<String>,
228    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
229    pub cusip: Option<String>,
230    /// The country where the instrument is traded, e.g., `United States` or `US`
231    pub country: Option<String>,
232    /// Exchange where instrument is traded
233    pub exchange: Option<String>
234}
235
236impl GetEarningsEstimateParams {
237    /// Create a new builder for this parameter struct
238    pub fn builder() -> GetEarningsEstimateParamsBuilder {
239        GetEarningsEstimateParamsBuilder::default()
240    }
241}
242
243/// Builder for [`GetEarningsEstimateParams`]
244#[derive(Clone, Debug, Default)]
245pub struct GetEarningsEstimateParamsBuilder {
246    /// Filter by symbol
247    symbol: Option<String>,
248    /// The FIGI of an instrument for which data is requested
249    figi: Option<String>,
250    /// Filter by international securities identification number (ISIN)
251    isin: Option<String>,
252    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
253    cusip: Option<String>,
254    /// The country where the instrument is traded, e.g., `United States` or `US`
255    country: Option<String>,
256    /// Exchange where instrument is traded
257    exchange: Option<String>
258}
259
260impl GetEarningsEstimateParamsBuilder {
261    /// Filter by symbol
262    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
263        self.symbol = Some(symbol.into());
264        self
265    }
266    /// The FIGI of an instrument for which data is requested
267    pub fn figi(mut self, figi: impl Into<String>) -> Self {
268        self.figi = Some(figi.into());
269        self
270    }
271    /// Filter by international securities identification number (ISIN)
272    pub fn isin(mut self, isin: impl Into<String>) -> Self {
273        self.isin = Some(isin.into());
274        self
275    }
276    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
277    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
278        self.cusip = Some(cusip.into());
279        self
280    }
281    /// The country where the instrument is traded, e.g., `United States` or `US`
282    pub fn country(mut self, country: impl Into<String>) -> Self {
283        self.country = Some(country.into());
284        self
285    }
286    /// Exchange where instrument is traded
287    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
288        self.exchange = Some(exchange.into());
289        self
290    }
291
292    /// Build the parameter struct
293    pub fn build(self) -> GetEarningsEstimateParams {
294        GetEarningsEstimateParams {
295            symbol: self.symbol,
296            figi: self.figi,
297            isin: self.isin,
298            cusip: self.cusip,
299            country: self.country,
300            exchange: self.exchange
301        }
302    }
303}
304
305/// struct for passing parameters to the method [`get_edgar_filings_archive`]
306#[derive(Clone, Debug, Default, Serialize, Deserialize)]
307pub struct GetEdgarFilingsArchiveParams {
308    /// The ticker symbol of an instrument for which data is requested
309    pub symbol: Option<String>,
310    /// Filter by financial instrument global identifier (FIGI)
311    pub figi: Option<String>,
312    /// Filter by international securities identification number (ISIN)
313    pub isin: Option<String>,
314    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
315    pub cusip: Option<String>,
316    /// Filter by exchange name
317    pub exchange: Option<String>,
318    /// Filter by market identifier code (MIC) under ISO 10383 standard
319    pub mic_code: Option<String>,
320    /// Filter by country name or alpha code, e.g., `United States` or `US`
321    pub country: Option<String>,
322    /// Filter by form types, example `8-K`, `EX-1.1`
323    pub form_type: Option<String>,
324    /// Filter by filled time from
325    pub filled_from: Option<String>,
326    /// Filter by filled time to
327    pub filled_to: Option<String>,
328    /// Page number
329    pub page: Option<i64>,
330    /// Number of records in response
331    pub page_size: Option<i64>
332}
333
334impl GetEdgarFilingsArchiveParams {
335    /// Create a new builder for this parameter struct
336    pub fn builder() -> GetEdgarFilingsArchiveParamsBuilder {
337        GetEdgarFilingsArchiveParamsBuilder::default()
338    }
339}
340
341/// Builder for [`GetEdgarFilingsArchiveParams`]
342#[derive(Clone, Debug, Default)]
343pub struct GetEdgarFilingsArchiveParamsBuilder {
344    /// The ticker symbol of an instrument for which data is requested
345    symbol: Option<String>,
346    /// Filter by financial instrument global identifier (FIGI)
347    figi: Option<String>,
348    /// Filter by international securities identification number (ISIN)
349    isin: Option<String>,
350    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
351    cusip: Option<String>,
352    /// Filter by exchange name
353    exchange: Option<String>,
354    /// Filter by market identifier code (MIC) under ISO 10383 standard
355    mic_code: Option<String>,
356    /// Filter by country name or alpha code, e.g., `United States` or `US`
357    country: Option<String>,
358    /// Filter by form types, example `8-K`, `EX-1.1`
359    form_type: Option<String>,
360    /// Filter by filled time from
361    filled_from: Option<String>,
362    /// Filter by filled time to
363    filled_to: Option<String>,
364    /// Page number
365    page: Option<i64>,
366    /// Number of records in response
367    page_size: Option<i64>
368}
369
370impl GetEdgarFilingsArchiveParamsBuilder {
371    /// The ticker symbol of an instrument for which data is requested
372    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
373        self.symbol = Some(symbol.into());
374        self
375    }
376    /// Filter by financial instrument global identifier (FIGI)
377    pub fn figi(mut self, figi: impl Into<String>) -> Self {
378        self.figi = Some(figi.into());
379        self
380    }
381    /// Filter by international securities identification number (ISIN)
382    pub fn isin(mut self, isin: impl Into<String>) -> Self {
383        self.isin = Some(isin.into());
384        self
385    }
386    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
387    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
388        self.cusip = Some(cusip.into());
389        self
390    }
391    /// Filter by exchange name
392    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
393        self.exchange = Some(exchange.into());
394        self
395    }
396    /// Filter by market identifier code (MIC) under ISO 10383 standard
397    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
398        self.mic_code = Some(mic_code.into());
399        self
400    }
401    /// Filter by country name or alpha code, e.g., `United States` or `US`
402    pub fn country(mut self, country: impl Into<String>) -> Self {
403        self.country = Some(country.into());
404        self
405    }
406    /// Filter by form types, example `8-K`, `EX-1.1`
407    pub fn form_type(mut self, form_type: impl Into<String>) -> Self {
408        self.form_type = Some(form_type.into());
409        self
410    }
411    /// Filter by filled time from
412    pub fn filled_from(mut self, filled_from: impl Into<String>) -> Self {
413        self.filled_from = Some(filled_from.into());
414        self
415    }
416    /// Filter by filled time to
417    pub fn filled_to(mut self, filled_to: impl Into<String>) -> Self {
418        self.filled_to = Some(filled_to.into());
419        self
420    }
421    /// Page number
422    pub fn page(mut self, page: i64) -> Self {
423        self.page = Some(page);
424        self
425    }
426    /// Number of records in response
427    pub fn page_size(mut self, page_size: i64) -> Self {
428        self.page_size = Some(page_size);
429        self
430    }
431
432    /// Build the parameter struct
433    pub fn build(self) -> GetEdgarFilingsArchiveParams {
434        GetEdgarFilingsArchiveParams {
435            symbol: self.symbol,
436            figi: self.figi,
437            isin: self.isin,
438            cusip: self.cusip,
439            exchange: self.exchange,
440            mic_code: self.mic_code,
441            country: self.country,
442            form_type: self.form_type,
443            filled_from: self.filled_from,
444            filled_to: self.filled_to,
445            page: self.page,
446            page_size: self.page_size
447        }
448    }
449}
450
451/// struct for passing parameters to the method [`get_eps_revisions`]
452#[derive(Clone, Debug, Default, Serialize, Deserialize)]
453pub struct GetEpsRevisionsParams {
454    /// Filter by symbol
455    pub symbol: Option<String>,
456    /// Filter by financial instrument global identifier (FIGI)
457    pub figi: Option<String>,
458    /// Filter by international securities identification number (ISIN)
459    pub isin: Option<String>,
460    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
461    pub cusip: Option<String>,
462    /// Filter by country name or alpha code, e.g., `United States` or `US`
463    pub country: Option<String>,
464    /// Filter by exchange name
465    pub exchange: Option<String>
466}
467
468impl GetEpsRevisionsParams {
469    /// Create a new builder for this parameter struct
470    pub fn builder() -> GetEpsRevisionsParamsBuilder {
471        GetEpsRevisionsParamsBuilder::default()
472    }
473}
474
475/// Builder for [`GetEpsRevisionsParams`]
476#[derive(Clone, Debug, Default)]
477pub struct GetEpsRevisionsParamsBuilder {
478    /// Filter by symbol
479    symbol: Option<String>,
480    /// Filter by financial instrument global identifier (FIGI)
481    figi: Option<String>,
482    /// Filter by international securities identification number (ISIN)
483    isin: Option<String>,
484    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
485    cusip: Option<String>,
486    /// Filter by country name or alpha code, e.g., `United States` or `US`
487    country: Option<String>,
488    /// Filter by exchange name
489    exchange: Option<String>
490}
491
492impl GetEpsRevisionsParamsBuilder {
493    /// Filter by symbol
494    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
495        self.symbol = Some(symbol.into());
496        self
497    }
498    /// Filter by financial instrument global identifier (FIGI)
499    pub fn figi(mut self, figi: impl Into<String>) -> Self {
500        self.figi = Some(figi.into());
501        self
502    }
503    /// Filter by international securities identification number (ISIN)
504    pub fn isin(mut self, isin: impl Into<String>) -> Self {
505        self.isin = Some(isin.into());
506        self
507    }
508    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
509    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
510        self.cusip = Some(cusip.into());
511        self
512    }
513    /// Filter by country name or alpha code, e.g., `United States` or `US`
514    pub fn country(mut self, country: impl Into<String>) -> Self {
515        self.country = Some(country.into());
516        self
517    }
518    /// Filter by exchange name
519    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
520        self.exchange = Some(exchange.into());
521        self
522    }
523
524    /// Build the parameter struct
525    pub fn build(self) -> GetEpsRevisionsParams {
526        GetEpsRevisionsParams {
527            symbol: self.symbol,
528            figi: self.figi,
529            isin: self.isin,
530            cusip: self.cusip,
531            country: self.country,
532            exchange: self.exchange
533        }
534    }
535}
536
537/// struct for passing parameters to the method [`get_eps_trend`]
538#[derive(Clone, Debug, Default, Serialize, Deserialize)]
539pub struct GetEpsTrendParams {
540    /// Filter by symbol
541    pub symbol: Option<String>,
542    /// Filter by financial instrument global identifier (FIGI)
543    pub figi: Option<String>,
544    /// Filter by international securities identification number (ISIN)
545    pub isin: Option<String>,
546    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
547    pub cusip: Option<String>,
548    /// Filter by country name or alpha code, e.g., `United States` or `US`
549    pub country: Option<String>,
550    /// Filter by exchange name
551    pub exchange: Option<String>
552}
553
554impl GetEpsTrendParams {
555    /// Create a new builder for this parameter struct
556    pub fn builder() -> GetEpsTrendParamsBuilder {
557        GetEpsTrendParamsBuilder::default()
558    }
559}
560
561/// Builder for [`GetEpsTrendParams`]
562#[derive(Clone, Debug, Default)]
563pub struct GetEpsTrendParamsBuilder {
564    /// Filter by symbol
565    symbol: Option<String>,
566    /// Filter by financial instrument global identifier (FIGI)
567    figi: Option<String>,
568    /// Filter by international securities identification number (ISIN)
569    isin: Option<String>,
570    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
571    cusip: Option<String>,
572    /// Filter by country name or alpha code, e.g., `United States` or `US`
573    country: Option<String>,
574    /// Filter by exchange name
575    exchange: Option<String>
576}
577
578impl GetEpsTrendParamsBuilder {
579    /// Filter by symbol
580    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
581        self.symbol = Some(symbol.into());
582        self
583    }
584    /// Filter by financial instrument global identifier (FIGI)
585    pub fn figi(mut self, figi: impl Into<String>) -> Self {
586        self.figi = Some(figi.into());
587        self
588    }
589    /// Filter by international securities identification number (ISIN)
590    pub fn isin(mut self, isin: impl Into<String>) -> Self {
591        self.isin = Some(isin.into());
592        self
593    }
594    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
595    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
596        self.cusip = Some(cusip.into());
597        self
598    }
599    /// Filter by country name or alpha code, e.g., `United States` or `US`
600    pub fn country(mut self, country: impl Into<String>) -> Self {
601        self.country = Some(country.into());
602        self
603    }
604    /// Filter by exchange name
605    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
606        self.exchange = Some(exchange.into());
607        self
608    }
609
610    /// Build the parameter struct
611    pub fn build(self) -> GetEpsTrendParams {
612        GetEpsTrendParams {
613            symbol: self.symbol,
614            figi: self.figi,
615            isin: self.isin,
616            cusip: self.cusip,
617            country: self.country,
618            exchange: self.exchange
619        }
620    }
621}
622
623/// struct for passing parameters to the method [`get_growth_estimates`]
624#[derive(Clone, Debug, Default, Serialize, Deserialize)]
625pub struct GetGrowthEstimatesParams {
626    /// Filter by symbol
627    pub symbol: Option<String>,
628    /// The FIGI of an instrument for which data is requested
629    pub figi: Option<String>,
630    /// Filter by international securities identification number (ISIN)
631    pub isin: Option<String>,
632    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
633    pub cusip: Option<String>,
634    /// The country where the instrument is traded, e.g., `United States` or `US`
635    pub country: Option<String>,
636    /// Exchange where instrument is traded
637    pub exchange: Option<String>
638}
639
640impl GetGrowthEstimatesParams {
641    /// Create a new builder for this parameter struct
642    pub fn builder() -> GetGrowthEstimatesParamsBuilder {
643        GetGrowthEstimatesParamsBuilder::default()
644    }
645}
646
647/// Builder for [`GetGrowthEstimatesParams`]
648#[derive(Clone, Debug, Default)]
649pub struct GetGrowthEstimatesParamsBuilder {
650    /// Filter by symbol
651    symbol: Option<String>,
652    /// The FIGI of an instrument for which data is requested
653    figi: Option<String>,
654    /// Filter by international securities identification number (ISIN)
655    isin: Option<String>,
656    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
657    cusip: Option<String>,
658    /// The country where the instrument is traded, e.g., `United States` or `US`
659    country: Option<String>,
660    /// Exchange where instrument is traded
661    exchange: Option<String>
662}
663
664impl GetGrowthEstimatesParamsBuilder {
665    /// Filter by symbol
666    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
667        self.symbol = Some(symbol.into());
668        self
669    }
670    /// The FIGI of an instrument for which data is requested
671    pub fn figi(mut self, figi: impl Into<String>) -> Self {
672        self.figi = Some(figi.into());
673        self
674    }
675    /// Filter by international securities identification number (ISIN)
676    pub fn isin(mut self, isin: impl Into<String>) -> Self {
677        self.isin = Some(isin.into());
678        self
679    }
680    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
681    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
682        self.cusip = Some(cusip.into());
683        self
684    }
685    /// The country where the instrument is traded, e.g., `United States` or `US`
686    pub fn country(mut self, country: impl Into<String>) -> Self {
687        self.country = Some(country.into());
688        self
689    }
690    /// Exchange where instrument is traded
691    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
692        self.exchange = Some(exchange.into());
693        self
694    }
695
696    /// Build the parameter struct
697    pub fn build(self) -> GetGrowthEstimatesParams {
698        GetGrowthEstimatesParams {
699            symbol: self.symbol,
700            figi: self.figi,
701            isin: self.isin,
702            cusip: self.cusip,
703            country: self.country,
704            exchange: self.exchange
705        }
706    }
707}
708
709/// struct for passing parameters to the method [`get_price_target`]
710#[derive(Clone, Debug, Default, Serialize, Deserialize)]
711pub struct GetPriceTargetParams {
712    /// Filter by symbol
713    pub symbol: Option<String>,
714    /// Filter by financial instrument global identifier (FIGI)
715    pub figi: Option<String>,
716    /// Filter by international securities identification number (ISIN)
717    pub isin: Option<String>,
718    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
719    pub cusip: Option<String>,
720    /// Filter by country name or alpha code, e.g., `United States` or `US`
721    pub country: Option<String>,
722    /// Filter by exchange name
723    pub exchange: Option<String>
724}
725
726impl GetPriceTargetParams {
727    /// Create a new builder for this parameter struct
728    pub fn builder() -> GetPriceTargetParamsBuilder {
729        GetPriceTargetParamsBuilder::default()
730    }
731}
732
733/// Builder for [`GetPriceTargetParams`]
734#[derive(Clone, Debug, Default)]
735pub struct GetPriceTargetParamsBuilder {
736    /// Filter by symbol
737    symbol: Option<String>,
738    /// Filter by financial instrument global identifier (FIGI)
739    figi: Option<String>,
740    /// Filter by international securities identification number (ISIN)
741    isin: Option<String>,
742    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
743    cusip: Option<String>,
744    /// Filter by country name or alpha code, e.g., `United States` or `US`
745    country: Option<String>,
746    /// Filter by exchange name
747    exchange: Option<String>
748}
749
750impl GetPriceTargetParamsBuilder {
751    /// Filter by symbol
752    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
753        self.symbol = Some(symbol.into());
754        self
755    }
756    /// Filter by financial instrument global identifier (FIGI)
757    pub fn figi(mut self, figi: impl Into<String>) -> Self {
758        self.figi = Some(figi.into());
759        self
760    }
761    /// Filter by international securities identification number (ISIN)
762    pub fn isin(mut self, isin: impl Into<String>) -> Self {
763        self.isin = Some(isin.into());
764        self
765    }
766    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
767    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
768        self.cusip = Some(cusip.into());
769        self
770    }
771    /// Filter by country name or alpha code, e.g., `United States` or `US`
772    pub fn country(mut self, country: impl Into<String>) -> Self {
773        self.country = Some(country.into());
774        self
775    }
776    /// Filter by exchange name
777    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
778        self.exchange = Some(exchange.into());
779        self
780    }
781
782    /// Build the parameter struct
783    pub fn build(self) -> GetPriceTargetParams {
784        GetPriceTargetParams {
785            symbol: self.symbol,
786            figi: self.figi,
787            isin: self.isin,
788            cusip: self.cusip,
789            country: self.country,
790            exchange: self.exchange
791        }
792    }
793}
794
795/// struct for passing parameters to the method [`get_recommendations`]
796#[derive(Clone, Debug, Default, Serialize, Deserialize)]
797pub struct GetRecommendationsParams {
798    /// Filter by symbol
799    pub symbol: Option<String>,
800    /// The FIGI of an instrument for which data is requested
801    pub figi: Option<String>,
802    /// Filter by international securities identification number (ISIN)
803    pub isin: Option<String>,
804    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
805    pub cusip: Option<String>,
806    /// The country where the instrument is traded, e.g., `United States` or `US`
807    pub country: Option<String>,
808    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
809    pub exchange: Option<String>
810}
811
812impl GetRecommendationsParams {
813    /// Create a new builder for this parameter struct
814    pub fn builder() -> GetRecommendationsParamsBuilder {
815        GetRecommendationsParamsBuilder::default()
816    }
817}
818
819/// Builder for [`GetRecommendationsParams`]
820#[derive(Clone, Debug, Default)]
821pub struct GetRecommendationsParamsBuilder {
822    /// Filter by symbol
823    symbol: Option<String>,
824    /// The FIGI of an instrument for which data is requested
825    figi: Option<String>,
826    /// Filter by international securities identification number (ISIN)
827    isin: Option<String>,
828    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
829    cusip: Option<String>,
830    /// The country where the instrument is traded, e.g., `United States` or `US`
831    country: Option<String>,
832    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
833    exchange: Option<String>
834}
835
836impl GetRecommendationsParamsBuilder {
837    /// Filter by symbol
838    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
839        self.symbol = Some(symbol.into());
840        self
841    }
842    /// The FIGI of an instrument for which data is requested
843    pub fn figi(mut self, figi: impl Into<String>) -> Self {
844        self.figi = Some(figi.into());
845        self
846    }
847    /// Filter by international securities identification number (ISIN)
848    pub fn isin(mut self, isin: impl Into<String>) -> Self {
849        self.isin = Some(isin.into());
850        self
851    }
852    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
853    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
854        self.cusip = Some(cusip.into());
855        self
856    }
857    /// The country where the instrument is traded, e.g., `United States` or `US`
858    pub fn country(mut self, country: impl Into<String>) -> Self {
859        self.country = Some(country.into());
860        self
861    }
862    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
863    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
864        self.exchange = Some(exchange.into());
865        self
866    }
867
868    /// Build the parameter struct
869    pub fn build(self) -> GetRecommendationsParams {
870        GetRecommendationsParams {
871            symbol: self.symbol,
872            figi: self.figi,
873            isin: self.isin,
874            cusip: self.cusip,
875            country: self.country,
876            exchange: self.exchange
877        }
878    }
879}
880
881/// struct for passing parameters to the method [`get_revenue_estimate`]
882#[derive(Clone, Debug, Default, Serialize, Deserialize)]
883pub struct GetRevenueEstimateParams {
884    /// Filter by symbol
885    pub symbol: Option<String>,
886    /// Filter by financial instrument global identifier (FIGI)
887    pub figi: Option<String>,
888    /// Filter by international securities identification number (ISIN)
889    pub isin: Option<String>,
890    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
891    pub cusip: Option<String>,
892    /// Filter by country name or alpha code, e.g., `United States` or `US`
893    pub country: Option<String>,
894    /// Filter by exchange name
895    pub exchange: Option<String>,
896    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
897    pub dp: Option<i64>
898}
899
900impl GetRevenueEstimateParams {
901    /// Create a new builder for this parameter struct
902    pub fn builder() -> GetRevenueEstimateParamsBuilder {
903        GetRevenueEstimateParamsBuilder::default()
904    }
905}
906
907/// Builder for [`GetRevenueEstimateParams`]
908#[derive(Clone, Debug, Default)]
909pub struct GetRevenueEstimateParamsBuilder {
910    /// Filter by symbol
911    symbol: Option<String>,
912    /// Filter by financial instrument global identifier (FIGI)
913    figi: Option<String>,
914    /// Filter by international securities identification number (ISIN)
915    isin: Option<String>,
916    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
917    cusip: Option<String>,
918    /// Filter by country name or alpha code, e.g., `United States` or `US`
919    country: Option<String>,
920    /// Filter by exchange name
921    exchange: Option<String>,
922    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
923    dp: Option<i64>
924}
925
926impl GetRevenueEstimateParamsBuilder {
927    /// Filter by symbol
928    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
929        self.symbol = Some(symbol.into());
930        self
931    }
932    /// Filter by financial instrument global identifier (FIGI)
933    pub fn figi(mut self, figi: impl Into<String>) -> Self {
934        self.figi = Some(figi.into());
935        self
936    }
937    /// Filter by international securities identification number (ISIN)
938    pub fn isin(mut self, isin: impl Into<String>) -> Self {
939        self.isin = Some(isin.into());
940        self
941    }
942    /// The CUSIP of an instrument for which data is requested. CUSIP access is activating in the <a href=\"https://twelvedata.com/account/add-ons\">Add-ons</a> section
943    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
944        self.cusip = Some(cusip.into());
945        self
946    }
947    /// Filter by country name or alpha code, e.g., `United States` or `US`
948    pub fn country(mut self, country: impl Into<String>) -> Self {
949        self.country = Some(country.into());
950        self
951    }
952    /// Filter by exchange name
953    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
954        self.exchange = Some(exchange.into());
955        self
956    }
957    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
958    pub fn dp(mut self, dp: i64) -> Self {
959        self.dp = Some(dp);
960        self
961    }
962
963    /// Build the parameter struct
964    pub fn build(self) -> GetRevenueEstimateParams {
965        GetRevenueEstimateParams {
966            symbol: self.symbol,
967            figi: self.figi,
968            isin: self.isin,
969            cusip: self.cusip,
970            country: self.country,
971            exchange: self.exchange,
972            dp: self.dp
973        }
974    }
975}
976
977
978/// struct for typed errors of method [`get_analyst_ratings_light`]
979#[derive(Debug, Clone, Serialize, Deserialize)]
980#[serde(untagged)]
981pub enum GetAnalystRatingsLightError {
982    UnknownValue(serde_json::Value),
983}
984
985/// struct for typed errors of method [`get_analyst_ratings_us_equities`]
986#[derive(Debug, Clone, Serialize, Deserialize)]
987#[serde(untagged)]
988pub enum GetAnalystRatingsUsEquitiesError {
989    UnknownValue(serde_json::Value),
990}
991
992/// struct for typed errors of method [`get_earnings_estimate`]
993#[derive(Debug, Clone, Serialize, Deserialize)]
994#[serde(untagged)]
995pub enum GetEarningsEstimateError {
996    UnknownValue(serde_json::Value),
997}
998
999/// struct for typed errors of method [`get_edgar_filings_archive`]
1000#[derive(Debug, Clone, Serialize, Deserialize)]
1001#[serde(untagged)]
1002pub enum GetEdgarFilingsArchiveError {
1003    UnknownValue(serde_json::Value),
1004}
1005
1006/// struct for typed errors of method [`get_eps_revisions`]
1007#[derive(Debug, Clone, Serialize, Deserialize)]
1008#[serde(untagged)]
1009pub enum GetEpsRevisionsError {
1010    UnknownValue(serde_json::Value),
1011}
1012
1013/// struct for typed errors of method [`get_eps_trend`]
1014#[derive(Debug, Clone, Serialize, Deserialize)]
1015#[serde(untagged)]
1016pub enum GetEpsTrendError {
1017    UnknownValue(serde_json::Value),
1018}
1019
1020/// struct for typed errors of method [`get_growth_estimates`]
1021#[derive(Debug, Clone, Serialize, Deserialize)]
1022#[serde(untagged)]
1023pub enum GetGrowthEstimatesError {
1024    UnknownValue(serde_json::Value),
1025}
1026
1027/// struct for typed errors of method [`get_price_target`]
1028#[derive(Debug, Clone, Serialize, Deserialize)]
1029#[serde(untagged)]
1030pub enum GetPriceTargetError {
1031    UnknownValue(serde_json::Value),
1032}
1033
1034/// struct for typed errors of method [`get_recommendations`]
1035#[derive(Debug, Clone, Serialize, Deserialize)]
1036#[serde(untagged)]
1037pub enum GetRecommendationsError {
1038    UnknownValue(serde_json::Value),
1039}
1040
1041/// struct for typed errors of method [`get_revenue_estimate`]
1042#[derive(Debug, Clone, Serialize, Deserialize)]
1043#[serde(untagged)]
1044pub enum GetRevenueEstimateError {
1045    UnknownValue(serde_json::Value),
1046}
1047
1048
1049/// The analyst ratings snapshot endpoint provides a streamlined summary of ratings from analyst firms for both US and international markets. It delivers essential data on analyst recommendations, including buy, hold, and sell ratings, allowing users to quickly assess the general sentiment of analysts towards a particular stock.
1050pub async fn get_analyst_ratings_light(configuration: &configuration::Configuration, params: GetAnalystRatingsLightParams) -> Result<models::GetAnalystRatingsLight200Response, Error<GetAnalystRatingsLightError>> {
1051    // Extract parameters from params struct
1052    let p_query_symbol = params.symbol;
1053    let p_query_figi = params.figi;
1054    let p_query_isin = params.isin;
1055    let p_query_cusip = params.cusip;
1056    let p_query_exchange = params.exchange;
1057    let p_query_rating_change = params.rating_change;
1058    let p_query_outputsize = params.outputsize;
1059    let p_query_country = params.country;
1060
1061    let uri_str = format!("{}/analyst_ratings/light", configuration.base_path);
1062    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1063
1064    if let Some(ref param_value) = p_query_symbol {
1065        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1066    }
1067    if let Some(ref param_value) = p_query_figi {
1068        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1069    }
1070    if let Some(ref param_value) = p_query_isin {
1071        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1072    }
1073    if let Some(ref param_value) = p_query_cusip {
1074        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1075    }
1076    if let Some(ref param_value) = p_query_exchange {
1077        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1078    }
1079    if let Some(ref param_value) = p_query_rating_change {
1080        req_builder = req_builder.query(&[("rating_change", &serde_json::to_string(param_value)?)]);
1081    }
1082    if let Some(ref param_value) = p_query_outputsize {
1083        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
1084    }
1085    if let Some(ref param_value) = p_query_country {
1086        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1087    }
1088    if let Some(ref user_agent) = configuration.user_agent {
1089        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1090    }
1091    if let Some(ref apikey) = configuration.api_key {
1092        let key = apikey.key.clone();
1093        let value = match apikey.prefix {
1094            Some(ref prefix) => format!("{} {}", prefix, key),
1095            None => key,
1096        };
1097        req_builder = req_builder.header("Authorization", value);
1098    };
1099
1100    let req = req_builder.build()?;
1101    let resp = configuration.client.execute(req).await?;
1102
1103    let status = resp.status();
1104    let content_type = resp
1105        .headers()
1106        .get("content-type")
1107        .and_then(|v| v.to_str().ok())
1108        .unwrap_or("application/octet-stream");
1109    let content_type = super::ContentType::from(content_type);
1110
1111    if !status.is_client_error() && !status.is_server_error() {
1112        let content = resp.text().await?;
1113        match content_type {
1114            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1115            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsLight200Response`"))),
1116            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAnalystRatingsLight200Response`")))),
1117        }
1118    } else {
1119        let content = resp.text().await?;
1120        let entity: Option<GetAnalystRatingsLightError> = serde_json::from_str(&content).ok();
1121        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1122    }
1123}
1124
1125/// The analyst ratings US equities endpoint provides detailed information on analyst ratings for U.S. stocks. It returns data on the latest ratings issued by various analyst firms, including the rating itself, the firm issuing the rating, and any changes in the rating. This endpoint is useful for users tracking analyst opinions on U.S. equities, allowing them to see how professional analysts view the potential performance of specific stocks.
1126pub async fn get_analyst_ratings_us_equities(configuration: &configuration::Configuration, params: GetAnalystRatingsUsEquitiesParams) -> Result<models::GetAnalystRatingsUsEquities200Response, Error<GetAnalystRatingsUsEquitiesError>> {
1127    // Extract parameters from params struct
1128    let p_query_symbol = params.symbol;
1129    let p_query_figi = params.figi;
1130    let p_query_isin = params.isin;
1131    let p_query_cusip = params.cusip;
1132    let p_query_exchange = params.exchange;
1133    let p_query_rating_change = params.rating_change;
1134    let p_query_outputsize = params.outputsize;
1135
1136    let uri_str = format!("{}/analyst_ratings/us_equities", configuration.base_path);
1137    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1138
1139    if let Some(ref param_value) = p_query_symbol {
1140        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1141    }
1142    if let Some(ref param_value) = p_query_figi {
1143        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1144    }
1145    if let Some(ref param_value) = p_query_isin {
1146        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1147    }
1148    if let Some(ref param_value) = p_query_cusip {
1149        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1150    }
1151    if let Some(ref param_value) = p_query_exchange {
1152        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1153    }
1154    if let Some(ref param_value) = p_query_rating_change {
1155        req_builder = req_builder.query(&[("rating_change", &serde_json::to_string(param_value)?)]);
1156    }
1157    if let Some(ref param_value) = p_query_outputsize {
1158        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
1159    }
1160    if let Some(ref user_agent) = configuration.user_agent {
1161        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1162    }
1163    if let Some(ref apikey) = configuration.api_key {
1164        let key = apikey.key.clone();
1165        let value = match apikey.prefix {
1166            Some(ref prefix) => format!("{} {}", prefix, key),
1167            None => key,
1168        };
1169        req_builder = req_builder.header("Authorization", value);
1170    };
1171
1172    let req = req_builder.build()?;
1173    let resp = configuration.client.execute(req).await?;
1174
1175    let status = resp.status();
1176    let content_type = resp
1177        .headers()
1178        .get("content-type")
1179        .and_then(|v| v.to_str().ok())
1180        .unwrap_or("application/octet-stream");
1181    let content_type = super::ContentType::from(content_type);
1182
1183    if !status.is_client_error() && !status.is_server_error() {
1184        let content = resp.text().await?;
1185        match content_type {
1186            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1187            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsUsEquities200Response`"))),
1188            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAnalystRatingsUsEquities200Response`")))),
1189        }
1190    } else {
1191        let content = resp.text().await?;
1192        let entity: Option<GetAnalystRatingsUsEquitiesError> = serde_json::from_str(&content).ok();
1193        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1194    }
1195}
1196
1197/// The earnings estimate endpoint provides access to analysts' projected earnings per share (EPS) for a specific company, covering both upcoming quarterly and annual periods. This data is crucial for users who need to track and compare expected financial performance across different timeframes, aiding in the evaluation of a company's future profitability.
1198pub async fn get_earnings_estimate(configuration: &configuration::Configuration, params: GetEarningsEstimateParams) -> Result<models::GetEarningsEstimate200Response, Error<GetEarningsEstimateError>> {
1199    // Extract parameters from params struct
1200    let p_query_symbol = params.symbol;
1201    let p_query_figi = params.figi;
1202    let p_query_isin = params.isin;
1203    let p_query_cusip = params.cusip;
1204    let p_query_country = params.country;
1205    let p_query_exchange = params.exchange;
1206
1207    let uri_str = format!("{}/earnings_estimate", configuration.base_path);
1208    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1209
1210    if let Some(ref param_value) = p_query_symbol {
1211        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1212    }
1213    if let Some(ref param_value) = p_query_figi {
1214        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1215    }
1216    if let Some(ref param_value) = p_query_isin {
1217        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1218    }
1219    if let Some(ref param_value) = p_query_cusip {
1220        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1221    }
1222    if let Some(ref param_value) = p_query_country {
1223        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1224    }
1225    if let Some(ref param_value) = p_query_exchange {
1226        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1227    }
1228    if let Some(ref user_agent) = configuration.user_agent {
1229        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1230    }
1231    if let Some(ref apikey) = configuration.api_key {
1232        let key = apikey.key.clone();
1233        let value = match apikey.prefix {
1234            Some(ref prefix) => format!("{} {}", prefix, key),
1235            None => key,
1236        };
1237        req_builder = req_builder.header("Authorization", value);
1238    };
1239
1240    let req = req_builder.build()?;
1241    let resp = configuration.client.execute(req).await?;
1242
1243    let status = resp.status();
1244    let content_type = resp
1245        .headers()
1246        .get("content-type")
1247        .and_then(|v| v.to_str().ok())
1248        .unwrap_or("application/octet-stream");
1249    let content_type = super::ContentType::from(content_type);
1250
1251    if !status.is_client_error() && !status.is_server_error() {
1252        let content = resp.text().await?;
1253        match content_type {
1254            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1255            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEarningsEstimate200Response`"))),
1256            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEarningsEstimate200Response`")))),
1257        }
1258    } else {
1259        let content = resp.text().await?;
1260        let entity: Option<GetEarningsEstimateError> = serde_json::from_str(&content).ok();
1261        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1262    }
1263}
1264
1265/// The EDGAR fillings endpoint provides access to a comprehensive collection of financial documents submitted to the SEC, including real-time and historical forms, filings, and exhibits. Users can retrieve detailed information about company disclosures, financial statements, and regulatory submissions, enabling them to access essential compliance and financial data directly from the SEC's EDGAR system.
1266pub async fn get_edgar_filings_archive(configuration: &configuration::Configuration, params: GetEdgarFilingsArchiveParams) -> Result<models::GetEdgarFilingsArchive200Response, Error<GetEdgarFilingsArchiveError>> {
1267    // Extract parameters from params struct
1268    let p_query_symbol = params.symbol;
1269    let p_query_figi = params.figi;
1270    let p_query_isin = params.isin;
1271    let p_query_cusip = params.cusip;
1272    let p_query_exchange = params.exchange;
1273    let p_query_mic_code = params.mic_code;
1274    let p_query_country = params.country;
1275    let p_query_form_type = params.form_type;
1276    let p_query_filled_from = params.filled_from;
1277    let p_query_filled_to = params.filled_to;
1278    let p_query_page = params.page;
1279    let p_query_page_size = params.page_size;
1280
1281    let uri_str = format!("{}/edgar_filings/archive", configuration.base_path);
1282    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1283
1284    if let Some(ref param_value) = p_query_symbol {
1285        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1286    }
1287    if let Some(ref param_value) = p_query_figi {
1288        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1289    }
1290    if let Some(ref param_value) = p_query_isin {
1291        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1292    }
1293    if let Some(ref param_value) = p_query_cusip {
1294        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1295    }
1296    if let Some(ref param_value) = p_query_exchange {
1297        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1298    }
1299    if let Some(ref param_value) = p_query_mic_code {
1300        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
1301    }
1302    if let Some(ref param_value) = p_query_country {
1303        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1304    }
1305    if let Some(ref param_value) = p_query_form_type {
1306        req_builder = req_builder.query(&[("form_type", &param_value.to_string())]);
1307    }
1308    if let Some(ref param_value) = p_query_filled_from {
1309        req_builder = req_builder.query(&[("filled_from", &param_value.to_string())]);
1310    }
1311    if let Some(ref param_value) = p_query_filled_to {
1312        req_builder = req_builder.query(&[("filled_to", &param_value.to_string())]);
1313    }
1314    if let Some(ref param_value) = p_query_page {
1315        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1316    }
1317    if let Some(ref param_value) = p_query_page_size {
1318        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1319    }
1320    if let Some(ref user_agent) = configuration.user_agent {
1321        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1322    }
1323    if let Some(ref apikey) = configuration.api_key {
1324        let key = apikey.key.clone();
1325        let value = match apikey.prefix {
1326            Some(ref prefix) => format!("{} {}", prefix, key),
1327            None => key,
1328        };
1329        req_builder = req_builder.header("Authorization", value);
1330    };
1331
1332    let req = req_builder.build()?;
1333    let resp = configuration.client.execute(req).await?;
1334
1335    let status = resp.status();
1336    let content_type = resp
1337        .headers()
1338        .get("content-type")
1339        .and_then(|v| v.to_str().ok())
1340        .unwrap_or("application/octet-stream");
1341    let content_type = super::ContentType::from(content_type);
1342
1343    if !status.is_client_error() && !status.is_server_error() {
1344        let content = resp.text().await?;
1345        match content_type {
1346            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1347            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEdgarFilingsArchive200Response`"))),
1348            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEdgarFilingsArchive200Response`")))),
1349        }
1350    } else {
1351        let content = resp.text().await?;
1352        let entity: Option<GetEdgarFilingsArchiveError> = serde_json::from_str(&content).ok();
1353        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1354    }
1355}
1356
1357/// The EPS revisions endpoint provides updated analyst forecasts for a company's earnings per share (EPS) on both a quarterly and annual basis. It delivers data on how these EPS predictions have changed over the past week and month, allowing users to track recent adjustments in analyst expectations. This endpoint is useful for monitoring shifts in market sentiment regarding a company's financial performance.
1358pub async fn get_eps_revisions(configuration: &configuration::Configuration, params: GetEpsRevisionsParams) -> Result<models::GetEpsRevisions200Response, Error<GetEpsRevisionsError>> {
1359    // Extract parameters from params struct
1360    let p_query_symbol = params.symbol;
1361    let p_query_figi = params.figi;
1362    let p_query_isin = params.isin;
1363    let p_query_cusip = params.cusip;
1364    let p_query_country = params.country;
1365    let p_query_exchange = params.exchange;
1366
1367    let uri_str = format!("{}/eps_revisions", configuration.base_path);
1368    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1369
1370    if let Some(ref param_value) = p_query_symbol {
1371        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1372    }
1373    if let Some(ref param_value) = p_query_figi {
1374        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1375    }
1376    if let Some(ref param_value) = p_query_isin {
1377        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1378    }
1379    if let Some(ref param_value) = p_query_cusip {
1380        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1381    }
1382    if let Some(ref param_value) = p_query_country {
1383        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1384    }
1385    if let Some(ref param_value) = p_query_exchange {
1386        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1387    }
1388    if let Some(ref user_agent) = configuration.user_agent {
1389        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1390    }
1391    if let Some(ref apikey) = configuration.api_key {
1392        let key = apikey.key.clone();
1393        let value = match apikey.prefix {
1394            Some(ref prefix) => format!("{} {}", prefix, key),
1395            None => key,
1396        };
1397        req_builder = req_builder.header("Authorization", value);
1398    };
1399
1400    let req = req_builder.build()?;
1401    let resp = configuration.client.execute(req).await?;
1402
1403    let status = resp.status();
1404    let content_type = resp
1405        .headers()
1406        .get("content-type")
1407        .and_then(|v| v.to_str().ok())
1408        .unwrap_or("application/octet-stream");
1409    let content_type = super::ContentType::from(content_type);
1410
1411    if !status.is_client_error() && !status.is_server_error() {
1412        let content = resp.text().await?;
1413        match content_type {
1414            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1415            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsRevisions200Response`"))),
1416            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEpsRevisions200Response`")))),
1417        }
1418    } else {
1419        let content = resp.text().await?;
1420        let entity: Option<GetEpsRevisionsError> = serde_json::from_str(&content).ok();
1421        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1422    }
1423}
1424
1425/// The EPS trend endpoint provides detailed historical data on Earnings Per Share (EPS) trends over specified periods. It returns a comprehensive breakdown of estimated EPS changes, allowing users to track and analyze the progression of a company's earnings performance over time. This endpoint is ideal for users seeking to understand historical EPS fluctuations and assess financial growth patterns.
1426pub async fn get_eps_trend(configuration: &configuration::Configuration, params: GetEpsTrendParams) -> Result<models::GetEpsTrend200Response, Error<GetEpsTrendError>> {
1427    // Extract parameters from params struct
1428    let p_query_symbol = params.symbol;
1429    let p_query_figi = params.figi;
1430    let p_query_isin = params.isin;
1431    let p_query_cusip = params.cusip;
1432    let p_query_country = params.country;
1433    let p_query_exchange = params.exchange;
1434
1435    let uri_str = format!("{}/eps_trend", configuration.base_path);
1436    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1437
1438    if let Some(ref param_value) = p_query_symbol {
1439        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1440    }
1441    if let Some(ref param_value) = p_query_figi {
1442        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1443    }
1444    if let Some(ref param_value) = p_query_isin {
1445        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1446    }
1447    if let Some(ref param_value) = p_query_cusip {
1448        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1449    }
1450    if let Some(ref param_value) = p_query_country {
1451        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1452    }
1453    if let Some(ref param_value) = p_query_exchange {
1454        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1455    }
1456    if let Some(ref user_agent) = configuration.user_agent {
1457        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1458    }
1459    if let Some(ref apikey) = configuration.api_key {
1460        let key = apikey.key.clone();
1461        let value = match apikey.prefix {
1462            Some(ref prefix) => format!("{} {}", prefix, key),
1463            None => key,
1464        };
1465        req_builder = req_builder.header("Authorization", value);
1466    };
1467
1468    let req = req_builder.build()?;
1469    let resp = configuration.client.execute(req).await?;
1470
1471    let status = resp.status();
1472    let content_type = resp
1473        .headers()
1474        .get("content-type")
1475        .and_then(|v| v.to_str().ok())
1476        .unwrap_or("application/octet-stream");
1477    let content_type = super::ContentType::from(content_type);
1478
1479    if !status.is_client_error() && !status.is_server_error() {
1480        let content = resp.text().await?;
1481        match content_type {
1482            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1483            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsTrend200Response`"))),
1484            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEpsTrend200Response`")))),
1485        }
1486    } else {
1487        let content = resp.text().await?;
1488        let entity: Option<GetEpsTrendError> = serde_json::from_str(&content).ok();
1489        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1490    }
1491}
1492
1493/// The growth estimates endpoint provides consensus analyst projections on a company's growth rates over various timeframes. It aggregates and averages estimates from multiple analysts, focusing on key financial metrics such as earnings per share and revenue. This endpoint is useful for obtaining a comprehensive view of expected company performance based on expert analysis.
1494pub async fn get_growth_estimates(configuration: &configuration::Configuration, params: GetGrowthEstimatesParams) -> Result<models::GetGrowthEstimates200Response, Error<GetGrowthEstimatesError>> {
1495    // Extract parameters from params struct
1496    let p_query_symbol = params.symbol;
1497    let p_query_figi = params.figi;
1498    let p_query_isin = params.isin;
1499    let p_query_cusip = params.cusip;
1500    let p_query_country = params.country;
1501    let p_query_exchange = params.exchange;
1502
1503    let uri_str = format!("{}/growth_estimates", configuration.base_path);
1504    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1505
1506    if let Some(ref param_value) = p_query_symbol {
1507        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1508    }
1509    if let Some(ref param_value) = p_query_figi {
1510        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1511    }
1512    if let Some(ref param_value) = p_query_isin {
1513        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1514    }
1515    if let Some(ref param_value) = p_query_cusip {
1516        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1517    }
1518    if let Some(ref param_value) = p_query_country {
1519        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1520    }
1521    if let Some(ref param_value) = p_query_exchange {
1522        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1523    }
1524    if let Some(ref user_agent) = configuration.user_agent {
1525        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1526    }
1527    if let Some(ref apikey) = configuration.api_key {
1528        let key = apikey.key.clone();
1529        let value = match apikey.prefix {
1530            Some(ref prefix) => format!("{} {}", prefix, key),
1531            None => key,
1532        };
1533        req_builder = req_builder.header("Authorization", value);
1534    };
1535
1536    let req = req_builder.build()?;
1537    let resp = configuration.client.execute(req).await?;
1538
1539    let status = resp.status();
1540    let content_type = resp
1541        .headers()
1542        .get("content-type")
1543        .and_then(|v| v.to_str().ok())
1544        .unwrap_or("application/octet-stream");
1545    let content_type = super::ContentType::from(content_type);
1546
1547    if !status.is_client_error() && !status.is_server_error() {
1548        let content = resp.text().await?;
1549        match content_type {
1550            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1551            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetGrowthEstimates200Response`"))),
1552            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetGrowthEstimates200Response`")))),
1553        }
1554    } else {
1555        let content = resp.text().await?;
1556        let entity: Option<GetGrowthEstimatesError> = serde_json::from_str(&content).ok();
1557        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1558    }
1559}
1560
1561/// The price target endpoint provides detailed projections of a security's future price as estimated by financial analysts. It returns data including the high, low, and average price targets. This endpoint is useful for users seeking to understand potential future valuations of specific securities based on expert analysis.
1562pub async fn get_price_target(configuration: &configuration::Configuration, params: GetPriceTargetParams) -> Result<models::GetPriceTarget200Response, Error<GetPriceTargetError>> {
1563    // Extract parameters from params struct
1564    let p_query_symbol = params.symbol;
1565    let p_query_figi = params.figi;
1566    let p_query_isin = params.isin;
1567    let p_query_cusip = params.cusip;
1568    let p_query_country = params.country;
1569    let p_query_exchange = params.exchange;
1570
1571    let uri_str = format!("{}/price_target", configuration.base_path);
1572    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1573
1574    if let Some(ref param_value) = p_query_symbol {
1575        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1576    }
1577    if let Some(ref param_value) = p_query_figi {
1578        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1579    }
1580    if let Some(ref param_value) = p_query_isin {
1581        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1582    }
1583    if let Some(ref param_value) = p_query_cusip {
1584        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1585    }
1586    if let Some(ref param_value) = p_query_country {
1587        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1588    }
1589    if let Some(ref param_value) = p_query_exchange {
1590        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1591    }
1592    if let Some(ref user_agent) = configuration.user_agent {
1593        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1594    }
1595    if let Some(ref apikey) = configuration.api_key {
1596        let key = apikey.key.clone();
1597        let value = match apikey.prefix {
1598            Some(ref prefix) => format!("{} {}", prefix, key),
1599            None => key,
1600        };
1601        req_builder = req_builder.header("Authorization", value);
1602    };
1603
1604    let req = req_builder.build()?;
1605    let resp = configuration.client.execute(req).await?;
1606
1607    let status = resp.status();
1608    let content_type = resp
1609        .headers()
1610        .get("content-type")
1611        .and_then(|v| v.to_str().ok())
1612        .unwrap_or("application/octet-stream");
1613    let content_type = super::ContentType::from(content_type);
1614
1615    if !status.is_client_error() && !status.is_server_error() {
1616        let content = resp.text().await?;
1617        match content_type {
1618            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1619            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPriceTarget200Response`"))),
1620            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetPriceTarget200Response`")))),
1621        }
1622    } else {
1623        let content = resp.text().await?;
1624        let entity: Option<GetPriceTargetError> = serde_json::from_str(&content).ok();
1625        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1626    }
1627}
1628
1629/// The recommendations endpoint provides a summary of analyst opinions for a specific stock, delivering an average recommendation categorized as Strong Buy, Buy, Hold, or Sell. It also includes a numerical recommendation score, offering a quick overview of market sentiment based on expert analysis.
1630pub async fn get_recommendations(configuration: &configuration::Configuration, params: GetRecommendationsParams) -> Result<models::GetRecommendations200Response, Error<GetRecommendationsError>> {
1631    // Extract parameters from params struct
1632    let p_query_symbol = params.symbol;
1633    let p_query_figi = params.figi;
1634    let p_query_isin = params.isin;
1635    let p_query_cusip = params.cusip;
1636    let p_query_country = params.country;
1637    let p_query_exchange = params.exchange;
1638
1639    let uri_str = format!("{}/recommendations", configuration.base_path);
1640    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1641
1642    if let Some(ref param_value) = p_query_symbol {
1643        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1644    }
1645    if let Some(ref param_value) = p_query_figi {
1646        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1647    }
1648    if let Some(ref param_value) = p_query_isin {
1649        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1650    }
1651    if let Some(ref param_value) = p_query_cusip {
1652        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1653    }
1654    if let Some(ref param_value) = p_query_country {
1655        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1656    }
1657    if let Some(ref param_value) = p_query_exchange {
1658        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1659    }
1660    if let Some(ref user_agent) = configuration.user_agent {
1661        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1662    }
1663    if let Some(ref apikey) = configuration.api_key {
1664        let key = apikey.key.clone();
1665        let value = match apikey.prefix {
1666            Some(ref prefix) => format!("{} {}", prefix, key),
1667            None => key,
1668        };
1669        req_builder = req_builder.header("Authorization", value);
1670    };
1671
1672    let req = req_builder.build()?;
1673    let resp = configuration.client.execute(req).await?;
1674
1675    let status = resp.status();
1676    let content_type = resp
1677        .headers()
1678        .get("content-type")
1679        .and_then(|v| v.to_str().ok())
1680        .unwrap_or("application/octet-stream");
1681    let content_type = super::ContentType::from(content_type);
1682
1683    if !status.is_client_error() && !status.is_server_error() {
1684        let content = resp.text().await?;
1685        match content_type {
1686            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1687            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRecommendations200Response`"))),
1688            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetRecommendations200Response`")))),
1689        }
1690    } else {
1691        let content = resp.text().await?;
1692        let entity: Option<GetRecommendationsError> = serde_json::from_str(&content).ok();
1693        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1694    }
1695}
1696
1697/// The revenue estimate endpoint provides a company's projected quarterly and annual revenue figures based on analysts' estimates. This data is useful for users seeking insights into expected company performance, allowing them to compare forecasted sales with historical data or other companies' estimates.
1698pub async fn get_revenue_estimate(configuration: &configuration::Configuration, params: GetRevenueEstimateParams) -> Result<models::GetRevenueEstimate200Response, Error<GetRevenueEstimateError>> {
1699    // Extract parameters from params struct
1700    let p_query_symbol = params.symbol;
1701    let p_query_figi = params.figi;
1702    let p_query_isin = params.isin;
1703    let p_query_cusip = params.cusip;
1704    let p_query_country = params.country;
1705    let p_query_exchange = params.exchange;
1706    let p_query_dp = params.dp;
1707
1708    let uri_str = format!("{}/revenue_estimate", configuration.base_path);
1709    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1710
1711    if let Some(ref param_value) = p_query_symbol {
1712        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1713    }
1714    if let Some(ref param_value) = p_query_figi {
1715        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1716    }
1717    if let Some(ref param_value) = p_query_isin {
1718        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1719    }
1720    if let Some(ref param_value) = p_query_cusip {
1721        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1722    }
1723    if let Some(ref param_value) = p_query_country {
1724        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1725    }
1726    if let Some(ref param_value) = p_query_exchange {
1727        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1728    }
1729    if let Some(ref param_value) = p_query_dp {
1730        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
1731    }
1732    if let Some(ref user_agent) = configuration.user_agent {
1733        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1734    }
1735    if let Some(ref apikey) = configuration.api_key {
1736        let key = apikey.key.clone();
1737        let value = match apikey.prefix {
1738            Some(ref prefix) => format!("{} {}", prefix, key),
1739            None => key,
1740        };
1741        req_builder = req_builder.header("Authorization", value);
1742    };
1743
1744    let req = req_builder.build()?;
1745    let resp = configuration.client.execute(req).await?;
1746
1747    let status = resp.status();
1748    let content_type = resp
1749        .headers()
1750        .get("content-type")
1751        .and_then(|v| v.to_str().ok())
1752        .unwrap_or("application/octet-stream");
1753    let content_type = super::ContentType::from(content_type);
1754
1755    if !status.is_client_error() && !status.is_server_error() {
1756        let content = resp.text().await?;
1757        match content_type {
1758            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1759            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRevenueEstimate200Response`"))),
1760            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetRevenueEstimate200Response`")))),
1761        }
1762    } else {
1763        let content = resp.text().await?;
1764        let entity: Option<GetRevenueEstimateError> = serde_json::from_str(&content).ok();
1765        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1766    }
1767}
1768