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)]
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        
71        self
72    }
73    /// Filter by financial instrument global identifier (FIGI)
74    pub fn figi(mut self, figi: impl Into<String>) -> Self {
75        self.figi = Some(figi.into());
76        
77        self
78    }
79    /// Filter by international securities identification number (ISIN)
80    pub fn isin(mut self, isin: impl Into<String>) -> Self {
81        self.isin = Some(isin.into());
82        
83        self
84    }
85    /// 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
86    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
87        self.cusip = Some(cusip.into());
88        
89        self
90    }
91    /// Filter by exchange name
92    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
93        self.exchange = Some(exchange.into());
94        
95        self
96    }
97    /// Filter by rating change action
98    pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
99        self.rating_change = Some(rating_change.into());
100        
101        self
102    }
103    /// Number of records in response
104    pub fn outputsize(mut self, outputsize: i64) -> Self {
105        
106        self.outputsize = Some(outputsize);
107        
108        self
109    }
110    /// Filter by country name or alpha code, e.g., `United States` or `US`
111    pub fn country(mut self, country: impl Into<String>) -> Self {
112        self.country = Some(country.into());
113        
114        self
115    }
116
117    /// Build the parameter struct
118    pub fn build(self) -> GetAnalystRatingsLightParams {
119        GetAnalystRatingsLightParams {
120            symbol: self.symbol,
121            figi: self.figi,
122            isin: self.isin,
123            cusip: self.cusip,
124            exchange: self.exchange,
125            rating_change: self.rating_change,
126            outputsize: self.outputsize,
127            country: self.country
128        }
129    }
130}
131
132/// struct for passing parameters to the method [`get_analyst_ratings_us_equities`]
133#[derive(Clone, Debug, Default)]
134pub struct GetAnalystRatingsUsEquitiesParams {
135    /// Filter by symbol
136    pub symbol: Option<String>,
137    /// Filter by financial instrument global identifier (FIGI)
138    pub figi: Option<String>,
139    /// Filter by international securities identification number (ISIN)
140    pub isin: Option<String>,
141    /// 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
142    pub cusip: Option<String>,
143    /// Filter by exchange name
144    pub exchange: Option<String>,
145    /// Filter by rating change action
146    pub rating_change: Option<String>,
147    /// Number of records in response
148    pub outputsize: Option<i64>
149}
150
151impl GetAnalystRatingsUsEquitiesParams {
152    /// Create a new builder for this parameter struct
153    pub fn builder() -> GetAnalystRatingsUsEquitiesParamsBuilder {
154        GetAnalystRatingsUsEquitiesParamsBuilder::default()
155    }
156}
157
158/// Builder for [`GetAnalystRatingsUsEquitiesParams`]
159#[derive(Clone, Debug, Default)]
160pub struct GetAnalystRatingsUsEquitiesParamsBuilder {
161    /// Filter by symbol
162    symbol: Option<String>,
163    /// Filter by financial instrument global identifier (FIGI)
164    figi: Option<String>,
165    /// Filter by international securities identification number (ISIN)
166    isin: Option<String>,
167    /// 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
168    cusip: Option<String>,
169    /// Filter by exchange name
170    exchange: Option<String>,
171    /// Filter by rating change action
172    rating_change: Option<String>,
173    /// Number of records in response
174    outputsize: Option<i64>
175}
176
177impl GetAnalystRatingsUsEquitiesParamsBuilder {
178    /// Filter by symbol
179    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
180        self.symbol = Some(symbol.into());
181        
182        self
183    }
184    /// Filter by financial instrument global identifier (FIGI)
185    pub fn figi(mut self, figi: impl Into<String>) -> Self {
186        self.figi = Some(figi.into());
187        
188        self
189    }
190    /// Filter by international securities identification number (ISIN)
191    pub fn isin(mut self, isin: impl Into<String>) -> Self {
192        self.isin = Some(isin.into());
193        
194        self
195    }
196    /// 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
197    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
198        self.cusip = Some(cusip.into());
199        
200        self
201    }
202    /// Filter by exchange name
203    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
204        self.exchange = Some(exchange.into());
205        
206        self
207    }
208    /// Filter by rating change action
209    pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
210        self.rating_change = Some(rating_change.into());
211        
212        self
213    }
214    /// Number of records in response
215    pub fn outputsize(mut self, outputsize: i64) -> Self {
216        
217        self.outputsize = Some(outputsize);
218        
219        self
220    }
221
222    /// Build the parameter struct
223    pub fn build(self) -> GetAnalystRatingsUsEquitiesParams {
224        GetAnalystRatingsUsEquitiesParams {
225            symbol: self.symbol,
226            figi: self.figi,
227            isin: self.isin,
228            cusip: self.cusip,
229            exchange: self.exchange,
230            rating_change: self.rating_change,
231            outputsize: self.outputsize
232        }
233    }
234}
235
236/// struct for passing parameters to the method [`get_earnings_estimate`]
237#[derive(Clone, Debug, Default)]
238pub struct GetEarningsEstimateParams {
239    /// Filter by symbol
240    pub symbol: Option<String>,
241    /// The FIGI of an instrument for which data is requested
242    pub figi: Option<String>,
243    /// Filter by international securities identification number (ISIN)
244    pub isin: Option<String>,
245    /// 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
246    pub cusip: Option<String>,
247    /// The country where the instrument is traded, e.g., `United States` or `US`
248    pub country: Option<String>,
249    /// Exchange where instrument is traded
250    pub exchange: Option<String>
251}
252
253impl GetEarningsEstimateParams {
254    /// Create a new builder for this parameter struct
255    pub fn builder() -> GetEarningsEstimateParamsBuilder {
256        GetEarningsEstimateParamsBuilder::default()
257    }
258}
259
260/// Builder for [`GetEarningsEstimateParams`]
261#[derive(Clone, Debug, Default)]
262pub struct GetEarningsEstimateParamsBuilder {
263    /// Filter by symbol
264    symbol: Option<String>,
265    /// The FIGI of an instrument for which data is requested
266    figi: Option<String>,
267    /// Filter by international securities identification number (ISIN)
268    isin: Option<String>,
269    /// 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
270    cusip: Option<String>,
271    /// The country where the instrument is traded, e.g., `United States` or `US`
272    country: Option<String>,
273    /// Exchange where instrument is traded
274    exchange: Option<String>
275}
276
277impl GetEarningsEstimateParamsBuilder {
278    /// Filter by symbol
279    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
280        self.symbol = Some(symbol.into());
281        
282        self
283    }
284    /// The FIGI of an instrument for which data is requested
285    pub fn figi(mut self, figi: impl Into<String>) -> Self {
286        self.figi = Some(figi.into());
287        
288        self
289    }
290    /// Filter by international securities identification number (ISIN)
291    pub fn isin(mut self, isin: impl Into<String>) -> Self {
292        self.isin = Some(isin.into());
293        
294        self
295    }
296    /// 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
297    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
298        self.cusip = Some(cusip.into());
299        
300        self
301    }
302    /// The country where the instrument is traded, e.g., `United States` or `US`
303    pub fn country(mut self, country: impl Into<String>) -> Self {
304        self.country = Some(country.into());
305        
306        self
307    }
308    /// Exchange where instrument is traded
309    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
310        self.exchange = Some(exchange.into());
311        
312        self
313    }
314
315    /// Build the parameter struct
316    pub fn build(self) -> GetEarningsEstimateParams {
317        GetEarningsEstimateParams {
318            symbol: self.symbol,
319            figi: self.figi,
320            isin: self.isin,
321            cusip: self.cusip,
322            country: self.country,
323            exchange: self.exchange
324        }
325    }
326}
327
328/// struct for passing parameters to the method [`get_edgar_filings_archive`]
329#[derive(Clone, Debug, Default)]
330pub struct GetEdgarFilingsArchiveParams {
331    /// The ticker symbol of an instrument for which data is requested
332    pub symbol: Option<String>,
333    /// Filter by financial instrument global identifier (FIGI)
334    pub figi: Option<String>,
335    /// Filter by international securities identification number (ISIN)
336    pub isin: Option<String>,
337    /// 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
338    pub cusip: Option<String>,
339    /// Filter by exchange name
340    pub exchange: Option<String>,
341    /// Filter by market identifier code (MIC) under ISO 10383 standard
342    pub mic_code: Option<String>,
343    /// Filter by country name or alpha code, e.g., `United States` or `US`
344    pub country: Option<String>,
345    /// Filter by form types, example `8-K`, `EX-1.1`
346    pub form_type: Option<String>,
347    /// Filter by filled time from
348    pub filled_from: Option<String>,
349    /// Filter by filled time to
350    pub filled_to: Option<String>,
351    /// Page number
352    pub page: Option<i64>,
353    /// Number of records in response
354    pub page_size: Option<i64>
355}
356
357impl GetEdgarFilingsArchiveParams {
358    /// Create a new builder for this parameter struct
359    pub fn builder() -> GetEdgarFilingsArchiveParamsBuilder {
360        GetEdgarFilingsArchiveParamsBuilder::default()
361    }
362}
363
364/// Builder for [`GetEdgarFilingsArchiveParams`]
365#[derive(Clone, Debug, Default)]
366pub struct GetEdgarFilingsArchiveParamsBuilder {
367    /// The ticker symbol of an instrument for which data is requested
368    symbol: Option<String>,
369    /// Filter by financial instrument global identifier (FIGI)
370    figi: Option<String>,
371    /// Filter by international securities identification number (ISIN)
372    isin: Option<String>,
373    /// 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
374    cusip: Option<String>,
375    /// Filter by exchange name
376    exchange: Option<String>,
377    /// Filter by market identifier code (MIC) under ISO 10383 standard
378    mic_code: Option<String>,
379    /// Filter by country name or alpha code, e.g., `United States` or `US`
380    country: Option<String>,
381    /// Filter by form types, example `8-K`, `EX-1.1`
382    form_type: Option<String>,
383    /// Filter by filled time from
384    filled_from: Option<String>,
385    /// Filter by filled time to
386    filled_to: Option<String>,
387    /// Page number
388    page: Option<i64>,
389    /// Number of records in response
390    page_size: Option<i64>
391}
392
393impl GetEdgarFilingsArchiveParamsBuilder {
394    /// The ticker symbol of an instrument for which data is requested
395    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
396        self.symbol = Some(symbol.into());
397        
398        self
399    }
400    /// Filter by financial instrument global identifier (FIGI)
401    pub fn figi(mut self, figi: impl Into<String>) -> Self {
402        self.figi = Some(figi.into());
403        
404        self
405    }
406    /// Filter by international securities identification number (ISIN)
407    pub fn isin(mut self, isin: impl Into<String>) -> Self {
408        self.isin = Some(isin.into());
409        
410        self
411    }
412    /// 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
413    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
414        self.cusip = Some(cusip.into());
415        
416        self
417    }
418    /// Filter by exchange name
419    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
420        self.exchange = Some(exchange.into());
421        
422        self
423    }
424    /// Filter by market identifier code (MIC) under ISO 10383 standard
425    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
426        self.mic_code = Some(mic_code.into());
427        
428        self
429    }
430    /// Filter by country name or alpha code, e.g., `United States` or `US`
431    pub fn country(mut self, country: impl Into<String>) -> Self {
432        self.country = Some(country.into());
433        
434        self
435    }
436    /// Filter by form types, example `8-K`, `EX-1.1`
437    pub fn form_type(mut self, form_type: impl Into<String>) -> Self {
438        self.form_type = Some(form_type.into());
439        
440        self
441    }
442    /// Filter by filled time from
443    pub fn filled_from(mut self, filled_from: impl Into<String>) -> Self {
444        self.filled_from = Some(filled_from.into());
445        
446        self
447    }
448    /// Filter by filled time to
449    pub fn filled_to(mut self, filled_to: impl Into<String>) -> Self {
450        self.filled_to = Some(filled_to.into());
451        
452        self
453    }
454    /// Page number
455    pub fn page(mut self, page: i64) -> Self {
456        
457        self.page = Some(page);
458        
459        self
460    }
461    /// Number of records in response
462    pub fn page_size(mut self, page_size: i64) -> Self {
463        
464        self.page_size = Some(page_size);
465        
466        self
467    }
468
469    /// Build the parameter struct
470    pub fn build(self) -> GetEdgarFilingsArchiveParams {
471        GetEdgarFilingsArchiveParams {
472            symbol: self.symbol,
473            figi: self.figi,
474            isin: self.isin,
475            cusip: self.cusip,
476            exchange: self.exchange,
477            mic_code: self.mic_code,
478            country: self.country,
479            form_type: self.form_type,
480            filled_from: self.filled_from,
481            filled_to: self.filled_to,
482            page: self.page,
483            page_size: self.page_size
484        }
485    }
486}
487
488/// struct for passing parameters to the method [`get_eps_revisions`]
489#[derive(Clone, Debug, Default)]
490pub struct GetEpsRevisionsParams {
491    /// Filter by symbol
492    pub symbol: Option<String>,
493    /// Filter by financial instrument global identifier (FIGI)
494    pub figi: Option<String>,
495    /// Filter by international securities identification number (ISIN)
496    pub isin: Option<String>,
497    /// 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
498    pub cusip: Option<String>,
499    /// Filter by country name or alpha code, e.g., `United States` or `US`
500    pub country: Option<String>,
501    /// Filter by exchange name
502    pub exchange: Option<String>
503}
504
505impl GetEpsRevisionsParams {
506    /// Create a new builder for this parameter struct
507    pub fn builder() -> GetEpsRevisionsParamsBuilder {
508        GetEpsRevisionsParamsBuilder::default()
509    }
510}
511
512/// Builder for [`GetEpsRevisionsParams`]
513#[derive(Clone, Debug, Default)]
514pub struct GetEpsRevisionsParamsBuilder {
515    /// Filter by symbol
516    symbol: Option<String>,
517    /// Filter by financial instrument global identifier (FIGI)
518    figi: Option<String>,
519    /// Filter by international securities identification number (ISIN)
520    isin: Option<String>,
521    /// 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
522    cusip: Option<String>,
523    /// Filter by country name or alpha code, e.g., `United States` or `US`
524    country: Option<String>,
525    /// Filter by exchange name
526    exchange: Option<String>
527}
528
529impl GetEpsRevisionsParamsBuilder {
530    /// Filter by symbol
531    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
532        self.symbol = Some(symbol.into());
533        
534        self
535    }
536    /// Filter by financial instrument global identifier (FIGI)
537    pub fn figi(mut self, figi: impl Into<String>) -> Self {
538        self.figi = Some(figi.into());
539        
540        self
541    }
542    /// Filter by international securities identification number (ISIN)
543    pub fn isin(mut self, isin: impl Into<String>) -> Self {
544        self.isin = Some(isin.into());
545        
546        self
547    }
548    /// 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
549    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
550        self.cusip = Some(cusip.into());
551        
552        self
553    }
554    /// Filter by country name or alpha code, e.g., `United States` or `US`
555    pub fn country(mut self, country: impl Into<String>) -> Self {
556        self.country = Some(country.into());
557        
558        self
559    }
560    /// Filter by exchange name
561    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
562        self.exchange = Some(exchange.into());
563        
564        self
565    }
566
567    /// Build the parameter struct
568    pub fn build(self) -> GetEpsRevisionsParams {
569        GetEpsRevisionsParams {
570            symbol: self.symbol,
571            figi: self.figi,
572            isin: self.isin,
573            cusip: self.cusip,
574            country: self.country,
575            exchange: self.exchange
576        }
577    }
578}
579
580/// struct for passing parameters to the method [`get_eps_trend`]
581#[derive(Clone, Debug, Default)]
582pub struct GetEpsTrendParams {
583    /// Filter by symbol
584    pub symbol: Option<String>,
585    /// Filter by financial instrument global identifier (FIGI)
586    pub figi: Option<String>,
587    /// Filter by international securities identification number (ISIN)
588    pub isin: Option<String>,
589    /// 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
590    pub cusip: Option<String>,
591    /// Filter by country name or alpha code, e.g., `United States` or `US`
592    pub country: Option<String>,
593    /// Filter by exchange name
594    pub exchange: Option<String>
595}
596
597impl GetEpsTrendParams {
598    /// Create a new builder for this parameter struct
599    pub fn builder() -> GetEpsTrendParamsBuilder {
600        GetEpsTrendParamsBuilder::default()
601    }
602}
603
604/// Builder for [`GetEpsTrendParams`]
605#[derive(Clone, Debug, Default)]
606pub struct GetEpsTrendParamsBuilder {
607    /// Filter by symbol
608    symbol: Option<String>,
609    /// Filter by financial instrument global identifier (FIGI)
610    figi: Option<String>,
611    /// Filter by international securities identification number (ISIN)
612    isin: Option<String>,
613    /// 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
614    cusip: Option<String>,
615    /// Filter by country name or alpha code, e.g., `United States` or `US`
616    country: Option<String>,
617    /// Filter by exchange name
618    exchange: Option<String>
619}
620
621impl GetEpsTrendParamsBuilder {
622    /// Filter by symbol
623    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
624        self.symbol = Some(symbol.into());
625        
626        self
627    }
628    /// Filter by financial instrument global identifier (FIGI)
629    pub fn figi(mut self, figi: impl Into<String>) -> Self {
630        self.figi = Some(figi.into());
631        
632        self
633    }
634    /// Filter by international securities identification number (ISIN)
635    pub fn isin(mut self, isin: impl Into<String>) -> Self {
636        self.isin = Some(isin.into());
637        
638        self
639    }
640    /// 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
641    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
642        self.cusip = Some(cusip.into());
643        
644        self
645    }
646    /// Filter by country name or alpha code, e.g., `United States` or `US`
647    pub fn country(mut self, country: impl Into<String>) -> Self {
648        self.country = Some(country.into());
649        
650        self
651    }
652    /// Filter by exchange name
653    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
654        self.exchange = Some(exchange.into());
655        
656        self
657    }
658
659    /// Build the parameter struct
660    pub fn build(self) -> GetEpsTrendParams {
661        GetEpsTrendParams {
662            symbol: self.symbol,
663            figi: self.figi,
664            isin: self.isin,
665            cusip: self.cusip,
666            country: self.country,
667            exchange: self.exchange
668        }
669    }
670}
671
672/// struct for passing parameters to the method [`get_growth_estimates`]
673#[derive(Clone, Debug, Default)]
674pub struct GetGrowthEstimatesParams {
675    /// Filter by symbol
676    pub symbol: Option<String>,
677    /// The FIGI of an instrument for which data is requested
678    pub figi: Option<String>,
679    /// Filter by international securities identification number (ISIN)
680    pub isin: Option<String>,
681    /// 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
682    pub cusip: Option<String>,
683    /// The country where the instrument is traded, e.g., `United States` or `US`
684    pub country: Option<String>,
685    /// Exchange where instrument is traded
686    pub exchange: Option<String>
687}
688
689impl GetGrowthEstimatesParams {
690    /// Create a new builder for this parameter struct
691    pub fn builder() -> GetGrowthEstimatesParamsBuilder {
692        GetGrowthEstimatesParamsBuilder::default()
693    }
694}
695
696/// Builder for [`GetGrowthEstimatesParams`]
697#[derive(Clone, Debug, Default)]
698pub struct GetGrowthEstimatesParamsBuilder {
699    /// Filter by symbol
700    symbol: Option<String>,
701    /// The FIGI of an instrument for which data is requested
702    figi: Option<String>,
703    /// Filter by international securities identification number (ISIN)
704    isin: Option<String>,
705    /// 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
706    cusip: Option<String>,
707    /// The country where the instrument is traded, e.g., `United States` or `US`
708    country: Option<String>,
709    /// Exchange where instrument is traded
710    exchange: Option<String>
711}
712
713impl GetGrowthEstimatesParamsBuilder {
714    /// Filter by symbol
715    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
716        self.symbol = Some(symbol.into());
717        
718        self
719    }
720    /// The FIGI of an instrument for which data is requested
721    pub fn figi(mut self, figi: impl Into<String>) -> Self {
722        self.figi = Some(figi.into());
723        
724        self
725    }
726    /// Filter by international securities identification number (ISIN)
727    pub fn isin(mut self, isin: impl Into<String>) -> Self {
728        self.isin = Some(isin.into());
729        
730        self
731    }
732    /// 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
733    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
734        self.cusip = Some(cusip.into());
735        
736        self
737    }
738    /// The country where the instrument is traded, e.g., `United States` or `US`
739    pub fn country(mut self, country: impl Into<String>) -> Self {
740        self.country = Some(country.into());
741        
742        self
743    }
744    /// Exchange where instrument is traded
745    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
746        self.exchange = Some(exchange.into());
747        
748        self
749    }
750
751    /// Build the parameter struct
752    pub fn build(self) -> GetGrowthEstimatesParams {
753        GetGrowthEstimatesParams {
754            symbol: self.symbol,
755            figi: self.figi,
756            isin: self.isin,
757            cusip: self.cusip,
758            country: self.country,
759            exchange: self.exchange
760        }
761    }
762}
763
764/// struct for passing parameters to the method [`get_price_target`]
765#[derive(Clone, Debug, Default)]
766pub struct GetPriceTargetParams {
767    /// Filter by symbol
768    pub symbol: Option<String>,
769    /// Filter by financial instrument global identifier (FIGI)
770    pub figi: Option<String>,
771    /// Filter by international securities identification number (ISIN)
772    pub isin: Option<String>,
773    /// 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
774    pub cusip: Option<String>,
775    /// Filter by country name or alpha code, e.g., `United States` or `US`
776    pub country: Option<String>,
777    /// Filter by exchange name
778    pub exchange: Option<String>
779}
780
781impl GetPriceTargetParams {
782    /// Create a new builder for this parameter struct
783    pub fn builder() -> GetPriceTargetParamsBuilder {
784        GetPriceTargetParamsBuilder::default()
785    }
786}
787
788/// Builder for [`GetPriceTargetParams`]
789#[derive(Clone, Debug, Default)]
790pub struct GetPriceTargetParamsBuilder {
791    /// Filter by symbol
792    symbol: Option<String>,
793    /// Filter by financial instrument global identifier (FIGI)
794    figi: Option<String>,
795    /// Filter by international securities identification number (ISIN)
796    isin: Option<String>,
797    /// 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
798    cusip: Option<String>,
799    /// Filter by country name or alpha code, e.g., `United States` or `US`
800    country: Option<String>,
801    /// Filter by exchange name
802    exchange: Option<String>
803}
804
805impl GetPriceTargetParamsBuilder {
806    /// Filter by symbol
807    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
808        self.symbol = Some(symbol.into());
809        
810        self
811    }
812    /// Filter by financial instrument global identifier (FIGI)
813    pub fn figi(mut self, figi: impl Into<String>) -> Self {
814        self.figi = Some(figi.into());
815        
816        self
817    }
818    /// Filter by international securities identification number (ISIN)
819    pub fn isin(mut self, isin: impl Into<String>) -> Self {
820        self.isin = Some(isin.into());
821        
822        self
823    }
824    /// 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
825    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
826        self.cusip = Some(cusip.into());
827        
828        self
829    }
830    /// Filter by country name or alpha code, e.g., `United States` or `US`
831    pub fn country(mut self, country: impl Into<String>) -> Self {
832        self.country = Some(country.into());
833        
834        self
835    }
836    /// Filter by exchange name
837    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
838        self.exchange = Some(exchange.into());
839        
840        self
841    }
842
843    /// Build the parameter struct
844    pub fn build(self) -> GetPriceTargetParams {
845        GetPriceTargetParams {
846            symbol: self.symbol,
847            figi: self.figi,
848            isin: self.isin,
849            cusip: self.cusip,
850            country: self.country,
851            exchange: self.exchange
852        }
853    }
854}
855
856/// struct for passing parameters to the method [`get_recommendations`]
857#[derive(Clone, Debug, Default)]
858pub struct GetRecommendationsParams {
859    /// Filter by symbol
860    pub symbol: Option<String>,
861    /// The FIGI of an instrument for which data is requested
862    pub figi: Option<String>,
863    /// Filter by international securities identification number (ISIN)
864    pub isin: Option<String>,
865    /// 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
866    pub cusip: Option<String>,
867    /// The country where the instrument is traded, e.g., `United States` or `US`
868    pub country: Option<String>,
869    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
870    pub exchange: Option<String>
871}
872
873impl GetRecommendationsParams {
874    /// Create a new builder for this parameter struct
875    pub fn builder() -> GetRecommendationsParamsBuilder {
876        GetRecommendationsParamsBuilder::default()
877    }
878}
879
880/// Builder for [`GetRecommendationsParams`]
881#[derive(Clone, Debug, Default)]
882pub struct GetRecommendationsParamsBuilder {
883    /// Filter by symbol
884    symbol: Option<String>,
885    /// The FIGI of an instrument for which data is requested
886    figi: Option<String>,
887    /// Filter by international securities identification number (ISIN)
888    isin: Option<String>,
889    /// 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
890    cusip: Option<String>,
891    /// The country where the instrument is traded, e.g., `United States` or `US`
892    country: Option<String>,
893    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
894    exchange: Option<String>
895}
896
897impl GetRecommendationsParamsBuilder {
898    /// Filter by symbol
899    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
900        self.symbol = Some(symbol.into());
901        
902        self
903    }
904    /// The FIGI of an instrument for which data is requested
905    pub fn figi(mut self, figi: impl Into<String>) -> Self {
906        self.figi = Some(figi.into());
907        
908        self
909    }
910    /// Filter by international securities identification number (ISIN)
911    pub fn isin(mut self, isin: impl Into<String>) -> Self {
912        self.isin = Some(isin.into());
913        
914        self
915    }
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    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
918        self.cusip = Some(cusip.into());
919        
920        self
921    }
922    /// The country where the instrument is traded, e.g., `United States` or `US`
923    pub fn country(mut self, country: impl Into<String>) -> Self {
924        self.country = Some(country.into());
925        
926        self
927    }
928    /// The exchange name where the instrument is traded, e.g., `Nasdaq`, `NSE`.
929    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
930        self.exchange = Some(exchange.into());
931        
932        self
933    }
934
935    /// Build the parameter struct
936    pub fn build(self) -> GetRecommendationsParams {
937        GetRecommendationsParams {
938            symbol: self.symbol,
939            figi: self.figi,
940            isin: self.isin,
941            cusip: self.cusip,
942            country: self.country,
943            exchange: self.exchange
944        }
945    }
946}
947
948/// struct for passing parameters to the method [`get_revenue_estimate`]
949#[derive(Clone, Debug, Default)]
950pub struct GetRevenueEstimateParams {
951    /// Filter by symbol
952    pub symbol: Option<String>,
953    /// Filter by financial instrument global identifier (FIGI)
954    pub figi: Option<String>,
955    /// Filter by international securities identification number (ISIN)
956    pub isin: Option<String>,
957    /// 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
958    pub cusip: Option<String>,
959    /// Filter by country name or alpha code, e.g., `United States` or `US`
960    pub country: Option<String>,
961    /// Filter by exchange name
962    pub exchange: Option<String>,
963    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
964    pub dp: Option<i64>
965}
966
967impl GetRevenueEstimateParams {
968    /// Create a new builder for this parameter struct
969    pub fn builder() -> GetRevenueEstimateParamsBuilder {
970        GetRevenueEstimateParamsBuilder::default()
971    }
972}
973
974/// Builder for [`GetRevenueEstimateParams`]
975#[derive(Clone, Debug, Default)]
976pub struct GetRevenueEstimateParamsBuilder {
977    /// Filter by symbol
978    symbol: Option<String>,
979    /// Filter by financial instrument global identifier (FIGI)
980    figi: Option<String>,
981    /// Filter by international securities identification number (ISIN)
982    isin: Option<String>,
983    /// 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
984    cusip: Option<String>,
985    /// Filter by country name or alpha code, e.g., `United States` or `US`
986    country: Option<String>,
987    /// Filter by exchange name
988    exchange: Option<String>,
989    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
990    dp: Option<i64>
991}
992
993impl GetRevenueEstimateParamsBuilder {
994    /// Filter by symbol
995    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
996        self.symbol = Some(symbol.into());
997        
998        self
999    }
1000    /// Filter by financial instrument global identifier (FIGI)
1001    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1002        self.figi = Some(figi.into());
1003        
1004        self
1005    }
1006    /// Filter by international securities identification number (ISIN)
1007    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1008        self.isin = Some(isin.into());
1009        
1010        self
1011    }
1012    /// 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
1013    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1014        self.cusip = Some(cusip.into());
1015        
1016        self
1017    }
1018    /// Filter by country name or alpha code, e.g., `United States` or `US`
1019    pub fn country(mut self, country: impl Into<String>) -> Self {
1020        self.country = Some(country.into());
1021        
1022        self
1023    }
1024    /// Filter by exchange name
1025    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1026        self.exchange = Some(exchange.into());
1027        
1028        self
1029    }
1030    /// Number of decimal places for floating values. Should be in range [0,11] inclusive
1031    pub fn dp(mut self, dp: i64) -> Self {
1032        
1033        self.dp = Some(dp);
1034        
1035        self
1036    }
1037
1038    /// Build the parameter struct
1039    pub fn build(self) -> GetRevenueEstimateParams {
1040        GetRevenueEstimateParams {
1041            symbol: self.symbol,
1042            figi: self.figi,
1043            isin: self.isin,
1044            cusip: self.cusip,
1045            country: self.country,
1046            exchange: self.exchange,
1047            dp: self.dp
1048        }
1049    }
1050}
1051
1052
1053/// struct for typed errors of method [`get_analyst_ratings_light`]
1054#[derive(Debug, Clone, Serialize, Deserialize)]
1055#[serde(untagged)]
1056pub enum GetAnalystRatingsLightError {
1057    UnknownValue(serde_json::Value),
1058}
1059
1060/// struct for typed errors of method [`get_analyst_ratings_us_equities`]
1061#[derive(Debug, Clone, Serialize, Deserialize)]
1062#[serde(untagged)]
1063pub enum GetAnalystRatingsUsEquitiesError {
1064    UnknownValue(serde_json::Value),
1065}
1066
1067/// struct for typed errors of method [`get_earnings_estimate`]
1068#[derive(Debug, Clone, Serialize, Deserialize)]
1069#[serde(untagged)]
1070pub enum GetEarningsEstimateError {
1071    UnknownValue(serde_json::Value),
1072}
1073
1074/// struct for typed errors of method [`get_edgar_filings_archive`]
1075#[derive(Debug, Clone, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum GetEdgarFilingsArchiveError {
1078    UnknownValue(serde_json::Value),
1079}
1080
1081/// struct for typed errors of method [`get_eps_revisions`]
1082#[derive(Debug, Clone, Serialize, Deserialize)]
1083#[serde(untagged)]
1084pub enum GetEpsRevisionsError {
1085    UnknownValue(serde_json::Value),
1086}
1087
1088/// struct for typed errors of method [`get_eps_trend`]
1089#[derive(Debug, Clone, Serialize, Deserialize)]
1090#[serde(untagged)]
1091pub enum GetEpsTrendError {
1092    UnknownValue(serde_json::Value),
1093}
1094
1095/// struct for typed errors of method [`get_growth_estimates`]
1096#[derive(Debug, Clone, Serialize, Deserialize)]
1097#[serde(untagged)]
1098pub enum GetGrowthEstimatesError {
1099    UnknownValue(serde_json::Value),
1100}
1101
1102/// struct for typed errors of method [`get_price_target`]
1103#[derive(Debug, Clone, Serialize, Deserialize)]
1104#[serde(untagged)]
1105pub enum GetPriceTargetError {
1106    UnknownValue(serde_json::Value),
1107}
1108
1109/// struct for typed errors of method [`get_recommendations`]
1110#[derive(Debug, Clone, Serialize, Deserialize)]
1111#[serde(untagged)]
1112pub enum GetRecommendationsError {
1113    UnknownValue(serde_json::Value),
1114}
1115
1116/// struct for typed errors of method [`get_revenue_estimate`]
1117#[derive(Debug, Clone, Serialize, Deserialize)]
1118#[serde(untagged)]
1119pub enum GetRevenueEstimateError {
1120    UnknownValue(serde_json::Value),
1121}
1122
1123
1124/// 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.
1125pub async fn get_analyst_ratings_light(configuration: &configuration::Configuration, params: GetAnalystRatingsLightParams) -> Result<models::GetAnalystRatingsLight200Response, Error<GetAnalystRatingsLightError>> {
1126    // Extract parameters from params struct
1127    let p_query_symbol = params.symbol;
1128    let p_query_figi = params.figi;
1129    let p_query_isin = params.isin;
1130    let p_query_cusip = params.cusip;
1131    let p_query_exchange = params.exchange;
1132    let p_query_rating_change = params.rating_change;
1133    let p_query_outputsize = params.outputsize;
1134    let p_query_country = params.country;
1135
1136    let uri_str = format!("{}/analyst_ratings/light", 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 param_value) = p_query_country {
1161        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1162    }
1163    if let Some(ref user_agent) = configuration.user_agent {
1164        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1165    }
1166    if let Some(ref apikey) = configuration.api_key {
1167        let key = apikey.key.clone();
1168        let value = match apikey.prefix {
1169            Some(ref prefix) => format!("{} {}", prefix, key),
1170            None => key,
1171        };
1172        req_builder = req_builder.header("Authorization", value);
1173    };
1174
1175    let req = req_builder.build()?;
1176    let resp = configuration.client.execute(req).await?;
1177
1178    let status = resp.status();
1179    let content_type = resp
1180        .headers()
1181        .get("content-type")
1182        .and_then(|v| v.to_str().ok())
1183        .unwrap_or("application/octet-stream");
1184    let content_type = super::ContentType::from(content_type);
1185
1186    if !status.is_client_error() && !status.is_server_error() {
1187        let content = resp.text().await?;
1188        match content_type {
1189            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1190            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsLight200Response`"))),
1191            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`")))),
1192        }
1193    } else {
1194        let content = resp.text().await?;
1195        let entity: Option<GetAnalystRatingsLightError> = serde_json::from_str(&content).ok();
1196        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1197    }
1198}
1199
1200/// 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.
1201pub async fn get_analyst_ratings_us_equities(configuration: &configuration::Configuration, params: GetAnalystRatingsUsEquitiesParams) -> Result<models::GetAnalystRatingsUsEquities200Response, Error<GetAnalystRatingsUsEquitiesError>> {
1202    // Extract parameters from params struct
1203    let p_query_symbol = params.symbol;
1204    let p_query_figi = params.figi;
1205    let p_query_isin = params.isin;
1206    let p_query_cusip = params.cusip;
1207    let p_query_exchange = params.exchange;
1208    let p_query_rating_change = params.rating_change;
1209    let p_query_outputsize = params.outputsize;
1210
1211    let uri_str = format!("{}/analyst_ratings/us_equities", configuration.base_path);
1212    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1213
1214    if let Some(ref param_value) = p_query_symbol {
1215        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1216    }
1217    if let Some(ref param_value) = p_query_figi {
1218        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1219    }
1220    if let Some(ref param_value) = p_query_isin {
1221        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1222    }
1223    if let Some(ref param_value) = p_query_cusip {
1224        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1225    }
1226    if let Some(ref param_value) = p_query_exchange {
1227        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1228    }
1229    if let Some(ref param_value) = p_query_rating_change {
1230        req_builder = req_builder.query(&[("rating_change", &serde_json::to_string(param_value)?)]);
1231    }
1232    if let Some(ref param_value) = p_query_outputsize {
1233        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
1234    }
1235    if let Some(ref user_agent) = configuration.user_agent {
1236        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1237    }
1238    if let Some(ref apikey) = configuration.api_key {
1239        let key = apikey.key.clone();
1240        let value = match apikey.prefix {
1241            Some(ref prefix) => format!("{} {}", prefix, key),
1242            None => key,
1243        };
1244        req_builder = req_builder.header("Authorization", value);
1245    };
1246
1247    let req = req_builder.build()?;
1248    let resp = configuration.client.execute(req).await?;
1249
1250    let status = resp.status();
1251    let content_type = resp
1252        .headers()
1253        .get("content-type")
1254        .and_then(|v| v.to_str().ok())
1255        .unwrap_or("application/octet-stream");
1256    let content_type = super::ContentType::from(content_type);
1257
1258    if !status.is_client_error() && !status.is_server_error() {
1259        let content = resp.text().await?;
1260        match content_type {
1261            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1262            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsUsEquities200Response`"))),
1263            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`")))),
1264        }
1265    } else {
1266        let content = resp.text().await?;
1267        let entity: Option<GetAnalystRatingsUsEquitiesError> = serde_json::from_str(&content).ok();
1268        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1269    }
1270}
1271
1272/// 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.
1273pub async fn get_earnings_estimate(configuration: &configuration::Configuration, params: GetEarningsEstimateParams) -> Result<models::GetEarningsEstimate200Response, Error<GetEarningsEstimateError>> {
1274    // Extract parameters from params struct
1275    let p_query_symbol = params.symbol;
1276    let p_query_figi = params.figi;
1277    let p_query_isin = params.isin;
1278    let p_query_cusip = params.cusip;
1279    let p_query_country = params.country;
1280    let p_query_exchange = params.exchange;
1281
1282    let uri_str = format!("{}/earnings_estimate", configuration.base_path);
1283    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1284
1285    if let Some(ref param_value) = p_query_symbol {
1286        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1287    }
1288    if let Some(ref param_value) = p_query_figi {
1289        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1290    }
1291    if let Some(ref param_value) = p_query_isin {
1292        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1293    }
1294    if let Some(ref param_value) = p_query_cusip {
1295        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1296    }
1297    if let Some(ref param_value) = p_query_country {
1298        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1299    }
1300    if let Some(ref param_value) = p_query_exchange {
1301        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1302    }
1303    if let Some(ref user_agent) = configuration.user_agent {
1304        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1305    }
1306    if let Some(ref apikey) = configuration.api_key {
1307        let key = apikey.key.clone();
1308        let value = match apikey.prefix {
1309            Some(ref prefix) => format!("{} {}", prefix, key),
1310            None => key,
1311        };
1312        req_builder = req_builder.header("Authorization", value);
1313    };
1314
1315    let req = req_builder.build()?;
1316    let resp = configuration.client.execute(req).await?;
1317
1318    let status = resp.status();
1319    let content_type = resp
1320        .headers()
1321        .get("content-type")
1322        .and_then(|v| v.to_str().ok())
1323        .unwrap_or("application/octet-stream");
1324    let content_type = super::ContentType::from(content_type);
1325
1326    if !status.is_client_error() && !status.is_server_error() {
1327        let content = resp.text().await?;
1328        match content_type {
1329            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1330            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEarningsEstimate200Response`"))),
1331            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`")))),
1332        }
1333    } else {
1334        let content = resp.text().await?;
1335        let entity: Option<GetEarningsEstimateError> = serde_json::from_str(&content).ok();
1336        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1337    }
1338}
1339
1340/// 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.
1341pub async fn get_edgar_filings_archive(configuration: &configuration::Configuration, params: GetEdgarFilingsArchiveParams) -> Result<models::GetEdgarFilingsArchive200Response, Error<GetEdgarFilingsArchiveError>> {
1342    // Extract parameters from params struct
1343    let p_query_symbol = params.symbol;
1344    let p_query_figi = params.figi;
1345    let p_query_isin = params.isin;
1346    let p_query_cusip = params.cusip;
1347    let p_query_exchange = params.exchange;
1348    let p_query_mic_code = params.mic_code;
1349    let p_query_country = params.country;
1350    let p_query_form_type = params.form_type;
1351    let p_query_filled_from = params.filled_from;
1352    let p_query_filled_to = params.filled_to;
1353    let p_query_page = params.page;
1354    let p_query_page_size = params.page_size;
1355
1356    let uri_str = format!("{}/edgar_filings/archive", configuration.base_path);
1357    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1358
1359    if let Some(ref param_value) = p_query_symbol {
1360        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1361    }
1362    if let Some(ref param_value) = p_query_figi {
1363        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1364    }
1365    if let Some(ref param_value) = p_query_isin {
1366        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1367    }
1368    if let Some(ref param_value) = p_query_cusip {
1369        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1370    }
1371    if let Some(ref param_value) = p_query_exchange {
1372        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1373    }
1374    if let Some(ref param_value) = p_query_mic_code {
1375        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
1376    }
1377    if let Some(ref param_value) = p_query_country {
1378        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1379    }
1380    if let Some(ref param_value) = p_query_form_type {
1381        req_builder = req_builder.query(&[("form_type", &param_value.to_string())]);
1382    }
1383    if let Some(ref param_value) = p_query_filled_from {
1384        req_builder = req_builder.query(&[("filled_from", &param_value.to_string())]);
1385    }
1386    if let Some(ref param_value) = p_query_filled_to {
1387        req_builder = req_builder.query(&[("filled_to", &param_value.to_string())]);
1388    }
1389    if let Some(ref param_value) = p_query_page {
1390        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1391    }
1392    if let Some(ref param_value) = p_query_page_size {
1393        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1394    }
1395    if let Some(ref user_agent) = configuration.user_agent {
1396        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1397    }
1398    if let Some(ref apikey) = configuration.api_key {
1399        let key = apikey.key.clone();
1400        let value = match apikey.prefix {
1401            Some(ref prefix) => format!("{} {}", prefix, key),
1402            None => key,
1403        };
1404        req_builder = req_builder.header("Authorization", value);
1405    };
1406
1407    let req = req_builder.build()?;
1408    let resp = configuration.client.execute(req).await?;
1409
1410    let status = resp.status();
1411    let content_type = resp
1412        .headers()
1413        .get("content-type")
1414        .and_then(|v| v.to_str().ok())
1415        .unwrap_or("application/octet-stream");
1416    let content_type = super::ContentType::from(content_type);
1417
1418    if !status.is_client_error() && !status.is_server_error() {
1419        let content = resp.text().await?;
1420        match content_type {
1421            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1422            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEdgarFilingsArchive200Response`"))),
1423            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`")))),
1424        }
1425    } else {
1426        let content = resp.text().await?;
1427        let entity: Option<GetEdgarFilingsArchiveError> = serde_json::from_str(&content).ok();
1428        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1429    }
1430}
1431
1432/// 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.
1433pub async fn get_eps_revisions(configuration: &configuration::Configuration, params: GetEpsRevisionsParams) -> Result<models::GetEpsRevisions200Response, Error<GetEpsRevisionsError>> {
1434    // Extract parameters from params struct
1435    let p_query_symbol = params.symbol;
1436    let p_query_figi = params.figi;
1437    let p_query_isin = params.isin;
1438    let p_query_cusip = params.cusip;
1439    let p_query_country = params.country;
1440    let p_query_exchange = params.exchange;
1441
1442    let uri_str = format!("{}/eps_revisions", configuration.base_path);
1443    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1444
1445    if let Some(ref param_value) = p_query_symbol {
1446        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1447    }
1448    if let Some(ref param_value) = p_query_figi {
1449        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1450    }
1451    if let Some(ref param_value) = p_query_isin {
1452        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1453    }
1454    if let Some(ref param_value) = p_query_cusip {
1455        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1456    }
1457    if let Some(ref param_value) = p_query_country {
1458        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1459    }
1460    if let Some(ref param_value) = p_query_exchange {
1461        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1462    }
1463    if let Some(ref user_agent) = configuration.user_agent {
1464        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1465    }
1466    if let Some(ref apikey) = configuration.api_key {
1467        let key = apikey.key.clone();
1468        let value = match apikey.prefix {
1469            Some(ref prefix) => format!("{} {}", prefix, key),
1470            None => key,
1471        };
1472        req_builder = req_builder.header("Authorization", value);
1473    };
1474
1475    let req = req_builder.build()?;
1476    let resp = configuration.client.execute(req).await?;
1477
1478    let status = resp.status();
1479    let content_type = resp
1480        .headers()
1481        .get("content-type")
1482        .and_then(|v| v.to_str().ok())
1483        .unwrap_or("application/octet-stream");
1484    let content_type = super::ContentType::from(content_type);
1485
1486    if !status.is_client_error() && !status.is_server_error() {
1487        let content = resp.text().await?;
1488        match content_type {
1489            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1490            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsRevisions200Response`"))),
1491            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`")))),
1492        }
1493    } else {
1494        let content = resp.text().await?;
1495        let entity: Option<GetEpsRevisionsError> = serde_json::from_str(&content).ok();
1496        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1497    }
1498}
1499
1500/// 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.
1501pub async fn get_eps_trend(configuration: &configuration::Configuration, params: GetEpsTrendParams) -> Result<models::GetEpsTrend200Response, Error<GetEpsTrendError>> {
1502    // Extract parameters from params struct
1503    let p_query_symbol = params.symbol;
1504    let p_query_figi = params.figi;
1505    let p_query_isin = params.isin;
1506    let p_query_cusip = params.cusip;
1507    let p_query_country = params.country;
1508    let p_query_exchange = params.exchange;
1509
1510    let uri_str = format!("{}/eps_trend", configuration.base_path);
1511    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1512
1513    if let Some(ref param_value) = p_query_symbol {
1514        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1515    }
1516    if let Some(ref param_value) = p_query_figi {
1517        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1518    }
1519    if let Some(ref param_value) = p_query_isin {
1520        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1521    }
1522    if let Some(ref param_value) = p_query_cusip {
1523        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1524    }
1525    if let Some(ref param_value) = p_query_country {
1526        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1527    }
1528    if let Some(ref param_value) = p_query_exchange {
1529        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1530    }
1531    if let Some(ref user_agent) = configuration.user_agent {
1532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1533    }
1534    if let Some(ref apikey) = configuration.api_key {
1535        let key = apikey.key.clone();
1536        let value = match apikey.prefix {
1537            Some(ref prefix) => format!("{} {}", prefix, key),
1538            None => key,
1539        };
1540        req_builder = req_builder.header("Authorization", value);
1541    };
1542
1543    let req = req_builder.build()?;
1544    let resp = configuration.client.execute(req).await?;
1545
1546    let status = resp.status();
1547    let content_type = resp
1548        .headers()
1549        .get("content-type")
1550        .and_then(|v| v.to_str().ok())
1551        .unwrap_or("application/octet-stream");
1552    let content_type = super::ContentType::from(content_type);
1553
1554    if !status.is_client_error() && !status.is_server_error() {
1555        let content = resp.text().await?;
1556        match content_type {
1557            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1558            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsTrend200Response`"))),
1559            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`")))),
1560        }
1561    } else {
1562        let content = resp.text().await?;
1563        let entity: Option<GetEpsTrendError> = serde_json::from_str(&content).ok();
1564        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1565    }
1566}
1567
1568/// 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.
1569pub async fn get_growth_estimates(configuration: &configuration::Configuration, params: GetGrowthEstimatesParams) -> Result<models::GetGrowthEstimates200Response, Error<GetGrowthEstimatesError>> {
1570    // Extract parameters from params struct
1571    let p_query_symbol = params.symbol;
1572    let p_query_figi = params.figi;
1573    let p_query_isin = params.isin;
1574    let p_query_cusip = params.cusip;
1575    let p_query_country = params.country;
1576    let p_query_exchange = params.exchange;
1577
1578    let uri_str = format!("{}/growth_estimates", configuration.base_path);
1579    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1580
1581    if let Some(ref param_value) = p_query_symbol {
1582        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1583    }
1584    if let Some(ref param_value) = p_query_figi {
1585        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1586    }
1587    if let Some(ref param_value) = p_query_isin {
1588        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1589    }
1590    if let Some(ref param_value) = p_query_cusip {
1591        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1592    }
1593    if let Some(ref param_value) = p_query_country {
1594        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1595    }
1596    if let Some(ref param_value) = p_query_exchange {
1597        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1598    }
1599    if let Some(ref user_agent) = configuration.user_agent {
1600        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1601    }
1602    if let Some(ref apikey) = configuration.api_key {
1603        let key = apikey.key.clone();
1604        let value = match apikey.prefix {
1605            Some(ref prefix) => format!("{} {}", prefix, key),
1606            None => key,
1607        };
1608        req_builder = req_builder.header("Authorization", value);
1609    };
1610
1611    let req = req_builder.build()?;
1612    let resp = configuration.client.execute(req).await?;
1613
1614    let status = resp.status();
1615    let content_type = resp
1616        .headers()
1617        .get("content-type")
1618        .and_then(|v| v.to_str().ok())
1619        .unwrap_or("application/octet-stream");
1620    let content_type = super::ContentType::from(content_type);
1621
1622    if !status.is_client_error() && !status.is_server_error() {
1623        let content = resp.text().await?;
1624        match content_type {
1625            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1626            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetGrowthEstimates200Response`"))),
1627            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`")))),
1628        }
1629    } else {
1630        let content = resp.text().await?;
1631        let entity: Option<GetGrowthEstimatesError> = serde_json::from_str(&content).ok();
1632        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1633    }
1634}
1635
1636/// 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.
1637pub async fn get_price_target(configuration: &configuration::Configuration, params: GetPriceTargetParams) -> Result<models::GetPriceTarget200Response, Error<GetPriceTargetError>> {
1638    // Extract parameters from params struct
1639    let p_query_symbol = params.symbol;
1640    let p_query_figi = params.figi;
1641    let p_query_isin = params.isin;
1642    let p_query_cusip = params.cusip;
1643    let p_query_country = params.country;
1644    let p_query_exchange = params.exchange;
1645
1646    let uri_str = format!("{}/price_target", configuration.base_path);
1647    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1648
1649    if let Some(ref param_value) = p_query_symbol {
1650        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1651    }
1652    if let Some(ref param_value) = p_query_figi {
1653        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1654    }
1655    if let Some(ref param_value) = p_query_isin {
1656        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1657    }
1658    if let Some(ref param_value) = p_query_cusip {
1659        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1660    }
1661    if let Some(ref param_value) = p_query_country {
1662        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1663    }
1664    if let Some(ref param_value) = p_query_exchange {
1665        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1666    }
1667    if let Some(ref user_agent) = configuration.user_agent {
1668        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1669    }
1670    if let Some(ref apikey) = configuration.api_key {
1671        let key = apikey.key.clone();
1672        let value = match apikey.prefix {
1673            Some(ref prefix) => format!("{} {}", prefix, key),
1674            None => key,
1675        };
1676        req_builder = req_builder.header("Authorization", value);
1677    };
1678
1679    let req = req_builder.build()?;
1680    let resp = configuration.client.execute(req).await?;
1681
1682    let status = resp.status();
1683    let content_type = resp
1684        .headers()
1685        .get("content-type")
1686        .and_then(|v| v.to_str().ok())
1687        .unwrap_or("application/octet-stream");
1688    let content_type = super::ContentType::from(content_type);
1689
1690    if !status.is_client_error() && !status.is_server_error() {
1691        let content = resp.text().await?;
1692        match content_type {
1693            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1694            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPriceTarget200Response`"))),
1695            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`")))),
1696        }
1697    } else {
1698        let content = resp.text().await?;
1699        let entity: Option<GetPriceTargetError> = serde_json::from_str(&content).ok();
1700        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1701    }
1702}
1703
1704/// 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.
1705pub async fn get_recommendations(configuration: &configuration::Configuration, params: GetRecommendationsParams) -> Result<models::GetRecommendations200Response, Error<GetRecommendationsError>> {
1706    // Extract parameters from params struct
1707    let p_query_symbol = params.symbol;
1708    let p_query_figi = params.figi;
1709    let p_query_isin = params.isin;
1710    let p_query_cusip = params.cusip;
1711    let p_query_country = params.country;
1712    let p_query_exchange = params.exchange;
1713
1714    let uri_str = format!("{}/recommendations", configuration.base_path);
1715    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1716
1717    if let Some(ref param_value) = p_query_symbol {
1718        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1719    }
1720    if let Some(ref param_value) = p_query_figi {
1721        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1722    }
1723    if let Some(ref param_value) = p_query_isin {
1724        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1725    }
1726    if let Some(ref param_value) = p_query_cusip {
1727        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1728    }
1729    if let Some(ref param_value) = p_query_country {
1730        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1731    }
1732    if let Some(ref param_value) = p_query_exchange {
1733        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1734    }
1735    if let Some(ref user_agent) = configuration.user_agent {
1736        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1737    }
1738    if let Some(ref apikey) = configuration.api_key {
1739        let key = apikey.key.clone();
1740        let value = match apikey.prefix {
1741            Some(ref prefix) => format!("{} {}", prefix, key),
1742            None => key,
1743        };
1744        req_builder = req_builder.header("Authorization", value);
1745    };
1746
1747    let req = req_builder.build()?;
1748    let resp = configuration.client.execute(req).await?;
1749
1750    let status = resp.status();
1751    let content_type = resp
1752        .headers()
1753        .get("content-type")
1754        .and_then(|v| v.to_str().ok())
1755        .unwrap_or("application/octet-stream");
1756    let content_type = super::ContentType::from(content_type);
1757
1758    if !status.is_client_error() && !status.is_server_error() {
1759        let content = resp.text().await?;
1760        match content_type {
1761            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1762            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRecommendations200Response`"))),
1763            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`")))),
1764        }
1765    } else {
1766        let content = resp.text().await?;
1767        let entity: Option<GetRecommendationsError> = serde_json::from_str(&content).ok();
1768        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1769    }
1770}
1771
1772/// 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.
1773pub async fn get_revenue_estimate(configuration: &configuration::Configuration, params: GetRevenueEstimateParams) -> Result<models::GetRevenueEstimate200Response, Error<GetRevenueEstimateError>> {
1774    // Extract parameters from params struct
1775    let p_query_symbol = params.symbol;
1776    let p_query_figi = params.figi;
1777    let p_query_isin = params.isin;
1778    let p_query_cusip = params.cusip;
1779    let p_query_country = params.country;
1780    let p_query_exchange = params.exchange;
1781    let p_query_dp = params.dp;
1782
1783    let uri_str = format!("{}/revenue_estimate", configuration.base_path);
1784    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1785
1786    if let Some(ref param_value) = p_query_symbol {
1787        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1788    }
1789    if let Some(ref param_value) = p_query_figi {
1790        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
1791    }
1792    if let Some(ref param_value) = p_query_isin {
1793        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
1794    }
1795    if let Some(ref param_value) = p_query_cusip {
1796        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
1797    }
1798    if let Some(ref param_value) = p_query_country {
1799        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1800    }
1801    if let Some(ref param_value) = p_query_exchange {
1802        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1803    }
1804    if let Some(ref param_value) = p_query_dp {
1805        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
1806    }
1807    if let Some(ref user_agent) = configuration.user_agent {
1808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1809    }
1810    if let Some(ref apikey) = configuration.api_key {
1811        let key = apikey.key.clone();
1812        let value = match apikey.prefix {
1813            Some(ref prefix) => format!("{} {}", prefix, key),
1814            None => key,
1815        };
1816        req_builder = req_builder.header("Authorization", value);
1817    };
1818
1819    let req = req_builder.build()?;
1820    let resp = configuration.client.execute(req).await?;
1821
1822    let status = resp.status();
1823    let content_type = resp
1824        .headers()
1825        .get("content-type")
1826        .and_then(|v| v.to_str().ok())
1827        .unwrap_or("application/octet-stream");
1828    let content_type = super::ContentType::from(content_type);
1829
1830    if !status.is_client_error() && !status.is_server_error() {
1831        let content = resp.text().await?;
1832        match content_type {
1833            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1834            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRevenueEstimate200Response`"))),
1835            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`")))),
1836        }
1837    } else {
1838        let content = resp.text().await?;
1839        let entity: Option<GetRevenueEstimateError> = serde_json::from_str(&content).ok();
1840        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1841    }
1842}
1843