twelve_data_client/apis/
fundamentals_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
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for passing parameters to the method [`get_balance_sheet`]
17#[derive(Clone, Debug, Default, Serialize, Deserialize)]
18pub struct GetBalanceSheetParams {
19    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
20    pub symbol: Option<String>,
21    /// Filter by financial instrument global identifier (FIGI)
22    pub figi: Option<String>,
23    /// Filter by international securities identification number (ISIN)
24    pub isin: Option<String>,
25    /// 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
26    pub cusip: Option<String>,
27    /// Exchange where instrument is traded
28    pub exchange: Option<String>,
29    /// Market Identifier Code (MIC) under ISO 10383 standard
30    pub mic_code: Option<String>,
31    /// Country where instrument is traded, e.g., `United States` or `US`
32    pub country: Option<String>,
33    /// The reporting period for the balane sheet data
34    pub period: Option<String>,
35    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
36    pub start_date: Option<String>,
37    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
38    pub end_date: Option<String>,
39    /// Number of records in response
40    pub outputsize: Option<i64>,
41}
42
43impl GetBalanceSheetParams {
44    /// Create a new builder for this parameter struct
45    pub fn builder() -> GetBalanceSheetParamsBuilder {
46        GetBalanceSheetParamsBuilder::default()
47    }
48}
49
50/// Builder for [`GetBalanceSheetParams`]
51#[derive(Clone, Debug, Default)]
52pub struct GetBalanceSheetParamsBuilder {
53    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
54    symbol: Option<String>,
55    /// Filter by financial instrument global identifier (FIGI)
56    figi: Option<String>,
57    /// Filter by international securities identification number (ISIN)
58    isin: Option<String>,
59    /// 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
60    cusip: Option<String>,
61    /// Exchange where instrument is traded
62    exchange: Option<String>,
63    /// Market Identifier Code (MIC) under ISO 10383 standard
64    mic_code: Option<String>,
65    /// Country where instrument is traded, e.g., `United States` or `US`
66    country: Option<String>,
67    /// The reporting period for the balane sheet data
68    period: Option<String>,
69    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
70    start_date: Option<String>,
71    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
72    end_date: Option<String>,
73    /// Number of records in response
74    outputsize: Option<i64>,
75}
76
77impl GetBalanceSheetParamsBuilder {
78    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
79    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
80        self.symbol = Some(symbol.into());
81        self
82    }
83    /// Filter by financial instrument global identifier (FIGI)
84    pub fn figi(mut self, figi: impl Into<String>) -> Self {
85        self.figi = Some(figi.into());
86        self
87    }
88    /// Filter by international securities identification number (ISIN)
89    pub fn isin(mut self, isin: impl Into<String>) -> Self {
90        self.isin = Some(isin.into());
91        self
92    }
93    /// 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
94    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
95        self.cusip = Some(cusip.into());
96        self
97    }
98    /// Exchange where instrument is traded
99    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
100        self.exchange = Some(exchange.into());
101        self
102    }
103    /// Market Identifier Code (MIC) under ISO 10383 standard
104    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
105        self.mic_code = Some(mic_code.into());
106        self
107    }
108    /// Country where instrument is traded, e.g., `United States` or `US`
109    pub fn country(mut self, country: impl Into<String>) -> Self {
110        self.country = Some(country.into());
111        self
112    }
113    /// The reporting period for the balane sheet data
114    pub fn period(mut self, period: impl Into<String>) -> Self {
115        self.period = Some(period.into());
116        self
117    }
118    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
119    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
120        self.start_date = Some(start_date.into());
121        self
122    }
123    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
124    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
125        self.end_date = Some(end_date.into());
126        self
127    }
128    /// Number of records in response
129    pub fn outputsize(mut self, outputsize: i64) -> Self {
130        self.outputsize = Some(outputsize);
131        self
132    }
133
134    /// Build the parameter struct
135    pub fn build(self) -> GetBalanceSheetParams {
136        GetBalanceSheetParams {
137            symbol: self.symbol,
138            figi: self.figi,
139            isin: self.isin,
140            cusip: self.cusip,
141            exchange: self.exchange,
142            mic_code: self.mic_code,
143            country: self.country,
144            period: self.period,
145            start_date: self.start_date,
146            end_date: self.end_date,
147            outputsize: self.outputsize,
148        }
149    }
150}
151
152/// struct for passing parameters to the method [`get_balance_sheet_consolidated`]
153#[derive(Clone, Debug, Default, Serialize, Deserialize)]
154pub struct GetBalanceSheetConsolidatedParams {
155    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
156    pub symbol: Option<String>,
157    /// Filter by financial instrument global identifier (FIGI)
158    pub figi: Option<String>,
159    /// Filter by international securities identification number (ISIN)
160    pub isin: Option<String>,
161    /// 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
162    pub cusip: Option<String>,
163    /// Exchange where instrument is traded
164    pub exchange: Option<String>,
165    /// Market Identifier Code (MIC) under ISO 10383 standard
166    pub mic_code: Option<String>,
167    /// Country where instrument is traded, e.g., `United States` or `US`
168    pub country: Option<String>,
169    /// The reporting period for the balance sheet data.
170    pub period: Option<String>,
171    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
172    pub start_date: Option<String>,
173    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
174    pub end_date: Option<String>,
175    /// Number of records in response
176    pub outputsize: Option<i64>,
177}
178
179impl GetBalanceSheetConsolidatedParams {
180    /// Create a new builder for this parameter struct
181    pub fn builder() -> GetBalanceSheetConsolidatedParamsBuilder {
182        GetBalanceSheetConsolidatedParamsBuilder::default()
183    }
184}
185
186/// Builder for [`GetBalanceSheetConsolidatedParams`]
187#[derive(Clone, Debug, Default)]
188pub struct GetBalanceSheetConsolidatedParamsBuilder {
189    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
190    symbol: Option<String>,
191    /// Filter by financial instrument global identifier (FIGI)
192    figi: Option<String>,
193    /// Filter by international securities identification number (ISIN)
194    isin: Option<String>,
195    /// 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
196    cusip: Option<String>,
197    /// Exchange where instrument is traded
198    exchange: Option<String>,
199    /// Market Identifier Code (MIC) under ISO 10383 standard
200    mic_code: Option<String>,
201    /// Country where instrument is traded, e.g., `United States` or `US`
202    country: Option<String>,
203    /// The reporting period for the balance sheet data.
204    period: Option<String>,
205    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
206    start_date: Option<String>,
207    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
208    end_date: Option<String>,
209    /// Number of records in response
210    outputsize: Option<i64>,
211}
212
213impl GetBalanceSheetConsolidatedParamsBuilder {
214    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
215    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
216        self.symbol = Some(symbol.into());
217        self
218    }
219    /// Filter by financial instrument global identifier (FIGI)
220    pub fn figi(mut self, figi: impl Into<String>) -> Self {
221        self.figi = Some(figi.into());
222        self
223    }
224    /// Filter by international securities identification number (ISIN)
225    pub fn isin(mut self, isin: impl Into<String>) -> Self {
226        self.isin = Some(isin.into());
227        self
228    }
229    /// 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
230    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
231        self.cusip = Some(cusip.into());
232        self
233    }
234    /// Exchange where instrument is traded
235    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
236        self.exchange = Some(exchange.into());
237        self
238    }
239    /// Market Identifier Code (MIC) under ISO 10383 standard
240    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
241        self.mic_code = Some(mic_code.into());
242        self
243    }
244    /// Country where instrument is traded, e.g., `United States` or `US`
245    pub fn country(mut self, country: impl Into<String>) -> Self {
246        self.country = Some(country.into());
247        self
248    }
249    /// The reporting period for the balance sheet data.
250    pub fn period(mut self, period: impl Into<String>) -> Self {
251        self.period = Some(period.into());
252        self
253    }
254    /// Begin date for filtering items by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
255    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
256        self.start_date = Some(start_date.into());
257        self
258    }
259    /// End date for filtering items by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
260    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
261        self.end_date = Some(end_date.into());
262        self
263    }
264    /// Number of records in response
265    pub fn outputsize(mut self, outputsize: i64) -> Self {
266        self.outputsize = Some(outputsize);
267        self
268    }
269
270    /// Build the parameter struct
271    pub fn build(self) -> GetBalanceSheetConsolidatedParams {
272        GetBalanceSheetConsolidatedParams {
273            symbol: self.symbol,
274            figi: self.figi,
275            isin: self.isin,
276            cusip: self.cusip,
277            exchange: self.exchange,
278            mic_code: self.mic_code,
279            country: self.country,
280            period: self.period,
281            start_date: self.start_date,
282            end_date: self.end_date,
283            outputsize: self.outputsize,
284        }
285    }
286}
287
288/// struct for passing parameters to the method [`get_cash_flow`]
289#[derive(Clone, Debug, Default, Serialize, Deserialize)]
290pub struct GetCashFlowParams {
291    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
292    pub symbol: Option<String>,
293    /// Filter by financial instrument global identifier (FIGI)
294    pub figi: Option<String>,
295    /// Filter by international securities identification number (ISIN)
296    pub isin: Option<String>,
297    /// 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
298    pub cusip: Option<String>,
299    /// Exchange where instrument is traded
300    pub exchange: Option<String>,
301    /// Market Identifier Code (MIC) under ISO 10383 standard
302    pub mic_code: Option<String>,
303    /// Country where instrument is traded, e.g., `United States` or `US`
304    pub country: Option<String>,
305    /// The reporting period for the cash flow statements
306    pub period: Option<String>,
307    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
308    pub start_date: Option<String>,
309    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
310    pub end_date: Option<String>,
311    /// Number of records in response
312    pub outputsize: Option<i64>,
313}
314
315impl GetCashFlowParams {
316    /// Create a new builder for this parameter struct
317    pub fn builder() -> GetCashFlowParamsBuilder {
318        GetCashFlowParamsBuilder::default()
319    }
320}
321
322/// Builder for [`GetCashFlowParams`]
323#[derive(Clone, Debug, Default)]
324pub struct GetCashFlowParamsBuilder {
325    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
326    symbol: Option<String>,
327    /// Filter by financial instrument global identifier (FIGI)
328    figi: Option<String>,
329    /// Filter by international securities identification number (ISIN)
330    isin: Option<String>,
331    /// 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
332    cusip: Option<String>,
333    /// Exchange where instrument is traded
334    exchange: Option<String>,
335    /// Market Identifier Code (MIC) under ISO 10383 standard
336    mic_code: Option<String>,
337    /// Country where instrument is traded, e.g., `United States` or `US`
338    country: Option<String>,
339    /// The reporting period for the cash flow statements
340    period: Option<String>,
341    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
342    start_date: Option<String>,
343    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
344    end_date: Option<String>,
345    /// Number of records in response
346    outputsize: Option<i64>,
347}
348
349impl GetCashFlowParamsBuilder {
350    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
351    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
352        self.symbol = Some(symbol.into());
353        self
354    }
355    /// Filter by financial instrument global identifier (FIGI)
356    pub fn figi(mut self, figi: impl Into<String>) -> Self {
357        self.figi = Some(figi.into());
358        self
359    }
360    /// Filter by international securities identification number (ISIN)
361    pub fn isin(mut self, isin: impl Into<String>) -> Self {
362        self.isin = Some(isin.into());
363        self
364    }
365    /// 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
366    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
367        self.cusip = Some(cusip.into());
368        self
369    }
370    /// Exchange where instrument is traded
371    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
372        self.exchange = Some(exchange.into());
373        self
374    }
375    /// Market Identifier Code (MIC) under ISO 10383 standard
376    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
377        self.mic_code = Some(mic_code.into());
378        self
379    }
380    /// Country where instrument is traded, e.g., `United States` or `US`
381    pub fn country(mut self, country: impl Into<String>) -> Self {
382        self.country = Some(country.into());
383        self
384    }
385    /// The reporting period for the cash flow statements
386    pub fn period(mut self, period: impl Into<String>) -> Self {
387        self.period = Some(period.into());
388        self
389    }
390    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
391    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
392        self.start_date = Some(start_date.into());
393        self
394    }
395    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
396    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
397        self.end_date = Some(end_date.into());
398        self
399    }
400    /// Number of records in response
401    pub fn outputsize(mut self, outputsize: i64) -> Self {
402        self.outputsize = Some(outputsize);
403        self
404    }
405
406    /// Build the parameter struct
407    pub fn build(self) -> GetCashFlowParams {
408        GetCashFlowParams {
409            symbol: self.symbol,
410            figi: self.figi,
411            isin: self.isin,
412            cusip: self.cusip,
413            exchange: self.exchange,
414            mic_code: self.mic_code,
415            country: self.country,
416            period: self.period,
417            start_date: self.start_date,
418            end_date: self.end_date,
419            outputsize: self.outputsize,
420        }
421    }
422}
423
424/// struct for passing parameters to the method [`get_cash_flow_consolidated`]
425#[derive(Clone, Debug, Default, Serialize, Deserialize)]
426pub struct GetCashFlowConsolidatedParams {
427    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
428    pub symbol: Option<String>,
429    /// Filter by financial instrument global identifier (FIGI)
430    pub figi: Option<String>,
431    /// Filter by international securities identification number (ISIN)
432    pub isin: Option<String>,
433    /// 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
434    pub cusip: Option<String>,
435    /// Exchange where instrument is traded
436    pub exchange: Option<String>,
437    /// Market Identifier Code (MIC) under ISO 10383 standard
438    pub mic_code: Option<String>,
439    /// Country where instrument is traded, e.g., `United States` or `US`
440    pub country: Option<String>,
441    /// The reporting period for the cash flow statements
442    pub period: Option<String>,
443    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
444    pub start_date: Option<String>,
445    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
446    pub end_date: Option<String>,
447    /// Number of records in response
448    pub outputsize: Option<i64>,
449}
450
451impl GetCashFlowConsolidatedParams {
452    /// Create a new builder for this parameter struct
453    pub fn builder() -> GetCashFlowConsolidatedParamsBuilder {
454        GetCashFlowConsolidatedParamsBuilder::default()
455    }
456}
457
458/// Builder for [`GetCashFlowConsolidatedParams`]
459#[derive(Clone, Debug, Default)]
460pub struct GetCashFlowConsolidatedParamsBuilder {
461    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
462    symbol: Option<String>,
463    /// Filter by financial instrument global identifier (FIGI)
464    figi: Option<String>,
465    /// Filter by international securities identification number (ISIN)
466    isin: Option<String>,
467    /// 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
468    cusip: Option<String>,
469    /// Exchange where instrument is traded
470    exchange: Option<String>,
471    /// Market Identifier Code (MIC) under ISO 10383 standard
472    mic_code: Option<String>,
473    /// Country where instrument is traded, e.g., `United States` or `US`
474    country: Option<String>,
475    /// The reporting period for the cash flow statements
476    period: Option<String>,
477    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
478    start_date: Option<String>,
479    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
480    end_date: Option<String>,
481    /// Number of records in response
482    outputsize: Option<i64>,
483}
484
485impl GetCashFlowConsolidatedParamsBuilder {
486    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
487    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
488        self.symbol = Some(symbol.into());
489        self
490    }
491    /// Filter by financial instrument global identifier (FIGI)
492    pub fn figi(mut self, figi: impl Into<String>) -> Self {
493        self.figi = Some(figi.into());
494        self
495    }
496    /// Filter by international securities identification number (ISIN)
497    pub fn isin(mut self, isin: impl Into<String>) -> Self {
498        self.isin = Some(isin.into());
499        self
500    }
501    /// 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
502    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
503        self.cusip = Some(cusip.into());
504        self
505    }
506    /// Exchange where instrument is traded
507    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
508        self.exchange = Some(exchange.into());
509        self
510    }
511    /// Market Identifier Code (MIC) under ISO 10383 standard
512    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
513        self.mic_code = Some(mic_code.into());
514        self
515    }
516    /// Country where instrument is traded, e.g., `United States` or `US`
517    pub fn country(mut self, country: impl Into<String>) -> Self {
518        self.country = Some(country.into());
519        self
520    }
521    /// The reporting period for the cash flow statements
522    pub fn period(mut self, period: impl Into<String>) -> Self {
523        self.period = Some(period.into());
524        self
525    }
526    /// Start date for filtering cash flow statements. Only cash flow statements with fiscal dates on or after this date will be included. Format `2006-01-02`
527    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
528        self.start_date = Some(start_date.into());
529        self
530    }
531    /// End date for filtering cash flow statements. Only cash flow statements with fiscal dates on or before this date will be included. Format `2006-01-02`
532    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
533        self.end_date = Some(end_date.into());
534        self
535    }
536    /// Number of records in response
537    pub fn outputsize(mut self, outputsize: i64) -> Self {
538        self.outputsize = Some(outputsize);
539        self
540    }
541
542    /// Build the parameter struct
543    pub fn build(self) -> GetCashFlowConsolidatedParams {
544        GetCashFlowConsolidatedParams {
545            symbol: self.symbol,
546            figi: self.figi,
547            isin: self.isin,
548            cusip: self.cusip,
549            exchange: self.exchange,
550            mic_code: self.mic_code,
551            country: self.country,
552            period: self.period,
553            start_date: self.start_date,
554            end_date: self.end_date,
555            outputsize: self.outputsize,
556        }
557    }
558}
559
560/// struct for passing parameters to the method [`get_dividends`]
561#[derive(Clone, Debug, Default, Serialize, Deserialize)]
562pub struct GetDividendsParams {
563    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
564    pub symbol: Option<String>,
565    /// Filter by financial instrument global identifier (FIGI)
566    pub figi: Option<String>,
567    /// Filter by international securities identification number (ISIN)
568    pub isin: Option<String>,
569    /// 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
570    pub cusip: Option<String>,
571    /// Exchange where instrument is traded
572    pub exchange: Option<String>,
573    /// Market Identifier Code (MIC) under ISO 10383 standard
574    pub mic_code: Option<String>,
575    /// Country where instrument is traded, e.g., `United States` or `US`
576    pub country: Option<String>,
577    /// Specifies the time range for which to retrieve dividend data. Accepts values such as `last` (most recent dividend), `next` (upcoming dividend), `1m` - `5y` for respective periods, or `full` for all available data. If provided together with `start_date` and/or `end_date`, this parameter takes precedence.
578    pub range: Option<String>,
579    /// Start date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
580    pub start_date: Option<String>,
581    /// End date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
582    pub end_date: Option<String>,
583    /// Specifies if there should be an adjustment
584    pub adjust: Option<bool>,
585}
586
587impl GetDividendsParams {
588    /// Create a new builder for this parameter struct
589    pub fn builder() -> GetDividendsParamsBuilder {
590        GetDividendsParamsBuilder::default()
591    }
592}
593
594/// Builder for [`GetDividendsParams`]
595#[derive(Clone, Debug, Default)]
596pub struct GetDividendsParamsBuilder {
597    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
598    symbol: Option<String>,
599    /// Filter by financial instrument global identifier (FIGI)
600    figi: Option<String>,
601    /// Filter by international securities identification number (ISIN)
602    isin: Option<String>,
603    /// 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
604    cusip: Option<String>,
605    /// Exchange where instrument is traded
606    exchange: Option<String>,
607    /// Market Identifier Code (MIC) under ISO 10383 standard
608    mic_code: Option<String>,
609    /// Country where instrument is traded, e.g., `United States` or `US`
610    country: Option<String>,
611    /// Specifies the time range for which to retrieve dividend data. Accepts values such as `last` (most recent dividend), `next` (upcoming dividend), `1m` - `5y` for respective periods, or `full` for all available data. If provided together with `start_date` and/or `end_date`, this parameter takes precedence.
612    range: Option<String>,
613    /// Start date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
614    start_date: Option<String>,
615    /// End date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
616    end_date: Option<String>,
617    /// Specifies if there should be an adjustment
618    adjust: Option<bool>,
619}
620
621impl GetDividendsParamsBuilder {
622    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
623    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
624        self.symbol = Some(symbol.into());
625        self
626    }
627    /// Filter by financial instrument global identifier (FIGI)
628    pub fn figi(mut self, figi: impl Into<String>) -> Self {
629        self.figi = Some(figi.into());
630        self
631    }
632    /// Filter by international securities identification number (ISIN)
633    pub fn isin(mut self, isin: impl Into<String>) -> Self {
634        self.isin = Some(isin.into());
635        self
636    }
637    /// 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
638    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
639        self.cusip = Some(cusip.into());
640        self
641    }
642    /// Exchange where instrument is traded
643    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
644        self.exchange = Some(exchange.into());
645        self
646    }
647    /// Market Identifier Code (MIC) under ISO 10383 standard
648    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
649        self.mic_code = Some(mic_code.into());
650        self
651    }
652    /// Country where instrument is traded, e.g., `United States` or `US`
653    pub fn country(mut self, country: impl Into<String>) -> Self {
654        self.country = Some(country.into());
655        self
656    }
657    /// Specifies the time range for which to retrieve dividend data. Accepts values such as `last` (most recent dividend), `next` (upcoming dividend), `1m` - `5y` for respective periods, or `full` for all available data. If provided together with `start_date` and/or `end_date`, this parameter takes precedence.
658    pub fn range(mut self, range: impl Into<String>) -> Self {
659        self.range = Some(range.into());
660        self
661    }
662    /// Start date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
663    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
664        self.start_date = Some(start_date.into());
665        self
666    }
667    /// End date for the dividend data query. Only dividends with dates on or after this date will be returned. Format `2006-01-02`. If provided together with `range` parameter, `range` will take precedence.
668    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
669        self.end_date = Some(end_date.into());
670        self
671    }
672    /// Specifies if there should be an adjustment
673    pub fn adjust(mut self, adjust: bool) -> Self {
674        self.adjust = Some(adjust);
675        self
676    }
677
678    /// Build the parameter struct
679    pub fn build(self) -> GetDividendsParams {
680        GetDividendsParams {
681            symbol: self.symbol,
682            figi: self.figi,
683            isin: self.isin,
684            cusip: self.cusip,
685            exchange: self.exchange,
686            mic_code: self.mic_code,
687            country: self.country,
688            range: self.range,
689            start_date: self.start_date,
690            end_date: self.end_date,
691            adjust: self.adjust,
692        }
693    }
694}
695
696/// struct for passing parameters to the method [`get_dividends_calendar`]
697#[derive(Clone, Debug, Default, Serialize, Deserialize)]
698pub struct GetDividendsCalendarParams {
699    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
700    pub symbol: Option<String>,
701    /// Filter by financial instrument global identifier (FIGI)
702    pub figi: Option<String>,
703    /// Filter by international securities identification number (ISIN)
704    pub 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    pub cusip: Option<String>,
707    /// Exchange where instrument is traded
708    pub exchange: Option<String>,
709    /// Market Identifier Code (MIC) under ISO 10383 standard
710    pub mic_code: Option<String>,
711    /// Country where instrument is traded, e.g., `United States` or `US`
712    pub country: Option<String>,
713    /// Start date for the dividends calendar query. Only dividends with ex-dates on or after this date will be returned. Format `2006-01-02`
714    pub start_date: Option<String>,
715    /// End date for the dividends calendar query. Only dividends with ex-dates on or before this date will be returned. Format `2006-01-02`
716    pub end_date: Option<String>,
717    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
718    pub outputsize: Option<i64>,
719    /// Page number
720    pub page: Option<i64>,
721}
722
723impl GetDividendsCalendarParams {
724    /// Create a new builder for this parameter struct
725    pub fn builder() -> GetDividendsCalendarParamsBuilder {
726        GetDividendsCalendarParamsBuilder::default()
727    }
728}
729
730/// Builder for [`GetDividendsCalendarParams`]
731#[derive(Clone, Debug, Default)]
732pub struct GetDividendsCalendarParamsBuilder {
733    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
734    symbol: Option<String>,
735    /// Filter by financial instrument global identifier (FIGI)
736    figi: Option<String>,
737    /// Filter by international securities identification number (ISIN)
738    isin: Option<String>,
739    /// 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
740    cusip: Option<String>,
741    /// Exchange where instrument is traded
742    exchange: Option<String>,
743    /// Market Identifier Code (MIC) under ISO 10383 standard
744    mic_code: Option<String>,
745    /// Country where instrument is traded, e.g., `United States` or `US`
746    country: Option<String>,
747    /// Start date for the dividends calendar query. Only dividends with ex-dates on or after this date will be returned. Format `2006-01-02`
748    start_date: Option<String>,
749    /// End date for the dividends calendar query. Only dividends with ex-dates on or before this date will be returned. Format `2006-01-02`
750    end_date: Option<String>,
751    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
752    outputsize: Option<i64>,
753    /// Page number
754    page: Option<i64>,
755}
756
757impl GetDividendsCalendarParamsBuilder {
758    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
759    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
760        self.symbol = Some(symbol.into());
761        self
762    }
763    /// Filter by financial instrument global identifier (FIGI)
764    pub fn figi(mut self, figi: impl Into<String>) -> Self {
765        self.figi = Some(figi.into());
766        self
767    }
768    /// Filter by international securities identification number (ISIN)
769    pub fn isin(mut self, isin: impl Into<String>) -> Self {
770        self.isin = Some(isin.into());
771        self
772    }
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 fn cusip(mut self, cusip: impl Into<String>) -> Self {
775        self.cusip = Some(cusip.into());
776        self
777    }
778    /// Exchange where instrument is traded
779    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
780        self.exchange = Some(exchange.into());
781        self
782    }
783    /// Market Identifier Code (MIC) under ISO 10383 standard
784    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
785        self.mic_code = Some(mic_code.into());
786        self
787    }
788    /// Country where instrument is traded, e.g., `United States` or `US`
789    pub fn country(mut self, country: impl Into<String>) -> Self {
790        self.country = Some(country.into());
791        self
792    }
793    /// Start date for the dividends calendar query. Only dividends with ex-dates on or after this date will be returned. Format `2006-01-02`
794    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
795        self.start_date = Some(start_date.into());
796        self
797    }
798    /// End date for the dividends calendar query. Only dividends with ex-dates on or before this date will be returned. Format `2006-01-02`
799    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
800        self.end_date = Some(end_date.into());
801        self
802    }
803    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
804    pub fn outputsize(mut self, outputsize: i64) -> Self {
805        self.outputsize = Some(outputsize);
806        self
807    }
808    /// Page number
809    pub fn page(mut self, page: i64) -> Self {
810        self.page = Some(page);
811        self
812    }
813
814    /// Build the parameter struct
815    pub fn build(self) -> GetDividendsCalendarParams {
816        GetDividendsCalendarParams {
817            symbol: self.symbol,
818            figi: self.figi,
819            isin: self.isin,
820            cusip: self.cusip,
821            exchange: self.exchange,
822            mic_code: self.mic_code,
823            country: self.country,
824            start_date: self.start_date,
825            end_date: self.end_date,
826            outputsize: self.outputsize,
827            page: self.page,
828        }
829    }
830}
831
832/// struct for passing parameters to the method [`get_earnings`]
833#[derive(Clone, Debug, Default, Serialize, Deserialize)]
834pub struct GetEarningsParams {
835    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
836    pub symbol: Option<String>,
837    /// Filter by financial instrument global identifier (FIGI)
838    pub figi: Option<String>,
839    /// Filter by international securities identification number (ISIN)
840    pub isin: Option<String>,
841    /// 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
842    pub cusip: Option<String>,
843    /// Exchange where instrument is traded
844    pub exchange: Option<String>,
845    /// Market Identifier Code (MIC) under ISO 10383 standard
846    pub mic_code: Option<String>,
847    /// Country where instrument is traded, e.g., `United States` or `US`
848    pub country: Option<String>,
849    /// The asset class to which the instrument belongs
850    pub r#type: Option<String>,
851    /// Type of earning, returns only 1 record. When is not empty, dates and outputsize parameters are ignored
852    pub period: Option<String>,
853    /// Number of data points to retrieve. Supports values in the range from `1` to `1000`. Default `10` when no date parameters are set, otherwise set to maximum
854    pub outputsize: Option<i64>,
855    /// The format of the response data
856    pub format: Option<String>,
857    /// The separator used in the CSV response data
858    pub delimiter: Option<String>,
859    /// The date from which the data is requested. The date format is `YYYY-MM-DD`.
860    pub start_date: Option<String>,
861    /// The date to which the data is requested. The date format is `YYYY-MM-DD`.
862    pub end_date: Option<String>,
863    /// The number of decimal places in the response data. Should be in range [0,11] inclusive
864    pub dp: Option<i64>,
865}
866
867impl GetEarningsParams {
868    /// Create a new builder for this parameter struct
869    pub fn builder() -> GetEarningsParamsBuilder {
870        GetEarningsParamsBuilder::default()
871    }
872}
873
874/// Builder for [`GetEarningsParams`]
875#[derive(Clone, Debug, Default)]
876pub struct GetEarningsParamsBuilder {
877    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
878    symbol: Option<String>,
879    /// Filter by financial instrument global identifier (FIGI)
880    figi: Option<String>,
881    /// Filter by international securities identification number (ISIN)
882    isin: Option<String>,
883    /// 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
884    cusip: Option<String>,
885    /// Exchange where instrument is traded
886    exchange: Option<String>,
887    /// Market Identifier Code (MIC) under ISO 10383 standard
888    mic_code: Option<String>,
889    /// Country where instrument is traded, e.g., `United States` or `US`
890    country: Option<String>,
891    /// The asset class to which the instrument belongs
892    r#type: Option<String>,
893    /// Type of earning, returns only 1 record. When is not empty, dates and outputsize parameters are ignored
894    period: Option<String>,
895    /// Number of data points to retrieve. Supports values in the range from `1` to `1000`. Default `10` when no date parameters are set, otherwise set to maximum
896    outputsize: Option<i64>,
897    /// The format of the response data
898    format: Option<String>,
899    /// The separator used in the CSV response data
900    delimiter: Option<String>,
901    /// The date from which the data is requested. The date format is `YYYY-MM-DD`.
902    start_date: Option<String>,
903    /// The date to which the data is requested. The date format is `YYYY-MM-DD`.
904    end_date: Option<String>,
905    /// The number of decimal places in the response data. Should be in range [0,11] inclusive
906    dp: Option<i64>,
907}
908
909impl GetEarningsParamsBuilder {
910    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
911    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
912        self.symbol = Some(symbol.into());
913        self
914    }
915    /// Filter by financial instrument global identifier (FIGI)
916    pub fn figi(mut self, figi: impl Into<String>) -> Self {
917        self.figi = Some(figi.into());
918        self
919    }
920    /// Filter by international securities identification number (ISIN)
921    pub fn isin(mut self, isin: impl Into<String>) -> Self {
922        self.isin = Some(isin.into());
923        self
924    }
925    /// 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
926    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
927        self.cusip = Some(cusip.into());
928        self
929    }
930    /// Exchange where instrument is traded
931    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
932        self.exchange = Some(exchange.into());
933        self
934    }
935    /// Market Identifier Code (MIC) under ISO 10383 standard
936    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
937        self.mic_code = Some(mic_code.into());
938        self
939    }
940    /// Country where instrument is traded, e.g., `United States` or `US`
941    pub fn country(mut self, country: impl Into<String>) -> Self {
942        self.country = Some(country.into());
943        self
944    }
945    /// The asset class to which the instrument belongs
946    pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
947        self.r#type = Some(r#type.into());
948        self
949    }
950    /// Type of earning, returns only 1 record. When is not empty, dates and outputsize parameters are ignored
951    pub fn period(mut self, period: impl Into<String>) -> Self {
952        self.period = Some(period.into());
953        self
954    }
955    /// Number of data points to retrieve. Supports values in the range from `1` to `1000`. Default `10` when no date parameters are set, otherwise set to maximum
956    pub fn outputsize(mut self, outputsize: i64) -> Self {
957        self.outputsize = Some(outputsize);
958        self
959    }
960    /// The format of the response data
961    pub fn format(mut self, format: impl Into<String>) -> Self {
962        self.format = Some(format.into());
963        self
964    }
965    /// The separator used in the CSV response data
966    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
967        self.delimiter = Some(delimiter.into());
968        self
969    }
970    /// The date from which the data is requested. The date format is `YYYY-MM-DD`.
971    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
972        self.start_date = Some(start_date.into());
973        self
974    }
975    /// The date to which the data is requested. The date format is `YYYY-MM-DD`.
976    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
977        self.end_date = Some(end_date.into());
978        self
979    }
980    /// The number of decimal places in the response data. Should be in range [0,11] inclusive
981    pub fn dp(mut self, dp: i64) -> Self {
982        self.dp = Some(dp);
983        self
984    }
985
986    /// Build the parameter struct
987    pub fn build(self) -> GetEarningsParams {
988        GetEarningsParams {
989            symbol: self.symbol,
990            figi: self.figi,
991            isin: self.isin,
992            cusip: self.cusip,
993            exchange: self.exchange,
994            mic_code: self.mic_code,
995            country: self.country,
996            r#type: self.r#type,
997            period: self.period,
998            outputsize: self.outputsize,
999            format: self.format,
1000            delimiter: self.delimiter,
1001            start_date: self.start_date,
1002            end_date: self.end_date,
1003            dp: self.dp,
1004        }
1005    }
1006}
1007
1008/// struct for passing parameters to the method [`get_earnings_calendar`]
1009#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1010pub struct GetEarningsCalendarParams {
1011    /// Exchange where instrument is traded
1012    pub exchange: Option<String>,
1013    /// Market Identifier Code (MIC) under ISO 10383 standard
1014    pub mic_code: Option<String>,
1015    /// Country where instrument is traded, e.g., `United States` or `US`
1016    pub country: Option<String>,
1017    /// Value can be JSON or CSV
1018    pub format: Option<String>,
1019    /// Specify the delimiter used when downloading the CSV file
1020    pub delimiter: Option<String>,
1021    /// Can be used separately and together with end_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1022    pub start_date: Option<String>,
1023    /// Can be used separately and together with start_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1024    pub end_date: Option<String>,
1025    /// Specifies the number of decimal places for floating values. Should be in range [0,11] inclusive
1026    pub dp: Option<i64>,
1027}
1028
1029impl GetEarningsCalendarParams {
1030    /// Create a new builder for this parameter struct
1031    pub fn builder() -> GetEarningsCalendarParamsBuilder {
1032        GetEarningsCalendarParamsBuilder::default()
1033    }
1034}
1035
1036/// Builder for [`GetEarningsCalendarParams`]
1037#[derive(Clone, Debug, Default)]
1038pub struct GetEarningsCalendarParamsBuilder {
1039    /// Exchange where instrument is traded
1040    exchange: Option<String>,
1041    /// Market Identifier Code (MIC) under ISO 10383 standard
1042    mic_code: Option<String>,
1043    /// Country where instrument is traded, e.g., `United States` or `US`
1044    country: Option<String>,
1045    /// Value can be JSON or CSV
1046    format: Option<String>,
1047    /// Specify the delimiter used when downloading the CSV file
1048    delimiter: Option<String>,
1049    /// Can be used separately and together with end_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1050    start_date: Option<String>,
1051    /// Can be used separately and together with start_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1052    end_date: Option<String>,
1053    /// Specifies the number of decimal places for floating values. Should be in range [0,11] inclusive
1054    dp: Option<i64>,
1055}
1056
1057impl GetEarningsCalendarParamsBuilder {
1058    /// Exchange where instrument is traded
1059    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1060        self.exchange = Some(exchange.into());
1061        self
1062    }
1063    /// Market Identifier Code (MIC) under ISO 10383 standard
1064    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1065        self.mic_code = Some(mic_code.into());
1066        self
1067    }
1068    /// Country where instrument is traded, e.g., `United States` or `US`
1069    pub fn country(mut self, country: impl Into<String>) -> Self {
1070        self.country = Some(country.into());
1071        self
1072    }
1073    /// Value can be JSON or CSV
1074    pub fn format(mut self, format: impl Into<String>) -> Self {
1075        self.format = Some(format.into());
1076        self
1077    }
1078    /// Specify the delimiter used when downloading the CSV file
1079    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1080        self.delimiter = Some(delimiter.into());
1081        self
1082    }
1083    /// Can be used separately and together with end_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1084    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1085        self.start_date = Some(start_date.into());
1086        self
1087    }
1088    /// Can be used separately and together with start_date. Format `2006-01-02` or `2006-01-02T15:04:05`
1089    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1090        self.end_date = Some(end_date.into());
1091        self
1092    }
1093    /// Specifies the number of decimal places for floating values. Should be in range [0,11] inclusive
1094    pub fn dp(mut self, dp: i64) -> Self {
1095        self.dp = Some(dp);
1096        self
1097    }
1098
1099    /// Build the parameter struct
1100    pub fn build(self) -> GetEarningsCalendarParams {
1101        GetEarningsCalendarParams {
1102            exchange: self.exchange,
1103            mic_code: self.mic_code,
1104            country: self.country,
1105            format: self.format,
1106            delimiter: self.delimiter,
1107            start_date: self.start_date,
1108            end_date: self.end_date,
1109            dp: self.dp,
1110        }
1111    }
1112}
1113
1114/// struct for passing parameters to the method [`get_income_statement`]
1115#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1116pub struct GetIncomeStatementParams {
1117    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1118    pub symbol: Option<String>,
1119    /// Filter by financial instrument global identifier (FIGI)
1120    pub figi: Option<String>,
1121    /// Filter by international securities identification number (ISIN)
1122    pub isin: Option<String>,
1123    /// 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
1124    pub cusip: Option<String>,
1125    /// Exchange where instrument is traded
1126    pub exchange: Option<String>,
1127    /// Market Identifier Code (MIC) under ISO 10383 standard
1128    pub mic_code: Option<String>,
1129    /// Country where instrument is traded, e.g., `United States` or `US`
1130    pub country: Option<String>,
1131    /// The reporting period for the income statement data
1132    pub period: Option<String>,
1133    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1134    pub start_date: Option<String>,
1135    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1136    pub end_date: Option<String>,
1137    /// Number of records in response
1138    pub outputsize: Option<i64>,
1139}
1140
1141impl GetIncomeStatementParams {
1142    /// Create a new builder for this parameter struct
1143    pub fn builder() -> GetIncomeStatementParamsBuilder {
1144        GetIncomeStatementParamsBuilder::default()
1145    }
1146}
1147
1148/// Builder for [`GetIncomeStatementParams`]
1149#[derive(Clone, Debug, Default)]
1150pub struct GetIncomeStatementParamsBuilder {
1151    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1152    symbol: Option<String>,
1153    /// Filter by financial instrument global identifier (FIGI)
1154    figi: Option<String>,
1155    /// Filter by international securities identification number (ISIN)
1156    isin: Option<String>,
1157    /// 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
1158    cusip: Option<String>,
1159    /// Exchange where instrument is traded
1160    exchange: Option<String>,
1161    /// Market Identifier Code (MIC) under ISO 10383 standard
1162    mic_code: Option<String>,
1163    /// Country where instrument is traded, e.g., `United States` or `US`
1164    country: Option<String>,
1165    /// The reporting period for the income statement data
1166    period: Option<String>,
1167    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1168    start_date: Option<String>,
1169    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1170    end_date: Option<String>,
1171    /// Number of records in response
1172    outputsize: Option<i64>,
1173}
1174
1175impl GetIncomeStatementParamsBuilder {
1176    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1177    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1178        self.symbol = Some(symbol.into());
1179        self
1180    }
1181    /// Filter by financial instrument global identifier (FIGI)
1182    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1183        self.figi = Some(figi.into());
1184        self
1185    }
1186    /// Filter by international securities identification number (ISIN)
1187    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1188        self.isin = Some(isin.into());
1189        self
1190    }
1191    /// 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
1192    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1193        self.cusip = Some(cusip.into());
1194        self
1195    }
1196    /// Exchange where instrument is traded
1197    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1198        self.exchange = Some(exchange.into());
1199        self
1200    }
1201    /// Market Identifier Code (MIC) under ISO 10383 standard
1202    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1203        self.mic_code = Some(mic_code.into());
1204        self
1205    }
1206    /// Country where instrument is traded, e.g., `United States` or `US`
1207    pub fn country(mut self, country: impl Into<String>) -> Self {
1208        self.country = Some(country.into());
1209        self
1210    }
1211    /// The reporting period for the income statement data
1212    pub fn period(mut self, period: impl Into<String>) -> Self {
1213        self.period = Some(period.into());
1214        self
1215    }
1216    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1217    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1218        self.start_date = Some(start_date.into());
1219        self
1220    }
1221    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1222    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1223        self.end_date = Some(end_date.into());
1224        self
1225    }
1226    /// Number of records in response
1227    pub fn outputsize(mut self, outputsize: i64) -> Self {
1228        self.outputsize = Some(outputsize);
1229        self
1230    }
1231
1232    /// Build the parameter struct
1233    pub fn build(self) -> GetIncomeStatementParams {
1234        GetIncomeStatementParams {
1235            symbol: self.symbol,
1236            figi: self.figi,
1237            isin: self.isin,
1238            cusip: self.cusip,
1239            exchange: self.exchange,
1240            mic_code: self.mic_code,
1241            country: self.country,
1242            period: self.period,
1243            start_date: self.start_date,
1244            end_date: self.end_date,
1245            outputsize: self.outputsize,
1246        }
1247    }
1248}
1249
1250/// struct for passing parameters to the method [`get_income_statement_consolidated`]
1251#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1252pub struct GetIncomeStatementConsolidatedParams {
1253    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1254    pub symbol: Option<String>,
1255    /// Filter by financial instrument global identifier (FIGI)
1256    pub figi: Option<String>,
1257    /// Filter by international securities identification number (ISIN)
1258    pub isin: Option<String>,
1259    /// 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
1260    pub cusip: Option<String>,
1261    /// Exchange where instrument is traded
1262    pub exchange: Option<String>,
1263    /// Market Identifier Code (MIC) under ISO 10383 standard
1264    pub mic_code: Option<String>,
1265    /// Country where instrument is traded, e.g., `United States` or `US`
1266    pub country: Option<String>,
1267    /// The reporting period for the income statement data
1268    pub period: Option<String>,
1269    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1270    pub start_date: Option<String>,
1271    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1272    pub end_date: Option<String>,
1273    /// Number of records in response
1274    pub outputsize: Option<i64>,
1275}
1276
1277impl GetIncomeStatementConsolidatedParams {
1278    /// Create a new builder for this parameter struct
1279    pub fn builder() -> GetIncomeStatementConsolidatedParamsBuilder {
1280        GetIncomeStatementConsolidatedParamsBuilder::default()
1281    }
1282}
1283
1284/// Builder for [`GetIncomeStatementConsolidatedParams`]
1285#[derive(Clone, Debug, Default)]
1286pub struct GetIncomeStatementConsolidatedParamsBuilder {
1287    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1288    symbol: Option<String>,
1289    /// Filter by financial instrument global identifier (FIGI)
1290    figi: Option<String>,
1291    /// Filter by international securities identification number (ISIN)
1292    isin: Option<String>,
1293    /// 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
1294    cusip: Option<String>,
1295    /// Exchange where instrument is traded
1296    exchange: Option<String>,
1297    /// Market Identifier Code (MIC) under ISO 10383 standard
1298    mic_code: Option<String>,
1299    /// Country where instrument is traded, e.g., `United States` or `US`
1300    country: Option<String>,
1301    /// The reporting period for the income statement data
1302    period: Option<String>,
1303    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1304    start_date: Option<String>,
1305    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1306    end_date: Option<String>,
1307    /// Number of records in response
1308    outputsize: Option<i64>,
1309}
1310
1311impl GetIncomeStatementConsolidatedParamsBuilder {
1312    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1313    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1314        self.symbol = Some(symbol.into());
1315        self
1316    }
1317    /// Filter by financial instrument global identifier (FIGI)
1318    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1319        self.figi = Some(figi.into());
1320        self
1321    }
1322    /// Filter by international securities identification number (ISIN)
1323    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1324        self.isin = Some(isin.into());
1325        self
1326    }
1327    /// 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
1328    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1329        self.cusip = Some(cusip.into());
1330        self
1331    }
1332    /// Exchange where instrument is traded
1333    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1334        self.exchange = Some(exchange.into());
1335        self
1336    }
1337    /// Market Identifier Code (MIC) under ISO 10383 standard
1338    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1339        self.mic_code = Some(mic_code.into());
1340        self
1341    }
1342    /// Country where instrument is traded, e.g., `United States` or `US`
1343    pub fn country(mut self, country: impl Into<String>) -> Self {
1344        self.country = Some(country.into());
1345        self
1346    }
1347    /// The reporting period for the income statement data
1348    pub fn period(mut self, period: impl Into<String>) -> Self {
1349        self.period = Some(period.into());
1350        self
1351    }
1352    /// Begin date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or after this date. Format `2006-01-02`
1353    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1354        self.start_date = Some(start_date.into());
1355        self
1356    }
1357    /// End date for filtering income statements by fiscal date. Returns income statements with fiscal dates on or before this date. Format `2006-01-02`
1358    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1359        self.end_date = Some(end_date.into());
1360        self
1361    }
1362    /// Number of records in response
1363    pub fn outputsize(mut self, outputsize: i64) -> Self {
1364        self.outputsize = Some(outputsize);
1365        self
1366    }
1367
1368    /// Build the parameter struct
1369    pub fn build(self) -> GetIncomeStatementConsolidatedParams {
1370        GetIncomeStatementConsolidatedParams {
1371            symbol: self.symbol,
1372            figi: self.figi,
1373            isin: self.isin,
1374            cusip: self.cusip,
1375            exchange: self.exchange,
1376            mic_code: self.mic_code,
1377            country: self.country,
1378            period: self.period,
1379            start_date: self.start_date,
1380            end_date: self.end_date,
1381            outputsize: self.outputsize,
1382        }
1383    }
1384}
1385
1386/// struct for passing parameters to the method [`get_ipo_calendar`]
1387#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1388pub struct GetIpoCalendarParams {
1389    /// Exchange where instrument is traded
1390    pub exchange: Option<String>,
1391    /// Market Identifier Code (MIC) under ISO 10383 standard
1392    pub mic_code: Option<String>,
1393    /// Country where instrument is traded, e.g., `United States` or `US`
1394    pub country: Option<String>,
1395    /// The earliest IPO date to include in the results. Format: `2006-01-02`
1396    pub start_date: Option<String>,
1397    /// The latest IPO date to include in the results. Format: `2006-01-02`
1398    pub end_date: Option<String>,
1399}
1400
1401impl GetIpoCalendarParams {
1402    /// Create a new builder for this parameter struct
1403    pub fn builder() -> GetIpoCalendarParamsBuilder {
1404        GetIpoCalendarParamsBuilder::default()
1405    }
1406}
1407
1408/// Builder for [`GetIpoCalendarParams`]
1409#[derive(Clone, Debug, Default)]
1410pub struct GetIpoCalendarParamsBuilder {
1411    /// Exchange where instrument is traded
1412    exchange: Option<String>,
1413    /// Market Identifier Code (MIC) under ISO 10383 standard
1414    mic_code: Option<String>,
1415    /// Country where instrument is traded, e.g., `United States` or `US`
1416    country: Option<String>,
1417    /// The earliest IPO date to include in the results. Format: `2006-01-02`
1418    start_date: Option<String>,
1419    /// The latest IPO date to include in the results. Format: `2006-01-02`
1420    end_date: Option<String>,
1421}
1422
1423impl GetIpoCalendarParamsBuilder {
1424    /// Exchange where instrument is traded
1425    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1426        self.exchange = Some(exchange.into());
1427        self
1428    }
1429    /// Market Identifier Code (MIC) under ISO 10383 standard
1430    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1431        self.mic_code = Some(mic_code.into());
1432        self
1433    }
1434    /// Country where instrument is traded, e.g., `United States` or `US`
1435    pub fn country(mut self, country: impl Into<String>) -> Self {
1436        self.country = Some(country.into());
1437        self
1438    }
1439    /// The earliest IPO date to include in the results. Format: `2006-01-02`
1440    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1441        self.start_date = Some(start_date.into());
1442        self
1443    }
1444    /// The latest IPO date to include in the results. Format: `2006-01-02`
1445    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1446        self.end_date = Some(end_date.into());
1447        self
1448    }
1449
1450    /// Build the parameter struct
1451    pub fn build(self) -> GetIpoCalendarParams {
1452        GetIpoCalendarParams {
1453            exchange: self.exchange,
1454            mic_code: self.mic_code,
1455            country: self.country,
1456            start_date: self.start_date,
1457            end_date: self.end_date,
1458        }
1459    }
1460}
1461
1462/// struct for passing parameters to the method [`get_key_executives`]
1463#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1464pub struct GetKeyExecutivesParams {
1465    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1466    pub symbol: Option<String>,
1467    /// Filter by financial instrument global identifier (FIGI)
1468    pub figi: Option<String>,
1469    /// Filter by international securities identification number (ISIN)
1470    pub isin: Option<String>,
1471    /// 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
1472    pub cusip: Option<String>,
1473    /// Exchange where instrument is traded
1474    pub exchange: Option<String>,
1475    /// Market Identifier Code (MIC) under ISO 10383 standard
1476    pub mic_code: Option<String>,
1477    /// Country where instrument is traded, e.g., `United States` or `US`
1478    pub country: Option<String>,
1479}
1480
1481impl GetKeyExecutivesParams {
1482    /// Create a new builder for this parameter struct
1483    pub fn builder() -> GetKeyExecutivesParamsBuilder {
1484        GetKeyExecutivesParamsBuilder::default()
1485    }
1486}
1487
1488/// Builder for [`GetKeyExecutivesParams`]
1489#[derive(Clone, Debug, Default)]
1490pub struct GetKeyExecutivesParamsBuilder {
1491    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1492    symbol: Option<String>,
1493    /// Filter by financial instrument global identifier (FIGI)
1494    figi: Option<String>,
1495    /// Filter by international securities identification number (ISIN)
1496    isin: Option<String>,
1497    /// 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
1498    cusip: Option<String>,
1499    /// Exchange where instrument is traded
1500    exchange: Option<String>,
1501    /// Market Identifier Code (MIC) under ISO 10383 standard
1502    mic_code: Option<String>,
1503    /// Country where instrument is traded, e.g., `United States` or `US`
1504    country: Option<String>,
1505}
1506
1507impl GetKeyExecutivesParamsBuilder {
1508    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1509    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1510        self.symbol = Some(symbol.into());
1511        self
1512    }
1513    /// Filter by financial instrument global identifier (FIGI)
1514    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1515        self.figi = Some(figi.into());
1516        self
1517    }
1518    /// Filter by international securities identification number (ISIN)
1519    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1520        self.isin = Some(isin.into());
1521        self
1522    }
1523    /// 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
1524    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1525        self.cusip = Some(cusip.into());
1526        self
1527    }
1528    /// Exchange where instrument is traded
1529    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1530        self.exchange = Some(exchange.into());
1531        self
1532    }
1533    /// Market Identifier Code (MIC) under ISO 10383 standard
1534    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1535        self.mic_code = Some(mic_code.into());
1536        self
1537    }
1538    /// Country where instrument is traded, e.g., `United States` or `US`
1539    pub fn country(mut self, country: impl Into<String>) -> Self {
1540        self.country = Some(country.into());
1541        self
1542    }
1543
1544    /// Build the parameter struct
1545    pub fn build(self) -> GetKeyExecutivesParams {
1546        GetKeyExecutivesParams {
1547            symbol: self.symbol,
1548            figi: self.figi,
1549            isin: self.isin,
1550            cusip: self.cusip,
1551            exchange: self.exchange,
1552            mic_code: self.mic_code,
1553            country: self.country,
1554        }
1555    }
1556}
1557
1558/// struct for passing parameters to the method [`get_last_changes`]
1559#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1560pub struct GetLastChangesParams {
1561    /// Endpoint name
1562    pub endpoint: String,
1563    /// The starting date and time for data selection, in `2006-01-02T15:04:05` format
1564    pub start_date: Option<String>,
1565    /// Filter by symbol
1566    pub symbol: Option<String>,
1567    /// Filter by exchange name
1568    pub exchange: Option<String>,
1569    /// Filter by market identifier code (MIC) under ISO 10383 standard
1570    pub mic_code: Option<String>,
1571    /// Filter by country name or alpha code, e.g., `United States` or `US`
1572    pub country: Option<String>,
1573    /// Page number
1574    pub page: Option<i64>,
1575    /// Number of records in response
1576    pub outputsize: Option<i64>,
1577}
1578
1579impl GetLastChangesParams {
1580    /// Create a new builder for this parameter struct
1581    pub fn builder() -> GetLastChangesParamsBuilder {
1582        GetLastChangesParamsBuilder::default()
1583    }
1584}
1585
1586/// Builder for [`GetLastChangesParams`]
1587#[derive(Clone, Debug, Default)]
1588pub struct GetLastChangesParamsBuilder {
1589    /// Endpoint name
1590    endpoint: String,
1591    /// The starting date and time for data selection, in `2006-01-02T15:04:05` format
1592    start_date: Option<String>,
1593    /// Filter by symbol
1594    symbol: Option<String>,
1595    /// Filter by exchange name
1596    exchange: Option<String>,
1597    /// Filter by market identifier code (MIC) under ISO 10383 standard
1598    mic_code: Option<String>,
1599    /// Filter by country name or alpha code, e.g., `United States` or `US`
1600    country: Option<String>,
1601    /// Page number
1602    page: Option<i64>,
1603    /// Number of records in response
1604    outputsize: Option<i64>,
1605}
1606
1607impl GetLastChangesParamsBuilder {
1608    /// Endpoint name
1609    pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self {
1610        self.endpoint = endpoint.into();
1611        self
1612    }
1613    /// The starting date and time for data selection, in `2006-01-02T15:04:05` format
1614    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1615        self.start_date = Some(start_date.into());
1616        self
1617    }
1618    /// Filter by symbol
1619    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1620        self.symbol = Some(symbol.into());
1621        self
1622    }
1623    /// Filter by exchange name
1624    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1625        self.exchange = Some(exchange.into());
1626        self
1627    }
1628    /// Filter by market identifier code (MIC) under ISO 10383 standard
1629    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1630        self.mic_code = Some(mic_code.into());
1631        self
1632    }
1633    /// Filter by country name or alpha code, e.g., `United States` or `US`
1634    pub fn country(mut self, country: impl Into<String>) -> Self {
1635        self.country = Some(country.into());
1636        self
1637    }
1638    /// Page number
1639    pub fn page(mut self, page: i64) -> Self {
1640        self.page = Some(page);
1641        self
1642    }
1643    /// Number of records in response
1644    pub fn outputsize(mut self, outputsize: i64) -> Self {
1645        self.outputsize = Some(outputsize);
1646        self
1647    }
1648
1649    /// Build the parameter struct
1650    pub fn build(self) -> GetLastChangesParams {
1651        GetLastChangesParams {
1652            endpoint: self.endpoint,
1653            start_date: self.start_date,
1654            symbol: self.symbol,
1655            exchange: self.exchange,
1656            mic_code: self.mic_code,
1657            country: self.country,
1658            page: self.page,
1659            outputsize: self.outputsize,
1660        }
1661    }
1662}
1663
1664/// struct for passing parameters to the method [`get_logo`]
1665#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1666pub struct GetLogoParams {
1667    /// The ticker symbol of an instrument for which data is requested, e.g., `AAPL`, `BTC/USD`, `EUR/USD`.
1668    pub symbol: String,
1669    /// The exchange name where the instrument is traded, e.g., `NASDAQ`, `NSE`
1670    pub exchange: Option<String>,
1671    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded, e.g., `XNAS`, `XLON`
1672    pub mic_code: Option<String>,
1673    /// The country where the instrument is traded, e.g., `United States` or `US`
1674    pub country: Option<String>,
1675}
1676
1677impl GetLogoParams {
1678    /// Create a new builder for this parameter struct
1679    pub fn builder() -> GetLogoParamsBuilder {
1680        GetLogoParamsBuilder::default()
1681    }
1682}
1683
1684/// Builder for [`GetLogoParams`]
1685#[derive(Clone, Debug, Default)]
1686pub struct GetLogoParamsBuilder {
1687    /// The ticker symbol of an instrument for which data is requested, e.g., `AAPL`, `BTC/USD`, `EUR/USD`.
1688    symbol: String,
1689    /// The exchange name where the instrument is traded, e.g., `NASDAQ`, `NSE`
1690    exchange: Option<String>,
1691    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded, e.g., `XNAS`, `XLON`
1692    mic_code: Option<String>,
1693    /// The country where the instrument is traded, e.g., `United States` or `US`
1694    country: Option<String>,
1695}
1696
1697impl GetLogoParamsBuilder {
1698    /// The ticker symbol of an instrument for which data is requested, e.g., `AAPL`, `BTC/USD`, `EUR/USD`.
1699    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1700        self.symbol = symbol.into();
1701        self
1702    }
1703    /// The exchange name where the instrument is traded, e.g., `NASDAQ`, `NSE`
1704    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1705        self.exchange = Some(exchange.into());
1706        self
1707    }
1708    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded, e.g., `XNAS`, `XLON`
1709    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1710        self.mic_code = Some(mic_code.into());
1711        self
1712    }
1713    /// The country where the instrument is traded, e.g., `United States` or `US`
1714    pub fn country(mut self, country: impl Into<String>) -> Self {
1715        self.country = Some(country.into());
1716        self
1717    }
1718
1719    /// Build the parameter struct
1720    pub fn build(self) -> GetLogoParams {
1721        GetLogoParams {
1722            symbol: self.symbol,
1723            exchange: self.exchange,
1724            mic_code: self.mic_code,
1725            country: self.country,
1726        }
1727    }
1728}
1729
1730/// struct for passing parameters to the method [`get_market_cap`]
1731#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1732pub struct GetMarketCapParams {
1733    /// Filter by symbol
1734    pub symbol: Option<String>,
1735    /// Filter by financial instrument global identifier (FIGI)
1736    pub figi: Option<String>,
1737    /// Filter by international securities identification number (ISIN)
1738    pub isin: Option<String>,
1739    /// 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
1740    pub cusip: Option<String>,
1741    /// Filter by exchange name
1742    pub exchange: Option<String>,
1743    /// Filter by market identifier code (MIC) under ISO 10383 standard
1744    pub mic_code: Option<String>,
1745    /// Filter by country name or alpha code, e.g., `United States` or `US`
1746    pub country: Option<String>,
1747    /// Start date for market capitalization data retrieval. Data will be returned from this date onwards. Format `2006-01-02`
1748    pub start_date: Option<String>,
1749    /// End date for market capitalization data retrieval. Data will be returned up to and including this date. Format `2006-01-02`
1750    pub end_date: Option<String>,
1751    /// Page number
1752    pub page: Option<i64>,
1753    /// Number of records in response
1754    pub outputsize: Option<i64>,
1755}
1756
1757impl GetMarketCapParams {
1758    /// Create a new builder for this parameter struct
1759    pub fn builder() -> GetMarketCapParamsBuilder {
1760        GetMarketCapParamsBuilder::default()
1761    }
1762}
1763
1764/// Builder for [`GetMarketCapParams`]
1765#[derive(Clone, Debug, Default)]
1766pub struct GetMarketCapParamsBuilder {
1767    /// Filter by symbol
1768    symbol: Option<String>,
1769    /// Filter by financial instrument global identifier (FIGI)
1770    figi: Option<String>,
1771    /// Filter by international securities identification number (ISIN)
1772    isin: Option<String>,
1773    /// 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
1774    cusip: Option<String>,
1775    /// Filter by exchange name
1776    exchange: Option<String>,
1777    /// Filter by market identifier code (MIC) under ISO 10383 standard
1778    mic_code: Option<String>,
1779    /// Filter by country name or alpha code, e.g., `United States` or `US`
1780    country: Option<String>,
1781    /// Start date for market capitalization data retrieval. Data will be returned from this date onwards. Format `2006-01-02`
1782    start_date: Option<String>,
1783    /// End date for market capitalization data retrieval. Data will be returned up to and including this date. Format `2006-01-02`
1784    end_date: Option<String>,
1785    /// Page number
1786    page: Option<i64>,
1787    /// Number of records in response
1788    outputsize: Option<i64>,
1789}
1790
1791impl GetMarketCapParamsBuilder {
1792    /// Filter by symbol
1793    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1794        self.symbol = Some(symbol.into());
1795        self
1796    }
1797    /// Filter by financial instrument global identifier (FIGI)
1798    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1799        self.figi = Some(figi.into());
1800        self
1801    }
1802    /// Filter by international securities identification number (ISIN)
1803    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1804        self.isin = Some(isin.into());
1805        self
1806    }
1807    /// 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
1808    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1809        self.cusip = Some(cusip.into());
1810        self
1811    }
1812    /// Filter by exchange name
1813    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1814        self.exchange = Some(exchange.into());
1815        self
1816    }
1817    /// Filter by market identifier code (MIC) under ISO 10383 standard
1818    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1819        self.mic_code = Some(mic_code.into());
1820        self
1821    }
1822    /// Filter by country name or alpha code, e.g., `United States` or `US`
1823    pub fn country(mut self, country: impl Into<String>) -> Self {
1824        self.country = Some(country.into());
1825        self
1826    }
1827    /// Start date for market capitalization data retrieval. Data will be returned from this date onwards. Format `2006-01-02`
1828    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1829        self.start_date = Some(start_date.into());
1830        self
1831    }
1832    /// End date for market capitalization data retrieval. Data will be returned up to and including this date. Format `2006-01-02`
1833    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1834        self.end_date = Some(end_date.into());
1835        self
1836    }
1837    /// Page number
1838    pub fn page(mut self, page: i64) -> Self {
1839        self.page = Some(page);
1840        self
1841    }
1842    /// Number of records in response
1843    pub fn outputsize(mut self, outputsize: i64) -> Self {
1844        self.outputsize = Some(outputsize);
1845        self
1846    }
1847
1848    /// Build the parameter struct
1849    pub fn build(self) -> GetMarketCapParams {
1850        GetMarketCapParams {
1851            symbol: self.symbol,
1852            figi: self.figi,
1853            isin: self.isin,
1854            cusip: self.cusip,
1855            exchange: self.exchange,
1856            mic_code: self.mic_code,
1857            country: self.country,
1858            start_date: self.start_date,
1859            end_date: self.end_date,
1860            page: self.page,
1861            outputsize: self.outputsize,
1862        }
1863    }
1864}
1865
1866/// struct for passing parameters to the method [`get_profile`]
1867#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1868pub struct GetProfileParams {
1869    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1870    pub symbol: Option<String>,
1871    /// Filter by financial instrument global identifier (FIGI)
1872    pub figi: Option<String>,
1873    /// Filter by international securities identification number (ISIN)
1874    pub isin: Option<String>,
1875    /// 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
1876    pub cusip: Option<String>,
1877    /// Exchange where instrument is traded
1878    pub exchange: Option<String>,
1879    /// Market Identifier Code (MIC) under ISO 10383 standard
1880    pub mic_code: Option<String>,
1881    /// Country where instrument is traded, e.g., `United States` or `US`
1882    pub country: Option<String>,
1883}
1884
1885impl GetProfileParams {
1886    /// Create a new builder for this parameter struct
1887    pub fn builder() -> GetProfileParamsBuilder {
1888        GetProfileParamsBuilder::default()
1889    }
1890}
1891
1892/// Builder for [`GetProfileParams`]
1893#[derive(Clone, Debug, Default)]
1894pub struct GetProfileParamsBuilder {
1895    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1896    symbol: Option<String>,
1897    /// Filter by financial instrument global identifier (FIGI)
1898    figi: Option<String>,
1899    /// Filter by international securities identification number (ISIN)
1900    isin: Option<String>,
1901    /// 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
1902    cusip: Option<String>,
1903    /// Exchange where instrument is traded
1904    exchange: Option<String>,
1905    /// Market Identifier Code (MIC) under ISO 10383 standard
1906    mic_code: Option<String>,
1907    /// Country where instrument is traded, e.g., `United States` or `US`
1908    country: Option<String>,
1909}
1910
1911impl GetProfileParamsBuilder {
1912    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1913    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1914        self.symbol = Some(symbol.into());
1915        self
1916    }
1917    /// Filter by financial instrument global identifier (FIGI)
1918    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1919        self.figi = Some(figi.into());
1920        self
1921    }
1922    /// Filter by international securities identification number (ISIN)
1923    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1924        self.isin = Some(isin.into());
1925        self
1926    }
1927    /// 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
1928    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1929        self.cusip = Some(cusip.into());
1930        self
1931    }
1932    /// Exchange where instrument is traded
1933    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1934        self.exchange = Some(exchange.into());
1935        self
1936    }
1937    /// Market Identifier Code (MIC) under ISO 10383 standard
1938    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1939        self.mic_code = Some(mic_code.into());
1940        self
1941    }
1942    /// Country where instrument is traded, e.g., `United States` or `US`
1943    pub fn country(mut self, country: impl Into<String>) -> Self {
1944        self.country = Some(country.into());
1945        self
1946    }
1947
1948    /// Build the parameter struct
1949    pub fn build(self) -> GetProfileParams {
1950        GetProfileParams {
1951            symbol: self.symbol,
1952            figi: self.figi,
1953            isin: self.isin,
1954            cusip: self.cusip,
1955            exchange: self.exchange,
1956            mic_code: self.mic_code,
1957            country: self.country,
1958        }
1959    }
1960}
1961
1962/// struct for passing parameters to the method [`get_splits`]
1963#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1964pub struct GetSplitsParams {
1965    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1966    pub symbol: Option<String>,
1967    /// Filter by financial instrument global identifier (FIGI)
1968    pub figi: Option<String>,
1969    /// Filter by international securities identification number (ISIN)
1970    pub isin: Option<String>,
1971    /// 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
1972    pub cusip: Option<String>,
1973    /// Exchange where instrument is traded
1974    pub exchange: Option<String>,
1975    /// Market Identifier Code (MIC) under ISO 10383 standard
1976    pub mic_code: Option<String>,
1977    /// Country where instrument is traded, e.g., `United States` or `US`
1978    pub country: Option<String>,
1979    /// Range of data to be returned
1980    pub range: Option<String>,
1981    /// The starting date for data selection. Format `2006-01-02`
1982    pub start_date: Option<String>,
1983    /// The ending date for data selection. Format `2006-01-02`
1984    pub end_date: Option<String>,
1985}
1986
1987impl GetSplitsParams {
1988    /// Create a new builder for this parameter struct
1989    pub fn builder() -> GetSplitsParamsBuilder {
1990        GetSplitsParamsBuilder::default()
1991    }
1992}
1993
1994/// Builder for [`GetSplitsParams`]
1995#[derive(Clone, Debug, Default)]
1996pub struct GetSplitsParamsBuilder {
1997    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
1998    symbol: Option<String>,
1999    /// Filter by financial instrument global identifier (FIGI)
2000    figi: Option<String>,
2001    /// Filter by international securities identification number (ISIN)
2002    isin: Option<String>,
2003    /// 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
2004    cusip: Option<String>,
2005    /// Exchange where instrument is traded
2006    exchange: Option<String>,
2007    /// Market Identifier Code (MIC) under ISO 10383 standard
2008    mic_code: Option<String>,
2009    /// Country where instrument is traded, e.g., `United States` or `US`
2010    country: Option<String>,
2011    /// Range of data to be returned
2012    range: Option<String>,
2013    /// The starting date for data selection. Format `2006-01-02`
2014    start_date: Option<String>,
2015    /// The ending date for data selection. Format `2006-01-02`
2016    end_date: Option<String>,
2017}
2018
2019impl GetSplitsParamsBuilder {
2020    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2021    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
2022        self.symbol = Some(symbol.into());
2023        self
2024    }
2025    /// Filter by financial instrument global identifier (FIGI)
2026    pub fn figi(mut self, figi: impl Into<String>) -> Self {
2027        self.figi = Some(figi.into());
2028        self
2029    }
2030    /// Filter by international securities identification number (ISIN)
2031    pub fn isin(mut self, isin: impl Into<String>) -> Self {
2032        self.isin = Some(isin.into());
2033        self
2034    }
2035    /// 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
2036    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
2037        self.cusip = Some(cusip.into());
2038        self
2039    }
2040    /// Exchange where instrument is traded
2041    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
2042        self.exchange = Some(exchange.into());
2043        self
2044    }
2045    /// Market Identifier Code (MIC) under ISO 10383 standard
2046    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
2047        self.mic_code = Some(mic_code.into());
2048        self
2049    }
2050    /// Country where instrument is traded, e.g., `United States` or `US`
2051    pub fn country(mut self, country: impl Into<String>) -> Self {
2052        self.country = Some(country.into());
2053        self
2054    }
2055    /// Range of data to be returned
2056    pub fn range(mut self, range: impl Into<String>) -> Self {
2057        self.range = Some(range.into());
2058        self
2059    }
2060    /// The starting date for data selection. Format `2006-01-02`
2061    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
2062        self.start_date = Some(start_date.into());
2063        self
2064    }
2065    /// The ending date for data selection. Format `2006-01-02`
2066    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
2067        self.end_date = Some(end_date.into());
2068        self
2069    }
2070
2071    /// Build the parameter struct
2072    pub fn build(self) -> GetSplitsParams {
2073        GetSplitsParams {
2074            symbol: self.symbol,
2075            figi: self.figi,
2076            isin: self.isin,
2077            cusip: self.cusip,
2078            exchange: self.exchange,
2079            mic_code: self.mic_code,
2080            country: self.country,
2081            range: self.range,
2082            start_date: self.start_date,
2083            end_date: self.end_date,
2084        }
2085    }
2086}
2087
2088/// struct for passing parameters to the method [`get_splits_calendar`]
2089#[derive(Clone, Debug, Default, Serialize, Deserialize)]
2090pub struct GetSplitsCalendarParams {
2091    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2092    pub symbol: Option<String>,
2093    /// Filter by financial instrument global identifier (FIGI)
2094    pub figi: Option<String>,
2095    /// Filter by international securities identification number (ISIN)
2096    pub isin: Option<String>,
2097    /// 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
2098    pub cusip: Option<String>,
2099    /// Exchange where instrument is traded
2100    pub exchange: Option<String>,
2101    /// Market Identifier Code (MIC) under ISO 10383 standard
2102    pub mic_code: Option<String>,
2103    /// Country where instrument is traded, e.g., `United States` or `US`
2104    pub country: Option<String>,
2105    /// The starting date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2106    pub start_date: Option<String>,
2107    /// The ending date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2108    pub end_date: Option<String>,
2109    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
2110    pub outputsize: Option<i64>,
2111    /// Page number
2112    pub page: Option<String>,
2113}
2114
2115impl GetSplitsCalendarParams {
2116    /// Create a new builder for this parameter struct
2117    pub fn builder() -> GetSplitsCalendarParamsBuilder {
2118        GetSplitsCalendarParamsBuilder::default()
2119    }
2120}
2121
2122/// Builder for [`GetSplitsCalendarParams`]
2123#[derive(Clone, Debug, Default)]
2124pub struct GetSplitsCalendarParamsBuilder {
2125    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2126    symbol: Option<String>,
2127    /// Filter by financial instrument global identifier (FIGI)
2128    figi: Option<String>,
2129    /// Filter by international securities identification number (ISIN)
2130    isin: Option<String>,
2131    /// 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
2132    cusip: Option<String>,
2133    /// Exchange where instrument is traded
2134    exchange: Option<String>,
2135    /// Market Identifier Code (MIC) under ISO 10383 standard
2136    mic_code: Option<String>,
2137    /// Country where instrument is traded, e.g., `United States` or `US`
2138    country: Option<String>,
2139    /// The starting date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2140    start_date: Option<String>,
2141    /// The ending date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2142    end_date: Option<String>,
2143    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
2144    outputsize: Option<i64>,
2145    /// Page number
2146    page: Option<String>,
2147}
2148
2149impl GetSplitsCalendarParamsBuilder {
2150    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2151    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
2152        self.symbol = Some(symbol.into());
2153        self
2154    }
2155    /// Filter by financial instrument global identifier (FIGI)
2156    pub fn figi(mut self, figi: impl Into<String>) -> Self {
2157        self.figi = Some(figi.into());
2158        self
2159    }
2160    /// Filter by international securities identification number (ISIN)
2161    pub fn isin(mut self, isin: impl Into<String>) -> Self {
2162        self.isin = Some(isin.into());
2163        self
2164    }
2165    /// 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
2166    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
2167        self.cusip = Some(cusip.into());
2168        self
2169    }
2170    /// Exchange where instrument is traded
2171    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
2172        self.exchange = Some(exchange.into());
2173        self
2174    }
2175    /// Market Identifier Code (MIC) under ISO 10383 standard
2176    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
2177        self.mic_code = Some(mic_code.into());
2178        self
2179    }
2180    /// Country where instrument is traded, e.g., `United States` or `US`
2181    pub fn country(mut self, country: impl Into<String>) -> Self {
2182        self.country = Some(country.into());
2183        self
2184    }
2185    /// The starting date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2186    pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
2187        self.start_date = Some(start_date.into());
2188        self
2189    }
2190    /// The ending date (inclusive) for filtering split events in the calendar. Format `2006-01-02`
2191    pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
2192        self.end_date = Some(end_date.into());
2193        self
2194    }
2195    /// Number of data points to retrieve. Supports values in the range from `1` to `500`. Default `100` when no date parameters are set, otherwise set to maximum
2196    pub fn outputsize(mut self, outputsize: i64) -> Self {
2197        self.outputsize = Some(outputsize);
2198        self
2199    }
2200    /// Page number
2201    pub fn page(mut self, page: impl Into<String>) -> Self {
2202        self.page = Some(page.into());
2203        self
2204    }
2205
2206    /// Build the parameter struct
2207    pub fn build(self) -> GetSplitsCalendarParams {
2208        GetSplitsCalendarParams {
2209            symbol: self.symbol,
2210            figi: self.figi,
2211            isin: self.isin,
2212            cusip: self.cusip,
2213            exchange: self.exchange,
2214            mic_code: self.mic_code,
2215            country: self.country,
2216            start_date: self.start_date,
2217            end_date: self.end_date,
2218            outputsize: self.outputsize,
2219            page: self.page,
2220        }
2221    }
2222}
2223
2224/// struct for passing parameters to the method [`get_statistics`]
2225#[derive(Clone, Debug, Default, Serialize, Deserialize)]
2226pub struct GetStatisticsParams {
2227    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2228    pub symbol: Option<String>,
2229    /// Filter by financial instrument global identifier (FIGI)
2230    pub figi: Option<String>,
2231    /// Filter by international securities identification number (ISIN)
2232    pub isin: Option<String>,
2233    /// 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
2234    pub cusip: Option<String>,
2235    /// Exchange where instrument is traded
2236    pub exchange: Option<String>,
2237    /// Market Identifier Code (MIC) under ISO 10383 standard
2238    pub mic_code: Option<String>,
2239    /// Country where instrument is traded, e.g., `United States` or `US`
2240    pub country: Option<String>,
2241}
2242
2243impl GetStatisticsParams {
2244    /// Create a new builder for this parameter struct
2245    pub fn builder() -> GetStatisticsParamsBuilder {
2246        GetStatisticsParamsBuilder::default()
2247    }
2248}
2249
2250/// Builder for [`GetStatisticsParams`]
2251#[derive(Clone, Debug, Default)]
2252pub struct GetStatisticsParamsBuilder {
2253    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2254    symbol: Option<String>,
2255    /// Filter by financial instrument global identifier (FIGI)
2256    figi: Option<String>,
2257    /// Filter by international securities identification number (ISIN)
2258    isin: Option<String>,
2259    /// 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
2260    cusip: Option<String>,
2261    /// Exchange where instrument is traded
2262    exchange: Option<String>,
2263    /// Market Identifier Code (MIC) under ISO 10383 standard
2264    mic_code: Option<String>,
2265    /// Country where instrument is traded, e.g., `United States` or `US`
2266    country: Option<String>,
2267}
2268
2269impl GetStatisticsParamsBuilder {
2270    /// Symbol ticker of instrument. For preffered stocks use dot(.) delimiter. E.g. `BRK.A` or `BRK.B` will be correct
2271    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
2272        self.symbol = Some(symbol.into());
2273        self
2274    }
2275    /// Filter by financial instrument global identifier (FIGI)
2276    pub fn figi(mut self, figi: impl Into<String>) -> Self {
2277        self.figi = Some(figi.into());
2278        self
2279    }
2280    /// Filter by international securities identification number (ISIN)
2281    pub fn isin(mut self, isin: impl Into<String>) -> Self {
2282        self.isin = Some(isin.into());
2283        self
2284    }
2285    /// 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
2286    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
2287        self.cusip = Some(cusip.into());
2288        self
2289    }
2290    /// Exchange where instrument is traded
2291    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
2292        self.exchange = Some(exchange.into());
2293        self
2294    }
2295    /// Market Identifier Code (MIC) under ISO 10383 standard
2296    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
2297        self.mic_code = Some(mic_code.into());
2298        self
2299    }
2300    /// Country where instrument is traded, e.g., `United States` or `US`
2301    pub fn country(mut self, country: impl Into<String>) -> Self {
2302        self.country = Some(country.into());
2303        self
2304    }
2305
2306    /// Build the parameter struct
2307    pub fn build(self) -> GetStatisticsParams {
2308        GetStatisticsParams {
2309            symbol: self.symbol,
2310            figi: self.figi,
2311            isin: self.isin,
2312            cusip: self.cusip,
2313            exchange: self.exchange,
2314            mic_code: self.mic_code,
2315            country: self.country,
2316        }
2317    }
2318}
2319
2320/// struct for typed errors of method [`get_balance_sheet`]
2321#[derive(Debug, Clone, Serialize, Deserialize)]
2322#[serde(untagged)]
2323pub enum GetBalanceSheetError {
2324    UnknownValue(serde_json::Value),
2325}
2326
2327/// struct for typed errors of method [`get_balance_sheet_consolidated`]
2328#[derive(Debug, Clone, Serialize, Deserialize)]
2329#[serde(untagged)]
2330pub enum GetBalanceSheetConsolidatedError {
2331    UnknownValue(serde_json::Value),
2332}
2333
2334/// struct for typed errors of method [`get_cash_flow`]
2335#[derive(Debug, Clone, Serialize, Deserialize)]
2336#[serde(untagged)]
2337pub enum GetCashFlowError {
2338    UnknownValue(serde_json::Value),
2339}
2340
2341/// struct for typed errors of method [`get_cash_flow_consolidated`]
2342#[derive(Debug, Clone, Serialize, Deserialize)]
2343#[serde(untagged)]
2344pub enum GetCashFlowConsolidatedError {
2345    UnknownValue(serde_json::Value),
2346}
2347
2348/// struct for typed errors of method [`get_dividends`]
2349#[derive(Debug, Clone, Serialize, Deserialize)]
2350#[serde(untagged)]
2351pub enum GetDividendsError {
2352    UnknownValue(serde_json::Value),
2353}
2354
2355/// struct for typed errors of method [`get_dividends_calendar`]
2356#[derive(Debug, Clone, Serialize, Deserialize)]
2357#[serde(untagged)]
2358pub enum GetDividendsCalendarError {
2359    UnknownValue(serde_json::Value),
2360}
2361
2362/// struct for typed errors of method [`get_earnings`]
2363#[derive(Debug, Clone, Serialize, Deserialize)]
2364#[serde(untagged)]
2365pub enum GetEarningsError {
2366    UnknownValue(serde_json::Value),
2367}
2368
2369/// struct for typed errors of method [`get_earnings_calendar`]
2370#[derive(Debug, Clone, Serialize, Deserialize)]
2371#[serde(untagged)]
2372pub enum GetEarningsCalendarError {
2373    UnknownValue(serde_json::Value),
2374}
2375
2376/// struct for typed errors of method [`get_income_statement`]
2377#[derive(Debug, Clone, Serialize, Deserialize)]
2378#[serde(untagged)]
2379pub enum GetIncomeStatementError {
2380    UnknownValue(serde_json::Value),
2381}
2382
2383/// struct for typed errors of method [`get_income_statement_consolidated`]
2384#[derive(Debug, Clone, Serialize, Deserialize)]
2385#[serde(untagged)]
2386pub enum GetIncomeStatementConsolidatedError {
2387    UnknownValue(serde_json::Value),
2388}
2389
2390/// struct for typed errors of method [`get_ipo_calendar`]
2391#[derive(Debug, Clone, Serialize, Deserialize)]
2392#[serde(untagged)]
2393pub enum GetIpoCalendarError {
2394    UnknownValue(serde_json::Value),
2395}
2396
2397/// struct for typed errors of method [`get_key_executives`]
2398#[derive(Debug, Clone, Serialize, Deserialize)]
2399#[serde(untagged)]
2400pub enum GetKeyExecutivesError {
2401    UnknownValue(serde_json::Value),
2402}
2403
2404/// struct for typed errors of method [`get_last_changes`]
2405#[derive(Debug, Clone, Serialize, Deserialize)]
2406#[serde(untagged)]
2407pub enum GetLastChangesError {
2408    UnknownValue(serde_json::Value),
2409}
2410
2411/// struct for typed errors of method [`get_logo`]
2412#[derive(Debug, Clone, Serialize, Deserialize)]
2413#[serde(untagged)]
2414pub enum GetLogoError {
2415    UnknownValue(serde_json::Value),
2416}
2417
2418/// struct for typed errors of method [`get_market_cap`]
2419#[derive(Debug, Clone, Serialize, Deserialize)]
2420#[serde(untagged)]
2421pub enum GetMarketCapError {
2422    UnknownValue(serde_json::Value),
2423}
2424
2425/// struct for typed errors of method [`get_profile`]
2426#[derive(Debug, Clone, Serialize, Deserialize)]
2427#[serde(untagged)]
2428pub enum GetProfileError {
2429    UnknownValue(serde_json::Value),
2430}
2431
2432/// struct for typed errors of method [`get_splits`]
2433#[derive(Debug, Clone, Serialize, Deserialize)]
2434#[serde(untagged)]
2435pub enum GetSplitsError {
2436    UnknownValue(serde_json::Value),
2437}
2438
2439/// struct for typed errors of method [`get_splits_calendar`]
2440#[derive(Debug, Clone, Serialize, Deserialize)]
2441#[serde(untagged)]
2442pub enum GetSplitsCalendarError {
2443    UnknownValue(serde_json::Value),
2444}
2445
2446/// struct for typed errors of method [`get_statistics`]
2447#[derive(Debug, Clone, Serialize, Deserialize)]
2448#[serde(untagged)]
2449pub enum GetStatisticsError {
2450    UnknownValue(serde_json::Value),
2451}
2452
2453/// The balance sheet endpoint provides a detailed financial statement for a company, outlining its assets, liabilities, and shareholders' equity. This endpoint returns structured data that includes current and non-current assets, total liabilities, and equity figures, enabling users to assess a company's financial health and stability.
2454pub async fn get_balance_sheet(
2455    configuration: &configuration::Configuration,
2456    params: GetBalanceSheetParams,
2457) -> Result<models::GetBalanceSheetResponse, Error<GetBalanceSheetError>> {
2458    // Extract parameters from params struct
2459    let p_query_symbol = params.symbol;
2460    let p_query_figi = params.figi;
2461    let p_query_isin = params.isin;
2462    let p_query_cusip = params.cusip;
2463    let p_query_exchange = params.exchange;
2464    let p_query_mic_code = params.mic_code;
2465    let p_query_country = params.country;
2466    let p_query_period = params.period;
2467    let p_query_start_date = params.start_date;
2468    let p_query_end_date = params.end_date;
2469    let p_query_outputsize = params.outputsize;
2470
2471    let uri_str = format!("{}/balance_sheet", configuration.base_path);
2472    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2473
2474    if let Some(ref param_value) = p_query_symbol {
2475        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2476    }
2477    if let Some(ref param_value) = p_query_figi {
2478        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2479    }
2480    if let Some(ref param_value) = p_query_isin {
2481        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2482    }
2483    if let Some(ref param_value) = p_query_cusip {
2484        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2485    }
2486    if let Some(ref param_value) = p_query_exchange {
2487        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2488    }
2489    if let Some(ref param_value) = p_query_mic_code {
2490        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2491    }
2492    if let Some(ref param_value) = p_query_country {
2493        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2494    }
2495    if let Some(ref param_value) = p_query_period {
2496        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2497    }
2498    if let Some(ref param_value) = p_query_start_date {
2499        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2500    }
2501    if let Some(ref param_value) = p_query_end_date {
2502        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2503    }
2504    if let Some(ref param_value) = p_query_outputsize {
2505        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2506    }
2507    if let Some(ref user_agent) = configuration.user_agent {
2508        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2509    }
2510    if let Some(ref apikey) = configuration.api_key {
2511        let key = apikey.key.clone();
2512        let value = match apikey.prefix {
2513            Some(ref prefix) => format!("{} {}", prefix, key),
2514            None => key,
2515        };
2516        req_builder = req_builder.header("Authorization", value);
2517    };
2518
2519    let req = req_builder.build()?;
2520    let resp = configuration.client.execute(req).await?;
2521
2522    let status = resp.status();
2523    let content_type = resp
2524        .headers()
2525        .get("content-type")
2526        .and_then(|v| v.to_str().ok())
2527        .unwrap_or("application/octet-stream");
2528    let content_type = super::ContentType::from(content_type);
2529
2530    if !status.is_client_error() && !status.is_server_error() {
2531        let content = resp.text().await?;
2532        match content_type {
2533            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2534            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetBalanceSheetResponse`"))),
2535            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::GetBalanceSheetResponse`")))),
2536        }
2537    } else {
2538        let content = resp.text().await?;
2539        let entity: Option<GetBalanceSheetError> = serde_json::from_str(&content).ok();
2540        Err(Error::ResponseError(ResponseContent {
2541            status,
2542            content,
2543            entity,
2544        }))
2545    }
2546}
2547
2548/// The balance sheet consolidated endpoint provides a detailed overview of a company's raw balance sheet, including a comprehensive summary of its assets, liabilities, and shareholders' equity. This endpoint is useful for retrieving financial data that reflects the overall financial position of a company, allowing users to access critical information about its financial health and structure.
2549pub async fn get_balance_sheet_consolidated(
2550    configuration: &configuration::Configuration,
2551    params: GetBalanceSheetConsolidatedParams,
2552) -> Result<models::GetBalanceSheetConsolidatedResponse, Error<GetBalanceSheetConsolidatedError>> {
2553    // Extract parameters from params struct
2554    let p_query_symbol = params.symbol;
2555    let p_query_figi = params.figi;
2556    let p_query_isin = params.isin;
2557    let p_query_cusip = params.cusip;
2558    let p_query_exchange = params.exchange;
2559    let p_query_mic_code = params.mic_code;
2560    let p_query_country = params.country;
2561    let p_query_period = params.period;
2562    let p_query_start_date = params.start_date;
2563    let p_query_end_date = params.end_date;
2564    let p_query_outputsize = params.outputsize;
2565
2566    let uri_str = format!("{}/balance_sheet/consolidated", configuration.base_path);
2567    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2568
2569    if let Some(ref param_value) = p_query_symbol {
2570        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2571    }
2572    if let Some(ref param_value) = p_query_figi {
2573        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2574    }
2575    if let Some(ref param_value) = p_query_isin {
2576        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2577    }
2578    if let Some(ref param_value) = p_query_cusip {
2579        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2580    }
2581    if let Some(ref param_value) = p_query_exchange {
2582        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2583    }
2584    if let Some(ref param_value) = p_query_mic_code {
2585        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2586    }
2587    if let Some(ref param_value) = p_query_country {
2588        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2589    }
2590    if let Some(ref param_value) = p_query_period {
2591        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2592    }
2593    if let Some(ref param_value) = p_query_start_date {
2594        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2595    }
2596    if let Some(ref param_value) = p_query_end_date {
2597        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2598    }
2599    if let Some(ref param_value) = p_query_outputsize {
2600        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2601    }
2602    if let Some(ref user_agent) = configuration.user_agent {
2603        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2604    }
2605    if let Some(ref apikey) = configuration.api_key {
2606        let key = apikey.key.clone();
2607        let value = match apikey.prefix {
2608            Some(ref prefix) => format!("{} {}", prefix, key),
2609            None => key,
2610        };
2611        req_builder = req_builder.header("Authorization", value);
2612    };
2613
2614    let req = req_builder.build()?;
2615    let resp = configuration.client.execute(req).await?;
2616
2617    let status = resp.status();
2618    let content_type = resp
2619        .headers()
2620        .get("content-type")
2621        .and_then(|v| v.to_str().ok())
2622        .unwrap_or("application/octet-stream");
2623    let content_type = super::ContentType::from(content_type);
2624
2625    if !status.is_client_error() && !status.is_server_error() {
2626        let content = resp.text().await?;
2627        match content_type {
2628            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2629            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetBalanceSheetConsolidatedResponse`"))),
2630            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::GetBalanceSheetConsolidatedResponse`")))),
2631        }
2632    } else {
2633        let content = resp.text().await?;
2634        let entity: Option<GetBalanceSheetConsolidatedError> = serde_json::from_str(&content).ok();
2635        Err(Error::ResponseError(ResponseContent {
2636            status,
2637            content,
2638            entity,
2639        }))
2640    }
2641}
2642
2643/// The cash flow endpoint provides detailed information on a company's cash flow activities, including the net cash and cash equivalents moving in and out of the business. This data includes operating, investing, and financing cash flows, offering a comprehensive view of the company's liquidity and financial health.
2644pub async fn get_cash_flow(
2645    configuration: &configuration::Configuration,
2646    params: GetCashFlowParams,
2647) -> Result<models::GetCashFlowResponse, Error<GetCashFlowError>> {
2648    // Extract parameters from params struct
2649    let p_query_symbol = params.symbol;
2650    let p_query_figi = params.figi;
2651    let p_query_isin = params.isin;
2652    let p_query_cusip = params.cusip;
2653    let p_query_exchange = params.exchange;
2654    let p_query_mic_code = params.mic_code;
2655    let p_query_country = params.country;
2656    let p_query_period = params.period;
2657    let p_query_start_date = params.start_date;
2658    let p_query_end_date = params.end_date;
2659    let p_query_outputsize = params.outputsize;
2660
2661    let uri_str = format!("{}/cash_flow", configuration.base_path);
2662    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2663
2664    if let Some(ref param_value) = p_query_symbol {
2665        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2666    }
2667    if let Some(ref param_value) = p_query_figi {
2668        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2669    }
2670    if let Some(ref param_value) = p_query_isin {
2671        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2672    }
2673    if let Some(ref param_value) = p_query_cusip {
2674        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2675    }
2676    if let Some(ref param_value) = p_query_exchange {
2677        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2678    }
2679    if let Some(ref param_value) = p_query_mic_code {
2680        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2681    }
2682    if let Some(ref param_value) = p_query_country {
2683        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2684    }
2685    if let Some(ref param_value) = p_query_period {
2686        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2687    }
2688    if let Some(ref param_value) = p_query_start_date {
2689        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2690    }
2691    if let Some(ref param_value) = p_query_end_date {
2692        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2693    }
2694    if let Some(ref param_value) = p_query_outputsize {
2695        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2696    }
2697    if let Some(ref user_agent) = configuration.user_agent {
2698        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2699    }
2700    if let Some(ref apikey) = configuration.api_key {
2701        let key = apikey.key.clone();
2702        let value = match apikey.prefix {
2703            Some(ref prefix) => format!("{} {}", prefix, key),
2704            None => key,
2705        };
2706        req_builder = req_builder.header("Authorization", value);
2707    };
2708
2709    let req = req_builder.build()?;
2710    let resp = configuration.client.execute(req).await?;
2711
2712    let status = resp.status();
2713    let content_type = resp
2714        .headers()
2715        .get("content-type")
2716        .and_then(|v| v.to_str().ok())
2717        .unwrap_or("application/octet-stream");
2718    let content_type = super::ContentType::from(content_type);
2719
2720    if !status.is_client_error() && !status.is_server_error() {
2721        let content = resp.text().await?;
2722        match content_type {
2723            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2724            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCashFlowResponse`"))),
2725            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::GetCashFlowResponse`")))),
2726        }
2727    } else {
2728        let content = resp.text().await?;
2729        let entity: Option<GetCashFlowError> = serde_json::from_str(&content).ok();
2730        Err(Error::ResponseError(ResponseContent {
2731            status,
2732            content,
2733            entity,
2734        }))
2735    }
2736}
2737
2738/// The cash flow consolidated endpoint provides raw data on a company's consolidated cash flow, including the net cash and cash equivalents moving in and out of the business. It returns information on operating, investing, and financing activities, helping users track liquidity and financial health over a specified period.
2739pub async fn get_cash_flow_consolidated(
2740    configuration: &configuration::Configuration,
2741    params: GetCashFlowConsolidatedParams,
2742) -> Result<models::GetCashFlowConsolidatedResponse, Error<GetCashFlowConsolidatedError>> {
2743    // Extract parameters from params struct
2744    let p_query_symbol = params.symbol;
2745    let p_query_figi = params.figi;
2746    let p_query_isin = params.isin;
2747    let p_query_cusip = params.cusip;
2748    let p_query_exchange = params.exchange;
2749    let p_query_mic_code = params.mic_code;
2750    let p_query_country = params.country;
2751    let p_query_period = params.period;
2752    let p_query_start_date = params.start_date;
2753    let p_query_end_date = params.end_date;
2754    let p_query_outputsize = params.outputsize;
2755
2756    let uri_str = format!("{}/cash_flow/consolidated", configuration.base_path);
2757    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2758
2759    if let Some(ref param_value) = p_query_symbol {
2760        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2761    }
2762    if let Some(ref param_value) = p_query_figi {
2763        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2764    }
2765    if let Some(ref param_value) = p_query_isin {
2766        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2767    }
2768    if let Some(ref param_value) = p_query_cusip {
2769        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2770    }
2771    if let Some(ref param_value) = p_query_exchange {
2772        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2773    }
2774    if let Some(ref param_value) = p_query_mic_code {
2775        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2776    }
2777    if let Some(ref param_value) = p_query_country {
2778        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2779    }
2780    if let Some(ref param_value) = p_query_period {
2781        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2782    }
2783    if let Some(ref param_value) = p_query_start_date {
2784        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2785    }
2786    if let Some(ref param_value) = p_query_end_date {
2787        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2788    }
2789    if let Some(ref param_value) = p_query_outputsize {
2790        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2791    }
2792    if let Some(ref user_agent) = configuration.user_agent {
2793        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2794    }
2795    if let Some(ref apikey) = configuration.api_key {
2796        let key = apikey.key.clone();
2797        let value = match apikey.prefix {
2798            Some(ref prefix) => format!("{} {}", prefix, key),
2799            None => key,
2800        };
2801        req_builder = req_builder.header("Authorization", value);
2802    };
2803
2804    let req = req_builder.build()?;
2805    let resp = configuration.client.execute(req).await?;
2806
2807    let status = resp.status();
2808    let content_type = resp
2809        .headers()
2810        .get("content-type")
2811        .and_then(|v| v.to_str().ok())
2812        .unwrap_or("application/octet-stream");
2813    let content_type = super::ContentType::from(content_type);
2814
2815    if !status.is_client_error() && !status.is_server_error() {
2816        let content = resp.text().await?;
2817        match content_type {
2818            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2819            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCashFlowConsolidatedResponse`"))),
2820            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::GetCashFlowConsolidatedResponse`")))),
2821        }
2822    } else {
2823        let content = resp.text().await?;
2824        let entity: Option<GetCashFlowConsolidatedError> = serde_json::from_str(&content).ok();
2825        Err(Error::ResponseError(ResponseContent {
2826            status,
2827            content,
2828            entity,
2829        }))
2830    }
2831}
2832
2833/// The dividends endpoint provides historical dividend data for a specified stock, in many cases covering over a decade. It returns information on dividend payouts, including the amount, payment date, and frequency. This endpoint is ideal for users tracking dividend histories or evaluating the income potential of stocks.
2834pub async fn get_dividends(
2835    configuration: &configuration::Configuration,
2836    params: GetDividendsParams,
2837) -> Result<models::GetDividendsResponse, Error<GetDividendsError>> {
2838    // Extract parameters from params struct
2839    let p_query_symbol = params.symbol;
2840    let p_query_figi = params.figi;
2841    let p_query_isin = params.isin;
2842    let p_query_cusip = params.cusip;
2843    let p_query_exchange = params.exchange;
2844    let p_query_mic_code = params.mic_code;
2845    let p_query_country = params.country;
2846    let p_query_range = params.range;
2847    let p_query_start_date = params.start_date;
2848    let p_query_end_date = params.end_date;
2849    let p_query_adjust = params.adjust;
2850
2851    let uri_str = format!("{}/dividends", configuration.base_path);
2852    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2853
2854    if let Some(ref param_value) = p_query_symbol {
2855        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2856    }
2857    if let Some(ref param_value) = p_query_figi {
2858        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2859    }
2860    if let Some(ref param_value) = p_query_isin {
2861        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2862    }
2863    if let Some(ref param_value) = p_query_cusip {
2864        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2865    }
2866    if let Some(ref param_value) = p_query_exchange {
2867        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2868    }
2869    if let Some(ref param_value) = p_query_mic_code {
2870        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2871    }
2872    if let Some(ref param_value) = p_query_country {
2873        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2874    }
2875    if let Some(ref param_value) = p_query_range {
2876        req_builder = req_builder.query(&[("range", &param_value.to_string())]);
2877    }
2878    if let Some(ref param_value) = p_query_start_date {
2879        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2880    }
2881    if let Some(ref param_value) = p_query_end_date {
2882        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2883    }
2884    if let Some(ref param_value) = p_query_adjust {
2885        req_builder = req_builder.query(&[("adjust", &param_value.to_string())]);
2886    }
2887    if let Some(ref user_agent) = configuration.user_agent {
2888        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2889    }
2890    if let Some(ref apikey) = configuration.api_key {
2891        let key = apikey.key.clone();
2892        let value = match apikey.prefix {
2893            Some(ref prefix) => format!("{} {}", prefix, key),
2894            None => key,
2895        };
2896        req_builder = req_builder.header("Authorization", value);
2897    };
2898
2899    let req = req_builder.build()?;
2900    let resp = configuration.client.execute(req).await?;
2901
2902    let status = resp.status();
2903    let content_type = resp
2904        .headers()
2905        .get("content-type")
2906        .and_then(|v| v.to_str().ok())
2907        .unwrap_or("application/octet-stream");
2908    let content_type = super::ContentType::from(content_type);
2909
2910    if !status.is_client_error() && !status.is_server_error() {
2911        let content = resp.text().await?;
2912        match content_type {
2913            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2914            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetDividendsResponse`"))),
2915            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::GetDividendsResponse`")))),
2916        }
2917    } else {
2918        let content = resp.text().await?;
2919        let entity: Option<GetDividendsError> = serde_json::from_str(&content).ok();
2920        Err(Error::ResponseError(ResponseContent {
2921            status,
2922            content,
2923            entity,
2924        }))
2925    }
2926}
2927
2928/// The dividends calendar endpoint provides a detailed schedule of upcoming and past dividend events for specified date ranges. By using the `start_date` and `end_date` parameters, users can retrieve a list of companies issuing dividends, including the ex-dividend date, payment date, and dividend amount. This endpoint is ideal for tracking dividend payouts and planning investment strategies based on dividend schedules.
2929pub async fn get_dividends_calendar(
2930    configuration: &configuration::Configuration,
2931    params: GetDividendsCalendarParams,
2932) -> Result<models::GetDividendsCalendarResponse, Error<GetDividendsCalendarError>> {
2933    // Extract parameters from params struct
2934    let p_query_symbol = params.symbol;
2935    let p_query_figi = params.figi;
2936    let p_query_isin = params.isin;
2937    let p_query_cusip = params.cusip;
2938    let p_query_exchange = params.exchange;
2939    let p_query_mic_code = params.mic_code;
2940    let p_query_country = params.country;
2941    let p_query_start_date = params.start_date;
2942    let p_query_end_date = params.end_date;
2943    let p_query_outputsize = params.outputsize;
2944    let p_query_page = params.page;
2945
2946    let uri_str = format!("{}/dividends_calendar", configuration.base_path);
2947    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2948
2949    if let Some(ref param_value) = p_query_symbol {
2950        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2951    }
2952    if let Some(ref param_value) = p_query_figi {
2953        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2954    }
2955    if let Some(ref param_value) = p_query_isin {
2956        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2957    }
2958    if let Some(ref param_value) = p_query_cusip {
2959        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2960    }
2961    if let Some(ref param_value) = p_query_exchange {
2962        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2963    }
2964    if let Some(ref param_value) = p_query_mic_code {
2965        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2966    }
2967    if let Some(ref param_value) = p_query_country {
2968        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2969    }
2970    if let Some(ref param_value) = p_query_start_date {
2971        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2972    }
2973    if let Some(ref param_value) = p_query_end_date {
2974        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2975    }
2976    if let Some(ref param_value) = p_query_outputsize {
2977        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2978    }
2979    if let Some(ref param_value) = p_query_page {
2980        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2981    }
2982    if let Some(ref user_agent) = configuration.user_agent {
2983        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2984    }
2985    if let Some(ref apikey) = configuration.api_key {
2986        let key = apikey.key.clone();
2987        let value = match apikey.prefix {
2988            Some(ref prefix) => format!("{} {}", prefix, key),
2989            None => key,
2990        };
2991        req_builder = req_builder.header("Authorization", value);
2992    };
2993
2994    let req = req_builder.build()?;
2995    let resp = configuration.client.execute(req).await?;
2996
2997    let status = resp.status();
2998    let content_type = resp
2999        .headers()
3000        .get("content-type")
3001        .and_then(|v| v.to_str().ok())
3002        .unwrap_or("application/octet-stream");
3003    let content_type = super::ContentType::from(content_type);
3004
3005    if !status.is_client_error() && !status.is_server_error() {
3006        let content = resp.text().await?;
3007        match content_type {
3008            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3009            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetDividendsCalendarResponse`"))),
3010            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::GetDividendsCalendarResponse`")))),
3011        }
3012    } else {
3013        let content = resp.text().await?;
3014        let entity: Option<GetDividendsCalendarError> = serde_json::from_str(&content).ok();
3015        Err(Error::ResponseError(ResponseContent {
3016            status,
3017            content,
3018            entity,
3019        }))
3020    }
3021}
3022
3023/// The earnings endpoint provides comprehensive earnings data for a specified company, including both the estimated and actual Earnings Per Share (EPS) figures. This endpoint delivers historical earnings information, allowing users to track a company's financial performance over time.
3024pub async fn get_earnings(
3025    configuration: &configuration::Configuration,
3026    params: GetEarningsParams,
3027) -> Result<models::GetEarningsResponse, Error<GetEarningsError>> {
3028    // Extract parameters from params struct
3029    let p_query_symbol = params.symbol;
3030    let p_query_figi = params.figi;
3031    let p_query_isin = params.isin;
3032    let p_query_cusip = params.cusip;
3033    let p_query_exchange = params.exchange;
3034    let p_query_mic_code = params.mic_code;
3035    let p_query_country = params.country;
3036    let p_query_type = params.r#type;
3037    let p_query_period = params.period;
3038    let p_query_outputsize = params.outputsize;
3039    let p_query_format = params.format;
3040    let p_query_delimiter = params.delimiter;
3041    let p_query_start_date = params.start_date;
3042    let p_query_end_date = params.end_date;
3043    let p_query_dp = params.dp;
3044
3045    let uri_str = format!("{}/earnings", configuration.base_path);
3046    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3047
3048    if let Some(ref param_value) = p_query_symbol {
3049        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3050    }
3051    if let Some(ref param_value) = p_query_figi {
3052        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3053    }
3054    if let Some(ref param_value) = p_query_isin {
3055        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3056    }
3057    if let Some(ref param_value) = p_query_cusip {
3058        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3059    }
3060    if let Some(ref param_value) = p_query_exchange {
3061        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3062    }
3063    if let Some(ref param_value) = p_query_mic_code {
3064        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3065    }
3066    if let Some(ref param_value) = p_query_country {
3067        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3068    }
3069    if let Some(ref param_value) = p_query_type {
3070        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
3071    }
3072    if let Some(ref param_value) = p_query_period {
3073        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3074    }
3075    if let Some(ref param_value) = p_query_outputsize {
3076        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3077    }
3078    if let Some(ref param_value) = p_query_format {
3079        req_builder = req_builder.query(&[("format", &param_value.to_string())]);
3080    }
3081    if let Some(ref param_value) = p_query_delimiter {
3082        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
3083    }
3084    if let Some(ref param_value) = p_query_start_date {
3085        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3086    }
3087    if let Some(ref param_value) = p_query_end_date {
3088        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3089    }
3090    if let Some(ref param_value) = p_query_dp {
3091        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
3092    }
3093    if let Some(ref user_agent) = configuration.user_agent {
3094        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3095    }
3096    if let Some(ref apikey) = configuration.api_key {
3097        let key = apikey.key.clone();
3098        let value = match apikey.prefix {
3099            Some(ref prefix) => format!("{} {}", prefix, key),
3100            None => key,
3101        };
3102        req_builder = req_builder.header("Authorization", value);
3103    };
3104
3105    let req = req_builder.build()?;
3106    let resp = configuration.client.execute(req).await?;
3107
3108    let status = resp.status();
3109    let content_type = resp
3110        .headers()
3111        .get("content-type")
3112        .and_then(|v| v.to_str().ok())
3113        .unwrap_or("application/octet-stream");
3114    let content_type = super::ContentType::from(content_type);
3115
3116    if !status.is_client_error() && !status.is_server_error() {
3117        let content = resp.text().await?;
3118        match content_type {
3119            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3120            ContentType::Text => return Ok(models::GetEarningsResponse::Text(content)),
3121            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::GetEarningsResponse`")))),
3122        }
3123    } else {
3124        let content = resp.text().await?;
3125        let entity: Option<GetEarningsError> = serde_json::from_str(&content).ok();
3126        Err(Error::ResponseError(ResponseContent {
3127            status,
3128            content,
3129            entity,
3130        }))
3131    }
3132}
3133
3134/// The earnings calendar endpoint provides a schedule of company earnings announcements for a specified date range. By default, it returns earnings data for the current day. Users can customize the date range using the `start_date` and `end_date` parameters to retrieve earnings information for specific periods. This endpoint is useful for tracking upcoming earnings reports and planning around key financial announcements.
3135pub async fn get_earnings_calendar(
3136    configuration: &configuration::Configuration,
3137    params: GetEarningsCalendarParams,
3138) -> Result<models::GetEarningsCalendarResponse, Error<GetEarningsCalendarError>> {
3139    // Extract parameters from params struct
3140    let p_query_exchange = params.exchange;
3141    let p_query_mic_code = params.mic_code;
3142    let p_query_country = params.country;
3143    let p_query_format = params.format;
3144    let p_query_delimiter = params.delimiter;
3145    let p_query_start_date = params.start_date;
3146    let p_query_end_date = params.end_date;
3147    let p_query_dp = params.dp;
3148
3149    let uri_str = format!("{}/earnings_calendar", configuration.base_path);
3150    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3151
3152    if let Some(ref param_value) = p_query_exchange {
3153        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3154    }
3155    if let Some(ref param_value) = p_query_mic_code {
3156        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3157    }
3158    if let Some(ref param_value) = p_query_country {
3159        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3160    }
3161    if let Some(ref param_value) = p_query_format {
3162        req_builder = req_builder.query(&[("format", &param_value.to_string())]);
3163    }
3164    if let Some(ref param_value) = p_query_delimiter {
3165        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
3166    }
3167    if let Some(ref param_value) = p_query_start_date {
3168        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3169    }
3170    if let Some(ref param_value) = p_query_end_date {
3171        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3172    }
3173    if let Some(ref param_value) = p_query_dp {
3174        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
3175    }
3176    if let Some(ref user_agent) = configuration.user_agent {
3177        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3178    }
3179    if let Some(ref apikey) = configuration.api_key {
3180        let key = apikey.key.clone();
3181        let value = match apikey.prefix {
3182            Some(ref prefix) => format!("{} {}", prefix, key),
3183            None => key,
3184        };
3185        req_builder = req_builder.header("Authorization", value);
3186    };
3187
3188    let req = req_builder.build()?;
3189    let resp = configuration.client.execute(req).await?;
3190
3191    let status = resp.status();
3192    let content_type = resp
3193        .headers()
3194        .get("content-type")
3195        .and_then(|v| v.to_str().ok())
3196        .unwrap_or("application/octet-stream");
3197    let content_type = super::ContentType::from(content_type);
3198
3199    if !status.is_client_error() && !status.is_server_error() {
3200        let content = resp.text().await?;
3201        match content_type {
3202            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3203            ContentType::Text => return Ok(models::GetEarningsCalendarResponse::Text(content)),
3204            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::GetEarningsCalendarResponse`")))),
3205        }
3206    } else {
3207        let content = resp.text().await?;
3208        let entity: Option<GetEarningsCalendarError> = serde_json::from_str(&content).ok();
3209        Err(Error::ResponseError(ResponseContent {
3210            status,
3211            content,
3212            entity,
3213        }))
3214    }
3215}
3216
3217/// The income statement endpoint provides detailed financial data on a company's income statement, including revenues, expenses, and net income for specified periods, either annually or quarterly. This endpoint is essential for retrieving comprehensive financial performance metrics of a company, allowing users to access historical and current financial results.
3218pub async fn get_income_statement(
3219    configuration: &configuration::Configuration,
3220    params: GetIncomeStatementParams,
3221) -> Result<models::GetIncomeStatementResponse, Error<GetIncomeStatementError>> {
3222    // Extract parameters from params struct
3223    let p_query_symbol = params.symbol;
3224    let p_query_figi = params.figi;
3225    let p_query_isin = params.isin;
3226    let p_query_cusip = params.cusip;
3227    let p_query_exchange = params.exchange;
3228    let p_query_mic_code = params.mic_code;
3229    let p_query_country = params.country;
3230    let p_query_period = params.period;
3231    let p_query_start_date = params.start_date;
3232    let p_query_end_date = params.end_date;
3233    let p_query_outputsize = params.outputsize;
3234
3235    let uri_str = format!("{}/income_statement", configuration.base_path);
3236    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3237
3238    if let Some(ref param_value) = p_query_symbol {
3239        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3240    }
3241    if let Some(ref param_value) = p_query_figi {
3242        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3243    }
3244    if let Some(ref param_value) = p_query_isin {
3245        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3246    }
3247    if let Some(ref param_value) = p_query_cusip {
3248        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3249    }
3250    if let Some(ref param_value) = p_query_exchange {
3251        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3252    }
3253    if let Some(ref param_value) = p_query_mic_code {
3254        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3255    }
3256    if let Some(ref param_value) = p_query_country {
3257        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3258    }
3259    if let Some(ref param_value) = p_query_period {
3260        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3261    }
3262    if let Some(ref param_value) = p_query_start_date {
3263        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3264    }
3265    if let Some(ref param_value) = p_query_end_date {
3266        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3267    }
3268    if let Some(ref param_value) = p_query_outputsize {
3269        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3270    }
3271    if let Some(ref user_agent) = configuration.user_agent {
3272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3273    }
3274    if let Some(ref apikey) = configuration.api_key {
3275        let key = apikey.key.clone();
3276        let value = match apikey.prefix {
3277            Some(ref prefix) => format!("{} {}", prefix, key),
3278            None => key,
3279        };
3280        req_builder = req_builder.header("Authorization", value);
3281    };
3282
3283    let req = req_builder.build()?;
3284    let resp = configuration.client.execute(req).await?;
3285
3286    let status = resp.status();
3287    let content_type = resp
3288        .headers()
3289        .get("content-type")
3290        .and_then(|v| v.to_str().ok())
3291        .unwrap_or("application/octet-stream");
3292    let content_type = super::ContentType::from(content_type);
3293
3294    if !status.is_client_error() && !status.is_server_error() {
3295        let content = resp.text().await?;
3296        match content_type {
3297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3298            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIncomeStatementResponse`"))),
3299            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::GetIncomeStatementResponse`")))),
3300        }
3301    } else {
3302        let content = resp.text().await?;
3303        let entity: Option<GetIncomeStatementError> = serde_json::from_str(&content).ok();
3304        Err(Error::ResponseError(ResponseContent {
3305            status,
3306            content,
3307            entity,
3308        }))
3309    }
3310}
3311
3312/// The income statement consolidated endpoint provides a company's raw income statement, detailing revenue, expenses, and net income for specified periods, either annually or quarterly. This data is essential for evaluating a company's financial performance over time, allowing users to access comprehensive financial results in a structured format.
3313pub async fn get_income_statement_consolidated(
3314    configuration: &configuration::Configuration,
3315    params: GetIncomeStatementConsolidatedParams,
3316) -> Result<
3317    models::GetIncomeStatementConsolidatedResponse,
3318    Error<GetIncomeStatementConsolidatedError>,
3319> {
3320    // Extract parameters from params struct
3321    let p_query_symbol = params.symbol;
3322    let p_query_figi = params.figi;
3323    let p_query_isin = params.isin;
3324    let p_query_cusip = params.cusip;
3325    let p_query_exchange = params.exchange;
3326    let p_query_mic_code = params.mic_code;
3327    let p_query_country = params.country;
3328    let p_query_period = params.period;
3329    let p_query_start_date = params.start_date;
3330    let p_query_end_date = params.end_date;
3331    let p_query_outputsize = params.outputsize;
3332
3333    let uri_str = format!("{}/income_statement/consolidated", configuration.base_path);
3334    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3335
3336    if let Some(ref param_value) = p_query_symbol {
3337        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3338    }
3339    if let Some(ref param_value) = p_query_figi {
3340        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3341    }
3342    if let Some(ref param_value) = p_query_isin {
3343        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3344    }
3345    if let Some(ref param_value) = p_query_cusip {
3346        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3347    }
3348    if let Some(ref param_value) = p_query_exchange {
3349        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3350    }
3351    if let Some(ref param_value) = p_query_mic_code {
3352        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3353    }
3354    if let Some(ref param_value) = p_query_country {
3355        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3356    }
3357    if let Some(ref param_value) = p_query_period {
3358        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3359    }
3360    if let Some(ref param_value) = p_query_start_date {
3361        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3362    }
3363    if let Some(ref param_value) = p_query_end_date {
3364        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3365    }
3366    if let Some(ref param_value) = p_query_outputsize {
3367        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3368    }
3369    if let Some(ref user_agent) = configuration.user_agent {
3370        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3371    }
3372    if let Some(ref apikey) = configuration.api_key {
3373        let key = apikey.key.clone();
3374        let value = match apikey.prefix {
3375            Some(ref prefix) => format!("{} {}", prefix, key),
3376            None => key,
3377        };
3378        req_builder = req_builder.header("Authorization", value);
3379    };
3380
3381    let req = req_builder.build()?;
3382    let resp = configuration.client.execute(req).await?;
3383
3384    let status = resp.status();
3385    let content_type = resp
3386        .headers()
3387        .get("content-type")
3388        .and_then(|v| v.to_str().ok())
3389        .unwrap_or("application/octet-stream");
3390    let content_type = super::ContentType::from(content_type);
3391
3392    if !status.is_client_error() && !status.is_server_error() {
3393        let content = resp.text().await?;
3394        match content_type {
3395            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3396            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIncomeStatementConsolidatedResponse`"))),
3397            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::GetIncomeStatementConsolidatedResponse`")))),
3398        }
3399    } else {
3400        let content = resp.text().await?;
3401        let entity: Option<GetIncomeStatementConsolidatedError> =
3402            serde_json::from_str(&content).ok();
3403        Err(Error::ResponseError(ResponseContent {
3404            status,
3405            content,
3406            entity,
3407        }))
3408    }
3409}
3410
3411/// The IPO Calendar endpoint provides detailed information on initial public offerings (IPOs), including those that have occurred in the past, are happening today, or are scheduled for the future. Users can access data such as company names, IPO dates, and offering details, allowing them to track and monitor IPO activity efficiently.
3412pub async fn get_ipo_calendar(
3413    configuration: &configuration::Configuration,
3414    params: GetIpoCalendarParams,
3415) -> Result<models::GetIpoCalendarResponse, Error<GetIpoCalendarError>> {
3416    // Extract parameters from params struct
3417    let p_query_exchange = params.exchange;
3418    let p_query_mic_code = params.mic_code;
3419    let p_query_country = params.country;
3420    let p_query_start_date = params.start_date;
3421    let p_query_end_date = params.end_date;
3422
3423    let uri_str = format!("{}/ipo_calendar", configuration.base_path);
3424    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3425
3426    if let Some(ref param_value) = p_query_exchange {
3427        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3428    }
3429    if let Some(ref param_value) = p_query_mic_code {
3430        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3431    }
3432    if let Some(ref param_value) = p_query_country {
3433        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3434    }
3435    if let Some(ref param_value) = p_query_start_date {
3436        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3437    }
3438    if let Some(ref param_value) = p_query_end_date {
3439        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3440    }
3441    if let Some(ref user_agent) = configuration.user_agent {
3442        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3443    }
3444    if let Some(ref apikey) = configuration.api_key {
3445        let key = apikey.key.clone();
3446        let value = match apikey.prefix {
3447            Some(ref prefix) => format!("{} {}", prefix, key),
3448            None => key,
3449        };
3450        req_builder = req_builder.header("Authorization", value);
3451    };
3452
3453    let req = req_builder.build()?;
3454    let resp = configuration.client.execute(req).await?;
3455
3456    let status = resp.status();
3457    let content_type = resp
3458        .headers()
3459        .get("content-type")
3460        .and_then(|v| v.to_str().ok())
3461        .unwrap_or("application/octet-stream");
3462    let content_type = super::ContentType::from(content_type);
3463
3464    if !status.is_client_error() && !status.is_server_error() {
3465        let content = resp.text().await?;
3466        match content_type {
3467            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3468            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIpoCalendarResponse`"))),
3469            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::GetIpoCalendarResponse`")))),
3470        }
3471    } else {
3472        let content = resp.text().await?;
3473        let entity: Option<GetIpoCalendarError> = serde_json::from_str(&content).ok();
3474        Err(Error::ResponseError(ResponseContent {
3475            status,
3476            content,
3477            entity,
3478        }))
3479    }
3480}
3481
3482/// The key executives endpoint provides detailed information about a company's key executives identified by a specific stock symbol. It returns data such as names, titles, and roles of the executives, which can be useful for understanding the leadership structure of the company.
3483pub async fn get_key_executives(
3484    configuration: &configuration::Configuration,
3485    params: GetKeyExecutivesParams,
3486) -> Result<models::GetKeyExecutivesResponse, Error<GetKeyExecutivesError>> {
3487    // Extract parameters from params struct
3488    let p_query_symbol = params.symbol;
3489    let p_query_figi = params.figi;
3490    let p_query_isin = params.isin;
3491    let p_query_cusip = params.cusip;
3492    let p_query_exchange = params.exchange;
3493    let p_query_mic_code = params.mic_code;
3494    let p_query_country = params.country;
3495
3496    let uri_str = format!("{}/key_executives", configuration.base_path);
3497    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3498
3499    if let Some(ref param_value) = p_query_symbol {
3500        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3501    }
3502    if let Some(ref param_value) = p_query_figi {
3503        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3504    }
3505    if let Some(ref param_value) = p_query_isin {
3506        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3507    }
3508    if let Some(ref param_value) = p_query_cusip {
3509        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3510    }
3511    if let Some(ref param_value) = p_query_exchange {
3512        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3513    }
3514    if let Some(ref param_value) = p_query_mic_code {
3515        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3516    }
3517    if let Some(ref param_value) = p_query_country {
3518        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3519    }
3520    if let Some(ref user_agent) = configuration.user_agent {
3521        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3522    }
3523    if let Some(ref apikey) = configuration.api_key {
3524        let key = apikey.key.clone();
3525        let value = match apikey.prefix {
3526            Some(ref prefix) => format!("{} {}", prefix, key),
3527            None => key,
3528        };
3529        req_builder = req_builder.header("Authorization", value);
3530    };
3531
3532    let req = req_builder.build()?;
3533    let resp = configuration.client.execute(req).await?;
3534
3535    let status = resp.status();
3536    let content_type = resp
3537        .headers()
3538        .get("content-type")
3539        .and_then(|v| v.to_str().ok())
3540        .unwrap_or("application/octet-stream");
3541    let content_type = super::ContentType::from(content_type);
3542
3543    if !status.is_client_error() && !status.is_server_error() {
3544        let content = resp.text().await?;
3545        match content_type {
3546            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3547            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetKeyExecutivesResponse`"))),
3548            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::GetKeyExecutivesResponse`")))),
3549        }
3550    } else {
3551        let content = resp.text().await?;
3552        let entity: Option<GetKeyExecutivesError> = serde_json::from_str(&content).ok();
3553        Err(Error::ResponseError(ResponseContent {
3554            status,
3555            content,
3556            entity,
3557        }))
3558    }
3559}
3560
3561/// The last change endpoint provides the most recent updates to fundamental data for a specified dataset. It returns a timestamp indicating when the data was last modified, allowing users to efficiently manage API requests by only fetching new data when changes occur. This helps optimize data retrieval and reduce unnecessary API credit usage.
3562pub async fn get_last_changes(
3563    configuration: &configuration::Configuration,
3564    params: GetLastChangesParams,
3565) -> Result<models::GetLastChangesResponse, Error<GetLastChangesError>> {
3566    // Extract parameters from params struct
3567    let p_path_endpoint = params.endpoint;
3568    let p_query_start_date = params.start_date;
3569    let p_query_symbol = params.symbol;
3570    let p_query_exchange = params.exchange;
3571    let p_query_mic_code = params.mic_code;
3572    let p_query_country = params.country;
3573    let p_query_page = params.page;
3574    let p_query_outputsize = params.outputsize;
3575
3576    let uri_str = format!(
3577        "{}/last_change/{endpoint}",
3578        configuration.base_path,
3579        endpoint = crate::apis::urlencode(p_path_endpoint)
3580    );
3581    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3582
3583    if let Some(ref param_value) = p_query_start_date {
3584        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3585    }
3586    if let Some(ref param_value) = p_query_symbol {
3587        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3588    }
3589    if let Some(ref param_value) = p_query_exchange {
3590        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3591    }
3592    if let Some(ref param_value) = p_query_mic_code {
3593        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3594    }
3595    if let Some(ref param_value) = p_query_country {
3596        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3597    }
3598    if let Some(ref param_value) = p_query_page {
3599        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3600    }
3601    if let Some(ref param_value) = p_query_outputsize {
3602        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3603    }
3604    if let Some(ref user_agent) = configuration.user_agent {
3605        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3606    }
3607    if let Some(ref apikey) = configuration.api_key {
3608        let key = apikey.key.clone();
3609        let value = match apikey.prefix {
3610            Some(ref prefix) => format!("{} {}", prefix, key),
3611            None => key,
3612        };
3613        req_builder = req_builder.header("Authorization", value);
3614    };
3615
3616    let req = req_builder.build()?;
3617    let resp = configuration.client.execute(req).await?;
3618
3619    let status = resp.status();
3620    let content_type = resp
3621        .headers()
3622        .get("content-type")
3623        .and_then(|v| v.to_str().ok())
3624        .unwrap_or("application/octet-stream");
3625    let content_type = super::ContentType::from(content_type);
3626
3627    if !status.is_client_error() && !status.is_server_error() {
3628        let content = resp.text().await?;
3629        match content_type {
3630            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3631            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetLastChangesResponse`"))),
3632            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::GetLastChangesResponse`")))),
3633        }
3634    } else {
3635        let content = resp.text().await?;
3636        let entity: Option<GetLastChangesError> = serde_json::from_str(&content).ok();
3637        Err(Error::ResponseError(ResponseContent {
3638            status,
3639            content,
3640            entity,
3641        }))
3642    }
3643}
3644
3645/// The logo endpoint provides the official logo image for a specified company, cryptocurrency, or forex pair. This endpoint is useful for integrating visual branding elements into financial applications, websites, or reports, ensuring that users can easily identify and associate the correct logo with the respective financial asset.
3646pub async fn get_logo(
3647    configuration: &configuration::Configuration,
3648    params: GetLogoParams,
3649) -> Result<models::GetLogoResponse, Error<GetLogoError>> {
3650    // Extract parameters from params struct
3651    let p_query_symbol = params.symbol;
3652    let p_query_exchange = params.exchange;
3653    let p_query_mic_code = params.mic_code;
3654    let p_query_country = params.country;
3655
3656    let uri_str = format!("{}/logo", configuration.base_path);
3657    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3658
3659    req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3660    if let Some(ref param_value) = p_query_exchange {
3661        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3662    }
3663    if let Some(ref param_value) = p_query_mic_code {
3664        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3665    }
3666    if let Some(ref param_value) = p_query_country {
3667        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3668    }
3669    if let Some(ref user_agent) = configuration.user_agent {
3670        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3671    }
3672    if let Some(ref apikey) = configuration.api_key {
3673        let key = apikey.key.clone();
3674        let value = match apikey.prefix {
3675            Some(ref prefix) => format!("{} {}", prefix, key),
3676            None => key,
3677        };
3678        req_builder = req_builder.header("Authorization", value);
3679    };
3680
3681    let req = req_builder.build()?;
3682    let resp = configuration.client.execute(req).await?;
3683
3684    let status = resp.status();
3685    let content_type = resp
3686        .headers()
3687        .get("content-type")
3688        .and_then(|v| v.to_str().ok())
3689        .unwrap_or("application/octet-stream");
3690    let content_type = super::ContentType::from(content_type);
3691
3692    if !status.is_client_error() && !status.is_server_error() {
3693        let content = resp.text().await?;
3694        match content_type {
3695            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3696            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetLogoResponse`"))),
3697            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::GetLogoResponse`")))),
3698        }
3699    } else {
3700        let content = resp.text().await?;
3701        let entity: Option<GetLogoError> = serde_json::from_str(&content).ok();
3702        Err(Error::ResponseError(ResponseContent {
3703            status,
3704            content,
3705            entity,
3706        }))
3707    }
3708}
3709
3710/// The Market Capitalization History endpoint provides historical data on a company's market capitalization over a specified time period. It returns a time series of market cap values, allowing users to track changes in a company's market value.
3711pub async fn get_market_cap(
3712    configuration: &configuration::Configuration,
3713    params: GetMarketCapParams,
3714) -> Result<models::GetMarketCapResponse, Error<GetMarketCapError>> {
3715    // Extract parameters from params struct
3716    let p_query_symbol = params.symbol;
3717    let p_query_figi = params.figi;
3718    let p_query_isin = params.isin;
3719    let p_query_cusip = params.cusip;
3720    let p_query_exchange = params.exchange;
3721    let p_query_mic_code = params.mic_code;
3722    let p_query_country = params.country;
3723    let p_query_start_date = params.start_date;
3724    let p_query_end_date = params.end_date;
3725    let p_query_page = params.page;
3726    let p_query_outputsize = params.outputsize;
3727
3728    let uri_str = format!("{}/market_cap", configuration.base_path);
3729    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3730
3731    if let Some(ref param_value) = p_query_symbol {
3732        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3733    }
3734    if let Some(ref param_value) = p_query_figi {
3735        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3736    }
3737    if let Some(ref param_value) = p_query_isin {
3738        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3739    }
3740    if let Some(ref param_value) = p_query_cusip {
3741        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3742    }
3743    if let Some(ref param_value) = p_query_exchange {
3744        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3745    }
3746    if let Some(ref param_value) = p_query_mic_code {
3747        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3748    }
3749    if let Some(ref param_value) = p_query_country {
3750        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3751    }
3752    if let Some(ref param_value) = p_query_start_date {
3753        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3754    }
3755    if let Some(ref param_value) = p_query_end_date {
3756        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3757    }
3758    if let Some(ref param_value) = p_query_page {
3759        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3760    }
3761    if let Some(ref param_value) = p_query_outputsize {
3762        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3763    }
3764    if let Some(ref user_agent) = configuration.user_agent {
3765        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3766    }
3767    if let Some(ref apikey) = configuration.api_key {
3768        let key = apikey.key.clone();
3769        let value = match apikey.prefix {
3770            Some(ref prefix) => format!("{} {}", prefix, key),
3771            None => key,
3772        };
3773        req_builder = req_builder.header("Authorization", value);
3774    };
3775
3776    let req = req_builder.build()?;
3777    let resp = configuration.client.execute(req).await?;
3778
3779    let status = resp.status();
3780    let content_type = resp
3781        .headers()
3782        .get("content-type")
3783        .and_then(|v| v.to_str().ok())
3784        .unwrap_or("application/octet-stream");
3785    let content_type = super::ContentType::from(content_type);
3786
3787    if !status.is_client_error() && !status.is_server_error() {
3788        let content = resp.text().await?;
3789        match content_type {
3790            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3791            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMarketCapResponse`"))),
3792            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::GetMarketCapResponse`")))),
3793        }
3794    } else {
3795        let content = resp.text().await?;
3796        let entity: Option<GetMarketCapError> = serde_json::from_str(&content).ok();
3797        Err(Error::ResponseError(ResponseContent {
3798            status,
3799            content,
3800            entity,
3801        }))
3802    }
3803}
3804
3805/// The profile endpoint provides detailed company information, including the company's name, industry, sector, CEO, headquarters location, and market capitalization. This data is useful for obtaining a comprehensive overview of a company's business and financial standing.
3806pub async fn get_profile(
3807    configuration: &configuration::Configuration,
3808    params: GetProfileParams,
3809) -> Result<models::GetProfileResponse, Error<GetProfileError>> {
3810    // Extract parameters from params struct
3811    let p_query_symbol = params.symbol;
3812    let p_query_figi = params.figi;
3813    let p_query_isin = params.isin;
3814    let p_query_cusip = params.cusip;
3815    let p_query_exchange = params.exchange;
3816    let p_query_mic_code = params.mic_code;
3817    let p_query_country = params.country;
3818
3819    let uri_str = format!("{}/profile", configuration.base_path);
3820    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3821
3822    if let Some(ref param_value) = p_query_symbol {
3823        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3824    }
3825    if let Some(ref param_value) = p_query_figi {
3826        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3827    }
3828    if let Some(ref param_value) = p_query_isin {
3829        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3830    }
3831    if let Some(ref param_value) = p_query_cusip {
3832        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3833    }
3834    if let Some(ref param_value) = p_query_exchange {
3835        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3836    }
3837    if let Some(ref param_value) = p_query_mic_code {
3838        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3839    }
3840    if let Some(ref param_value) = p_query_country {
3841        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3842    }
3843    if let Some(ref user_agent) = configuration.user_agent {
3844        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3845    }
3846    if let Some(ref apikey) = configuration.api_key {
3847        let key = apikey.key.clone();
3848        let value = match apikey.prefix {
3849            Some(ref prefix) => format!("{} {}", prefix, key),
3850            None => key,
3851        };
3852        req_builder = req_builder.header("Authorization", value);
3853    };
3854
3855    let req = req_builder.build()?;
3856    let resp = configuration.client.execute(req).await?;
3857
3858    let status = resp.status();
3859    let content_type = resp
3860        .headers()
3861        .get("content-type")
3862        .and_then(|v| v.to_str().ok())
3863        .unwrap_or("application/octet-stream");
3864    let content_type = super::ContentType::from(content_type);
3865
3866    if !status.is_client_error() && !status.is_server_error() {
3867        let content = resp.text().await?;
3868        match content_type {
3869            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3870            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetProfileResponse`"))),
3871            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::GetProfileResponse`")))),
3872        }
3873    } else {
3874        let content = resp.text().await?;
3875        let entity: Option<GetProfileError> = serde_json::from_str(&content).ok();
3876        Err(Error::ResponseError(ResponseContent {
3877            status,
3878            content,
3879            entity,
3880        }))
3881    }
3882}
3883
3884/// The splits endpoint provides historical data on stock split events for a specified company. It returns details including the date of each split and the corresponding split factor.
3885pub async fn get_splits(
3886    configuration: &configuration::Configuration,
3887    params: GetSplitsParams,
3888) -> Result<models::GetSplitsResponse, Error<GetSplitsError>> {
3889    // Extract parameters from params struct
3890    let p_query_symbol = params.symbol;
3891    let p_query_figi = params.figi;
3892    let p_query_isin = params.isin;
3893    let p_query_cusip = params.cusip;
3894    let p_query_exchange = params.exchange;
3895    let p_query_mic_code = params.mic_code;
3896    let p_query_country = params.country;
3897    let p_query_range = params.range;
3898    let p_query_start_date = params.start_date;
3899    let p_query_end_date = params.end_date;
3900
3901    let uri_str = format!("{}/splits", configuration.base_path);
3902    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3903
3904    if let Some(ref param_value) = p_query_symbol {
3905        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3906    }
3907    if let Some(ref param_value) = p_query_figi {
3908        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3909    }
3910    if let Some(ref param_value) = p_query_isin {
3911        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3912    }
3913    if let Some(ref param_value) = p_query_cusip {
3914        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3915    }
3916    if let Some(ref param_value) = p_query_exchange {
3917        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3918    }
3919    if let Some(ref param_value) = p_query_mic_code {
3920        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3921    }
3922    if let Some(ref param_value) = p_query_country {
3923        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3924    }
3925    if let Some(ref param_value) = p_query_range {
3926        req_builder = req_builder.query(&[("range", &param_value.to_string())]);
3927    }
3928    if let Some(ref param_value) = p_query_start_date {
3929        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3930    }
3931    if let Some(ref param_value) = p_query_end_date {
3932        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3933    }
3934    if let Some(ref user_agent) = configuration.user_agent {
3935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3936    }
3937    if let Some(ref apikey) = configuration.api_key {
3938        let key = apikey.key.clone();
3939        let value = match apikey.prefix {
3940            Some(ref prefix) => format!("{} {}", prefix, key),
3941            None => key,
3942        };
3943        req_builder = req_builder.header("Authorization", value);
3944    };
3945
3946    let req = req_builder.build()?;
3947    let resp = configuration.client.execute(req).await?;
3948
3949    let status = resp.status();
3950    let content_type = resp
3951        .headers()
3952        .get("content-type")
3953        .and_then(|v| v.to_str().ok())
3954        .unwrap_or("application/octet-stream");
3955    let content_type = super::ContentType::from(content_type);
3956
3957    if !status.is_client_error() && !status.is_server_error() {
3958        let content = resp.text().await?;
3959        match content_type {
3960            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3961            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSplitsResponse`"))),
3962            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::GetSplitsResponse`")))),
3963        }
3964    } else {
3965        let content = resp.text().await?;
3966        let entity: Option<GetSplitsError> = serde_json::from_str(&content).ok();
3967        Err(Error::ResponseError(ResponseContent {
3968            status,
3969            content,
3970            entity,
3971        }))
3972    }
3973}
3974
3975/// The splits calendar endpoint provides a detailed calendar of stock split events within a specified date range. By setting the `start_date` and `end_date` parameters, users can retrieve a list of upcoming or past stock splits, including the company name, split ratio, and effective date. This endpoint is useful for tracking changes in stock structure and planning investment strategies around these events.
3976pub async fn get_splits_calendar(
3977    configuration: &configuration::Configuration,
3978    params: GetSplitsCalendarParams,
3979) -> Result<models::GetSplitsCalendarResponse, Error<GetSplitsCalendarError>> {
3980    // Extract parameters from params struct
3981    let p_query_symbol = params.symbol;
3982    let p_query_figi = params.figi;
3983    let p_query_isin = params.isin;
3984    let p_query_cusip = params.cusip;
3985    let p_query_exchange = params.exchange;
3986    let p_query_mic_code = params.mic_code;
3987    let p_query_country = params.country;
3988    let p_query_start_date = params.start_date;
3989    let p_query_end_date = params.end_date;
3990    let p_query_outputsize = params.outputsize;
3991    let p_query_page = params.page;
3992
3993    let uri_str = format!("{}/splits_calendar", configuration.base_path);
3994    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3995
3996    if let Some(ref param_value) = p_query_symbol {
3997        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3998    }
3999    if let Some(ref param_value) = p_query_figi {
4000        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
4001    }
4002    if let Some(ref param_value) = p_query_isin {
4003        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
4004    }
4005    if let Some(ref param_value) = p_query_cusip {
4006        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
4007    }
4008    if let Some(ref param_value) = p_query_exchange {
4009        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
4010    }
4011    if let Some(ref param_value) = p_query_mic_code {
4012        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
4013    }
4014    if let Some(ref param_value) = p_query_country {
4015        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
4016    }
4017    if let Some(ref param_value) = p_query_start_date {
4018        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
4019    }
4020    if let Some(ref param_value) = p_query_end_date {
4021        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
4022    }
4023    if let Some(ref param_value) = p_query_outputsize {
4024        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
4025    }
4026    if let Some(ref param_value) = p_query_page {
4027        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4028    }
4029    if let Some(ref user_agent) = configuration.user_agent {
4030        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4031    }
4032    if let Some(ref apikey) = configuration.api_key {
4033        let key = apikey.key.clone();
4034        let value = match apikey.prefix {
4035            Some(ref prefix) => format!("{} {}", prefix, key),
4036            None => key,
4037        };
4038        req_builder = req_builder.header("Authorization", value);
4039    };
4040
4041    let req = req_builder.build()?;
4042    let resp = configuration.client.execute(req).await?;
4043
4044    let status = resp.status();
4045    let content_type = resp
4046        .headers()
4047        .get("content-type")
4048        .and_then(|v| v.to_str().ok())
4049        .unwrap_or("application/octet-stream");
4050    let content_type = super::ContentType::from(content_type);
4051
4052    if !status.is_client_error() && !status.is_server_error() {
4053        let content = resp.text().await?;
4054        match content_type {
4055            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4056            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSplitsCalendarResponse`"))),
4057            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::GetSplitsCalendarResponse`")))),
4058        }
4059    } else {
4060        let content = resp.text().await?;
4061        let entity: Option<GetSplitsCalendarError> = serde_json::from_str(&content).ok();
4062        Err(Error::ResponseError(ResponseContent {
4063            status,
4064            content,
4065            entity,
4066        }))
4067    }
4068}
4069
4070/// The statistics endpoint provides a comprehensive snapshot of a company's key financial statistics, including valuation metrics, revenue figures, profit margins, and other essential financial data. This endpoint is ideal for users seeking detailed insights into a company's financial health and performance metrics.
4071pub async fn get_statistics(
4072    configuration: &configuration::Configuration,
4073    params: GetStatisticsParams,
4074) -> Result<models::GetStatisticsResponse, Error<GetStatisticsError>> {
4075    // Extract parameters from params struct
4076    let p_query_symbol = params.symbol;
4077    let p_query_figi = params.figi;
4078    let p_query_isin = params.isin;
4079    let p_query_cusip = params.cusip;
4080    let p_query_exchange = params.exchange;
4081    let p_query_mic_code = params.mic_code;
4082    let p_query_country = params.country;
4083
4084    let uri_str = format!("{}/statistics", configuration.base_path);
4085    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4086
4087    if let Some(ref param_value) = p_query_symbol {
4088        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
4089    }
4090    if let Some(ref param_value) = p_query_figi {
4091        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
4092    }
4093    if let Some(ref param_value) = p_query_isin {
4094        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
4095    }
4096    if let Some(ref param_value) = p_query_cusip {
4097        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
4098    }
4099    if let Some(ref param_value) = p_query_exchange {
4100        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
4101    }
4102    if let Some(ref param_value) = p_query_mic_code {
4103        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
4104    }
4105    if let Some(ref param_value) = p_query_country {
4106        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
4107    }
4108    if let Some(ref user_agent) = configuration.user_agent {
4109        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4110    }
4111    if let Some(ref apikey) = configuration.api_key {
4112        let key = apikey.key.clone();
4113        let value = match apikey.prefix {
4114            Some(ref prefix) => format!("{} {}", prefix, key),
4115            None => key,
4116        };
4117        req_builder = req_builder.header("Authorization", value);
4118    };
4119
4120    let req = req_builder.build()?;
4121    let resp = configuration.client.execute(req).await?;
4122
4123    let status = resp.status();
4124    let content_type = resp
4125        .headers()
4126        .get("content-type")
4127        .and_then(|v| v.to_str().ok())
4128        .unwrap_or("application/octet-stream");
4129    let content_type = super::ContentType::from(content_type);
4130
4131    if !status.is_client_error() && !status.is_server_error() {
4132        let content = resp.text().await?;
4133        match content_type {
4134            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4135            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetStatisticsResponse`"))),
4136            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::GetStatisticsResponse`")))),
4137        }
4138    } else {
4139        let content = resp.text().await?;
4140        let entity: Option<GetStatisticsError> = serde_json::from_str(&content).ok();
4141        Err(Error::ResponseError(ResponseContent {
4142            status,
4143            content,
4144            entity,
4145        }))
4146    }
4147}