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::GetBalanceSheet200ResponseEnum, 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::GetBalanceSheet200ResponseEnum`"))),
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::GetBalanceSheet200ResponseEnum`")))),
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<
2553    models::GetBalanceSheetConsolidated200ResponseEnum,
2554    Error<GetBalanceSheetConsolidatedError>,
2555> {
2556    // Extract parameters from params struct
2557    let p_query_symbol = params.symbol;
2558    let p_query_figi = params.figi;
2559    let p_query_isin = params.isin;
2560    let p_query_cusip = params.cusip;
2561    let p_query_exchange = params.exchange;
2562    let p_query_mic_code = params.mic_code;
2563    let p_query_country = params.country;
2564    let p_query_period = params.period;
2565    let p_query_start_date = params.start_date;
2566    let p_query_end_date = params.end_date;
2567    let p_query_outputsize = params.outputsize;
2568
2569    let uri_str = format!("{}/balance_sheet/consolidated", configuration.base_path);
2570    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2571
2572    if let Some(ref param_value) = p_query_symbol {
2573        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2574    }
2575    if let Some(ref param_value) = p_query_figi {
2576        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2577    }
2578    if let Some(ref param_value) = p_query_isin {
2579        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2580    }
2581    if let Some(ref param_value) = p_query_cusip {
2582        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2583    }
2584    if let Some(ref param_value) = p_query_exchange {
2585        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2586    }
2587    if let Some(ref param_value) = p_query_mic_code {
2588        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2589    }
2590    if let Some(ref param_value) = p_query_country {
2591        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2592    }
2593    if let Some(ref param_value) = p_query_period {
2594        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2595    }
2596    if let Some(ref param_value) = p_query_start_date {
2597        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2598    }
2599    if let Some(ref param_value) = p_query_end_date {
2600        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2601    }
2602    if let Some(ref param_value) = p_query_outputsize {
2603        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2604    }
2605    if let Some(ref user_agent) = configuration.user_agent {
2606        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2607    }
2608    if let Some(ref apikey) = configuration.api_key {
2609        let key = apikey.key.clone();
2610        let value = match apikey.prefix {
2611            Some(ref prefix) => format!("{} {}", prefix, key),
2612            None => key,
2613        };
2614        req_builder = req_builder.header("Authorization", value);
2615    };
2616
2617    let req = req_builder.build()?;
2618    let resp = configuration.client.execute(req).await?;
2619
2620    let status = resp.status();
2621    let content_type = resp
2622        .headers()
2623        .get("content-type")
2624        .and_then(|v| v.to_str().ok())
2625        .unwrap_or("application/octet-stream");
2626    let content_type = super::ContentType::from(content_type);
2627
2628    if !status.is_client_error() && !status.is_server_error() {
2629        let content = resp.text().await?;
2630        match content_type {
2631            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2632            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetBalanceSheetConsolidated200ResponseEnum`"))),
2633            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::GetBalanceSheetConsolidated200ResponseEnum`")))),
2634        }
2635    } else {
2636        let content = resp.text().await?;
2637        let entity: Option<GetBalanceSheetConsolidatedError> = serde_json::from_str(&content).ok();
2638        Err(Error::ResponseError(ResponseContent {
2639            status,
2640            content,
2641            entity,
2642        }))
2643    }
2644}
2645
2646/// 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.
2647pub async fn get_cash_flow(
2648    configuration: &configuration::Configuration,
2649    params: GetCashFlowParams,
2650) -> Result<models::GetCashFlow200ResponseEnum, Error<GetCashFlowError>> {
2651    // Extract parameters from params struct
2652    let p_query_symbol = params.symbol;
2653    let p_query_figi = params.figi;
2654    let p_query_isin = params.isin;
2655    let p_query_cusip = params.cusip;
2656    let p_query_exchange = params.exchange;
2657    let p_query_mic_code = params.mic_code;
2658    let p_query_country = params.country;
2659    let p_query_period = params.period;
2660    let p_query_start_date = params.start_date;
2661    let p_query_end_date = params.end_date;
2662    let p_query_outputsize = params.outputsize;
2663
2664    let uri_str = format!("{}/cash_flow", configuration.base_path);
2665    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2666
2667    if let Some(ref param_value) = p_query_symbol {
2668        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2669    }
2670    if let Some(ref param_value) = p_query_figi {
2671        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2672    }
2673    if let Some(ref param_value) = p_query_isin {
2674        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2675    }
2676    if let Some(ref param_value) = p_query_cusip {
2677        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2678    }
2679    if let Some(ref param_value) = p_query_exchange {
2680        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2681    }
2682    if let Some(ref param_value) = p_query_mic_code {
2683        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2684    }
2685    if let Some(ref param_value) = p_query_country {
2686        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2687    }
2688    if let Some(ref param_value) = p_query_period {
2689        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2690    }
2691    if let Some(ref param_value) = p_query_start_date {
2692        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2693    }
2694    if let Some(ref param_value) = p_query_end_date {
2695        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2696    }
2697    if let Some(ref param_value) = p_query_outputsize {
2698        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2699    }
2700    if let Some(ref user_agent) = configuration.user_agent {
2701        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2702    }
2703    if let Some(ref apikey) = configuration.api_key {
2704        let key = apikey.key.clone();
2705        let value = match apikey.prefix {
2706            Some(ref prefix) => format!("{} {}", prefix, key),
2707            None => key,
2708        };
2709        req_builder = req_builder.header("Authorization", value);
2710    };
2711
2712    let req = req_builder.build()?;
2713    let resp = configuration.client.execute(req).await?;
2714
2715    let status = resp.status();
2716    let content_type = resp
2717        .headers()
2718        .get("content-type")
2719        .and_then(|v| v.to_str().ok())
2720        .unwrap_or("application/octet-stream");
2721    let content_type = super::ContentType::from(content_type);
2722
2723    if !status.is_client_error() && !status.is_server_error() {
2724        let content = resp.text().await?;
2725        match content_type {
2726            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2727            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCashFlow200ResponseEnum`"))),
2728            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::GetCashFlow200ResponseEnum`")))),
2729        }
2730    } else {
2731        let content = resp.text().await?;
2732        let entity: Option<GetCashFlowError> = serde_json::from_str(&content).ok();
2733        Err(Error::ResponseError(ResponseContent {
2734            status,
2735            content,
2736            entity,
2737        }))
2738    }
2739}
2740
2741/// 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.
2742pub async fn get_cash_flow_consolidated(
2743    configuration: &configuration::Configuration,
2744    params: GetCashFlowConsolidatedParams,
2745) -> Result<models::GetCashFlowConsolidated200ResponseEnum, Error<GetCashFlowConsolidatedError>> {
2746    // Extract parameters from params struct
2747    let p_query_symbol = params.symbol;
2748    let p_query_figi = params.figi;
2749    let p_query_isin = params.isin;
2750    let p_query_cusip = params.cusip;
2751    let p_query_exchange = params.exchange;
2752    let p_query_mic_code = params.mic_code;
2753    let p_query_country = params.country;
2754    let p_query_period = params.period;
2755    let p_query_start_date = params.start_date;
2756    let p_query_end_date = params.end_date;
2757    let p_query_outputsize = params.outputsize;
2758
2759    let uri_str = format!("{}/cash_flow/consolidated", configuration.base_path);
2760    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2761
2762    if let Some(ref param_value) = p_query_symbol {
2763        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2764    }
2765    if let Some(ref param_value) = p_query_figi {
2766        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2767    }
2768    if let Some(ref param_value) = p_query_isin {
2769        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2770    }
2771    if let Some(ref param_value) = p_query_cusip {
2772        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2773    }
2774    if let Some(ref param_value) = p_query_exchange {
2775        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2776    }
2777    if let Some(ref param_value) = p_query_mic_code {
2778        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2779    }
2780    if let Some(ref param_value) = p_query_country {
2781        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2782    }
2783    if let Some(ref param_value) = p_query_period {
2784        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
2785    }
2786    if let Some(ref param_value) = p_query_start_date {
2787        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2788    }
2789    if let Some(ref param_value) = p_query_end_date {
2790        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2791    }
2792    if let Some(ref param_value) = p_query_outputsize {
2793        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2794    }
2795    if let Some(ref user_agent) = configuration.user_agent {
2796        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2797    }
2798    if let Some(ref apikey) = configuration.api_key {
2799        let key = apikey.key.clone();
2800        let value = match apikey.prefix {
2801            Some(ref prefix) => format!("{} {}", prefix, key),
2802            None => key,
2803        };
2804        req_builder = req_builder.header("Authorization", value);
2805    };
2806
2807    let req = req_builder.build()?;
2808    let resp = configuration.client.execute(req).await?;
2809
2810    let status = resp.status();
2811    let content_type = resp
2812        .headers()
2813        .get("content-type")
2814        .and_then(|v| v.to_str().ok())
2815        .unwrap_or("application/octet-stream");
2816    let content_type = super::ContentType::from(content_type);
2817
2818    if !status.is_client_error() && !status.is_server_error() {
2819        let content = resp.text().await?;
2820        match content_type {
2821            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2822            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCashFlowConsolidated200ResponseEnum`"))),
2823            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::GetCashFlowConsolidated200ResponseEnum`")))),
2824        }
2825    } else {
2826        let content = resp.text().await?;
2827        let entity: Option<GetCashFlowConsolidatedError> = serde_json::from_str(&content).ok();
2828        Err(Error::ResponseError(ResponseContent {
2829            status,
2830            content,
2831            entity,
2832        }))
2833    }
2834}
2835
2836/// 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.
2837pub async fn get_dividends(
2838    configuration: &configuration::Configuration,
2839    params: GetDividendsParams,
2840) -> Result<models::GetDividends200ResponseEnum, Error<GetDividendsError>> {
2841    // Extract parameters from params struct
2842    let p_query_symbol = params.symbol;
2843    let p_query_figi = params.figi;
2844    let p_query_isin = params.isin;
2845    let p_query_cusip = params.cusip;
2846    let p_query_exchange = params.exchange;
2847    let p_query_mic_code = params.mic_code;
2848    let p_query_country = params.country;
2849    let p_query_range = params.range;
2850    let p_query_start_date = params.start_date;
2851    let p_query_end_date = params.end_date;
2852    let p_query_adjust = params.adjust;
2853
2854    let uri_str = format!("{}/dividends", configuration.base_path);
2855    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2856
2857    if let Some(ref param_value) = p_query_symbol {
2858        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2859    }
2860    if let Some(ref param_value) = p_query_figi {
2861        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2862    }
2863    if let Some(ref param_value) = p_query_isin {
2864        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2865    }
2866    if let Some(ref param_value) = p_query_cusip {
2867        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2868    }
2869    if let Some(ref param_value) = p_query_exchange {
2870        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2871    }
2872    if let Some(ref param_value) = p_query_mic_code {
2873        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2874    }
2875    if let Some(ref param_value) = p_query_country {
2876        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2877    }
2878    if let Some(ref param_value) = p_query_range {
2879        req_builder = req_builder.query(&[("range", &param_value.to_string())]);
2880    }
2881    if let Some(ref param_value) = p_query_start_date {
2882        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2883    }
2884    if let Some(ref param_value) = p_query_end_date {
2885        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2886    }
2887    if let Some(ref param_value) = p_query_adjust {
2888        req_builder = req_builder.query(&[("adjust", &param_value.to_string())]);
2889    }
2890    if let Some(ref user_agent) = configuration.user_agent {
2891        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2892    }
2893    if let Some(ref apikey) = configuration.api_key {
2894        let key = apikey.key.clone();
2895        let value = match apikey.prefix {
2896            Some(ref prefix) => format!("{} {}", prefix, key),
2897            None => key,
2898        };
2899        req_builder = req_builder.header("Authorization", value);
2900    };
2901
2902    let req = req_builder.build()?;
2903    let resp = configuration.client.execute(req).await?;
2904
2905    let status = resp.status();
2906    let content_type = resp
2907        .headers()
2908        .get("content-type")
2909        .and_then(|v| v.to_str().ok())
2910        .unwrap_or("application/octet-stream");
2911    let content_type = super::ContentType::from(content_type);
2912
2913    if !status.is_client_error() && !status.is_server_error() {
2914        let content = resp.text().await?;
2915        match content_type {
2916            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2917            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetDividends200ResponseEnum`"))),
2918            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::GetDividends200ResponseEnum`")))),
2919        }
2920    } else {
2921        let content = resp.text().await?;
2922        let entity: Option<GetDividendsError> = serde_json::from_str(&content).ok();
2923        Err(Error::ResponseError(ResponseContent {
2924            status,
2925            content,
2926            entity,
2927        }))
2928    }
2929}
2930
2931/// 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.
2932pub async fn get_dividends_calendar(
2933    configuration: &configuration::Configuration,
2934    params: GetDividendsCalendarParams,
2935) -> Result<models::GetDividendsCalendar200ResponseEnum, Error<GetDividendsCalendarError>> {
2936    // Extract parameters from params struct
2937    let p_query_symbol = params.symbol;
2938    let p_query_figi = params.figi;
2939    let p_query_isin = params.isin;
2940    let p_query_cusip = params.cusip;
2941    let p_query_exchange = params.exchange;
2942    let p_query_mic_code = params.mic_code;
2943    let p_query_country = params.country;
2944    let p_query_start_date = params.start_date;
2945    let p_query_end_date = params.end_date;
2946    let p_query_outputsize = params.outputsize;
2947    let p_query_page = params.page;
2948
2949    let uri_str = format!("{}/dividends_calendar", configuration.base_path);
2950    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2951
2952    if let Some(ref param_value) = p_query_symbol {
2953        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2954    }
2955    if let Some(ref param_value) = p_query_figi {
2956        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2957    }
2958    if let Some(ref param_value) = p_query_isin {
2959        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2960    }
2961    if let Some(ref param_value) = p_query_cusip {
2962        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2963    }
2964    if let Some(ref param_value) = p_query_exchange {
2965        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2966    }
2967    if let Some(ref param_value) = p_query_mic_code {
2968        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2969    }
2970    if let Some(ref param_value) = p_query_country {
2971        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2972    }
2973    if let Some(ref param_value) = p_query_start_date {
2974        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
2975    }
2976    if let Some(ref param_value) = p_query_end_date {
2977        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
2978    }
2979    if let Some(ref param_value) = p_query_outputsize {
2980        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2981    }
2982    if let Some(ref param_value) = p_query_page {
2983        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2984    }
2985    if let Some(ref user_agent) = configuration.user_agent {
2986        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2987    }
2988    if let Some(ref apikey) = configuration.api_key {
2989        let key = apikey.key.clone();
2990        let value = match apikey.prefix {
2991            Some(ref prefix) => format!("{} {}", prefix, key),
2992            None => key,
2993        };
2994        req_builder = req_builder.header("Authorization", value);
2995    };
2996
2997    let req = req_builder.build()?;
2998    let resp = configuration.client.execute(req).await?;
2999
3000    let status = resp.status();
3001    let content_type = resp
3002        .headers()
3003        .get("content-type")
3004        .and_then(|v| v.to_str().ok())
3005        .unwrap_or("application/octet-stream");
3006    let content_type = super::ContentType::from(content_type);
3007
3008    if !status.is_client_error() && !status.is_server_error() {
3009        let content = resp.text().await?;
3010        match content_type {
3011            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3012            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetDividendsCalendar200ResponseEnum`"))),
3013            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::GetDividendsCalendar200ResponseEnum`")))),
3014        }
3015    } else {
3016        let content = resp.text().await?;
3017        let entity: Option<GetDividendsCalendarError> = serde_json::from_str(&content).ok();
3018        Err(Error::ResponseError(ResponseContent {
3019            status,
3020            content,
3021            entity,
3022        }))
3023    }
3024}
3025
3026/// 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.
3027pub async fn get_earnings(
3028    configuration: &configuration::Configuration,
3029    params: GetEarningsParams,
3030) -> Result<models::GetEarnings200ResponseEnum, Error<GetEarningsError>> {
3031    // Extract parameters from params struct
3032    let p_query_symbol = params.symbol;
3033    let p_query_figi = params.figi;
3034    let p_query_isin = params.isin;
3035    let p_query_cusip = params.cusip;
3036    let p_query_exchange = params.exchange;
3037    let p_query_mic_code = params.mic_code;
3038    let p_query_country = params.country;
3039    let p_query_type = params.r#type;
3040    let p_query_period = params.period;
3041    let p_query_outputsize = params.outputsize;
3042    let p_query_format = params.format;
3043    let p_query_delimiter = params.delimiter;
3044    let p_query_start_date = params.start_date;
3045    let p_query_end_date = params.end_date;
3046    let p_query_dp = params.dp;
3047
3048    let uri_str = format!("{}/earnings", configuration.base_path);
3049    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3050
3051    if let Some(ref param_value) = p_query_symbol {
3052        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3053    }
3054    if let Some(ref param_value) = p_query_figi {
3055        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3056    }
3057    if let Some(ref param_value) = p_query_isin {
3058        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3059    }
3060    if let Some(ref param_value) = p_query_cusip {
3061        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3062    }
3063    if let Some(ref param_value) = p_query_exchange {
3064        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3065    }
3066    if let Some(ref param_value) = p_query_mic_code {
3067        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3068    }
3069    if let Some(ref param_value) = p_query_country {
3070        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3071    }
3072    if let Some(ref param_value) = p_query_type {
3073        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
3074    }
3075    if let Some(ref param_value) = p_query_period {
3076        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3077    }
3078    if let Some(ref param_value) = p_query_outputsize {
3079        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3080    }
3081    if let Some(ref param_value) = p_query_format {
3082        req_builder = req_builder.query(&[("format", &param_value.to_string())]);
3083    }
3084    if let Some(ref param_value) = p_query_delimiter {
3085        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
3086    }
3087    if let Some(ref param_value) = p_query_start_date {
3088        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3089    }
3090    if let Some(ref param_value) = p_query_end_date {
3091        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3092    }
3093    if let Some(ref param_value) = p_query_dp {
3094        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
3095    }
3096    if let Some(ref user_agent) = configuration.user_agent {
3097        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3098    }
3099    if let Some(ref apikey) = configuration.api_key {
3100        let key = apikey.key.clone();
3101        let value = match apikey.prefix {
3102            Some(ref prefix) => format!("{} {}", prefix, key),
3103            None => key,
3104        };
3105        req_builder = req_builder.header("Authorization", value);
3106    };
3107
3108    let req = req_builder.build()?;
3109    let resp = configuration.client.execute(req).await?;
3110
3111    let status = resp.status();
3112    let content_type = resp
3113        .headers()
3114        .get("content-type")
3115        .and_then(|v| v.to_str().ok())
3116        .unwrap_or("application/octet-stream");
3117    let content_type = super::ContentType::from(content_type);
3118
3119    if !status.is_client_error() && !status.is_server_error() {
3120        let content = resp.text().await?;
3121        match content_type {
3122            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3123            ContentType::Text => return Ok(models::GetEarnings200ResponseEnum::Text(content)),
3124            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::GetEarnings200ResponseEnum`")))),
3125        }
3126    } else {
3127        let content = resp.text().await?;
3128        let entity: Option<GetEarningsError> = serde_json::from_str(&content).ok();
3129        Err(Error::ResponseError(ResponseContent {
3130            status,
3131            content,
3132            entity,
3133        }))
3134    }
3135}
3136
3137/// 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.
3138pub async fn get_earnings_calendar(
3139    configuration: &configuration::Configuration,
3140    params: GetEarningsCalendarParams,
3141) -> Result<models::GetEarningsCalendar200ResponseEnum, Error<GetEarningsCalendarError>> {
3142    // Extract parameters from params struct
3143    let p_query_exchange = params.exchange;
3144    let p_query_mic_code = params.mic_code;
3145    let p_query_country = params.country;
3146    let p_query_format = params.format;
3147    let p_query_delimiter = params.delimiter;
3148    let p_query_start_date = params.start_date;
3149    let p_query_end_date = params.end_date;
3150    let p_query_dp = params.dp;
3151
3152    let uri_str = format!("{}/earnings_calendar", configuration.base_path);
3153    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3154
3155    if let Some(ref param_value) = p_query_exchange {
3156        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3157    }
3158    if let Some(ref param_value) = p_query_mic_code {
3159        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3160    }
3161    if let Some(ref param_value) = p_query_country {
3162        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3163    }
3164    if let Some(ref param_value) = p_query_format {
3165        req_builder = req_builder.query(&[("format", &param_value.to_string())]);
3166    }
3167    if let Some(ref param_value) = p_query_delimiter {
3168        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
3169    }
3170    if let Some(ref param_value) = p_query_start_date {
3171        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3172    }
3173    if let Some(ref param_value) = p_query_end_date {
3174        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3175    }
3176    if let Some(ref param_value) = p_query_dp {
3177        req_builder = req_builder.query(&[("dp", &param_value.to_string())]);
3178    }
3179    if let Some(ref user_agent) = configuration.user_agent {
3180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3181    }
3182    if let Some(ref apikey) = configuration.api_key {
3183        let key = apikey.key.clone();
3184        let value = match apikey.prefix {
3185            Some(ref prefix) => format!("{} {}", prefix, key),
3186            None => key,
3187        };
3188        req_builder = req_builder.header("Authorization", value);
3189    };
3190
3191    let req = req_builder.build()?;
3192    let resp = configuration.client.execute(req).await?;
3193
3194    let status = resp.status();
3195    let content_type = resp
3196        .headers()
3197        .get("content-type")
3198        .and_then(|v| v.to_str().ok())
3199        .unwrap_or("application/octet-stream");
3200    let content_type = super::ContentType::from(content_type);
3201
3202    if !status.is_client_error() && !status.is_server_error() {
3203        let content = resp.text().await?;
3204        match content_type {
3205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3206            ContentType::Text => return Ok(models::GetEarningsCalendar200ResponseEnum::Text(content)),
3207            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::GetEarningsCalendar200ResponseEnum`")))),
3208        }
3209    } else {
3210        let content = resp.text().await?;
3211        let entity: Option<GetEarningsCalendarError> = serde_json::from_str(&content).ok();
3212        Err(Error::ResponseError(ResponseContent {
3213            status,
3214            content,
3215            entity,
3216        }))
3217    }
3218}
3219
3220/// 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.
3221pub async fn get_income_statement(
3222    configuration: &configuration::Configuration,
3223    params: GetIncomeStatementParams,
3224) -> Result<models::GetIncomeStatement200ResponseEnum, Error<GetIncomeStatementError>> {
3225    // Extract parameters from params struct
3226    let p_query_symbol = params.symbol;
3227    let p_query_figi = params.figi;
3228    let p_query_isin = params.isin;
3229    let p_query_cusip = params.cusip;
3230    let p_query_exchange = params.exchange;
3231    let p_query_mic_code = params.mic_code;
3232    let p_query_country = params.country;
3233    let p_query_period = params.period;
3234    let p_query_start_date = params.start_date;
3235    let p_query_end_date = params.end_date;
3236    let p_query_outputsize = params.outputsize;
3237
3238    let uri_str = format!("{}/income_statement", configuration.base_path);
3239    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3240
3241    if let Some(ref param_value) = p_query_symbol {
3242        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3243    }
3244    if let Some(ref param_value) = p_query_figi {
3245        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3246    }
3247    if let Some(ref param_value) = p_query_isin {
3248        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3249    }
3250    if let Some(ref param_value) = p_query_cusip {
3251        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3252    }
3253    if let Some(ref param_value) = p_query_exchange {
3254        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3255    }
3256    if let Some(ref param_value) = p_query_mic_code {
3257        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3258    }
3259    if let Some(ref param_value) = p_query_country {
3260        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3261    }
3262    if let Some(ref param_value) = p_query_period {
3263        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3264    }
3265    if let Some(ref param_value) = p_query_start_date {
3266        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3267    }
3268    if let Some(ref param_value) = p_query_end_date {
3269        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3270    }
3271    if let Some(ref param_value) = p_query_outputsize {
3272        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3273    }
3274    if let Some(ref user_agent) = configuration.user_agent {
3275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3276    }
3277    if let Some(ref apikey) = configuration.api_key {
3278        let key = apikey.key.clone();
3279        let value = match apikey.prefix {
3280            Some(ref prefix) => format!("{} {}", prefix, key),
3281            None => key,
3282        };
3283        req_builder = req_builder.header("Authorization", value);
3284    };
3285
3286    let req = req_builder.build()?;
3287    let resp = configuration.client.execute(req).await?;
3288
3289    let status = resp.status();
3290    let content_type = resp
3291        .headers()
3292        .get("content-type")
3293        .and_then(|v| v.to_str().ok())
3294        .unwrap_or("application/octet-stream");
3295    let content_type = super::ContentType::from(content_type);
3296
3297    if !status.is_client_error() && !status.is_server_error() {
3298        let content = resp.text().await?;
3299        match content_type {
3300            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3301            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIncomeStatement200ResponseEnum`"))),
3302            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::GetIncomeStatement200ResponseEnum`")))),
3303        }
3304    } else {
3305        let content = resp.text().await?;
3306        let entity: Option<GetIncomeStatementError> = serde_json::from_str(&content).ok();
3307        Err(Error::ResponseError(ResponseContent {
3308            status,
3309            content,
3310            entity,
3311        }))
3312    }
3313}
3314
3315/// 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.
3316pub async fn get_income_statement_consolidated(
3317    configuration: &configuration::Configuration,
3318    params: GetIncomeStatementConsolidatedParams,
3319) -> Result<
3320    models::GetIncomeStatementConsolidated200ResponseEnum,
3321    Error<GetIncomeStatementConsolidatedError>,
3322> {
3323    // Extract parameters from params struct
3324    let p_query_symbol = params.symbol;
3325    let p_query_figi = params.figi;
3326    let p_query_isin = params.isin;
3327    let p_query_cusip = params.cusip;
3328    let p_query_exchange = params.exchange;
3329    let p_query_mic_code = params.mic_code;
3330    let p_query_country = params.country;
3331    let p_query_period = params.period;
3332    let p_query_start_date = params.start_date;
3333    let p_query_end_date = params.end_date;
3334    let p_query_outputsize = params.outputsize;
3335
3336    let uri_str = format!("{}/income_statement/consolidated", configuration.base_path);
3337    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3338
3339    if let Some(ref param_value) = p_query_symbol {
3340        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3341    }
3342    if let Some(ref param_value) = p_query_figi {
3343        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3344    }
3345    if let Some(ref param_value) = p_query_isin {
3346        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3347    }
3348    if let Some(ref param_value) = p_query_cusip {
3349        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3350    }
3351    if let Some(ref param_value) = p_query_exchange {
3352        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3353    }
3354    if let Some(ref param_value) = p_query_mic_code {
3355        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3356    }
3357    if let Some(ref param_value) = p_query_country {
3358        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3359    }
3360    if let Some(ref param_value) = p_query_period {
3361        req_builder = req_builder.query(&[("period", &param_value.to_string())]);
3362    }
3363    if let Some(ref param_value) = p_query_start_date {
3364        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3365    }
3366    if let Some(ref param_value) = p_query_end_date {
3367        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3368    }
3369    if let Some(ref param_value) = p_query_outputsize {
3370        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3371    }
3372    if let Some(ref user_agent) = configuration.user_agent {
3373        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3374    }
3375    if let Some(ref apikey) = configuration.api_key {
3376        let key = apikey.key.clone();
3377        let value = match apikey.prefix {
3378            Some(ref prefix) => format!("{} {}", prefix, key),
3379            None => key,
3380        };
3381        req_builder = req_builder.header("Authorization", value);
3382    };
3383
3384    let req = req_builder.build()?;
3385    let resp = configuration.client.execute(req).await?;
3386
3387    let status = resp.status();
3388    let content_type = resp
3389        .headers()
3390        .get("content-type")
3391        .and_then(|v| v.to_str().ok())
3392        .unwrap_or("application/octet-stream");
3393    let content_type = super::ContentType::from(content_type);
3394
3395    if !status.is_client_error() && !status.is_server_error() {
3396        let content = resp.text().await?;
3397        match content_type {
3398            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3399            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIncomeStatementConsolidated200ResponseEnum`"))),
3400            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::GetIncomeStatementConsolidated200ResponseEnum`")))),
3401        }
3402    } else {
3403        let content = resp.text().await?;
3404        let entity: Option<GetIncomeStatementConsolidatedError> =
3405            serde_json::from_str(&content).ok();
3406        Err(Error::ResponseError(ResponseContent {
3407            status,
3408            content,
3409            entity,
3410        }))
3411    }
3412}
3413
3414/// 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.
3415pub async fn get_ipo_calendar(
3416    configuration: &configuration::Configuration,
3417    params: GetIpoCalendarParams,
3418) -> Result<models::GetIpoCalendar200ResponseEnum, Error<GetIpoCalendarError>> {
3419    // Extract parameters from params struct
3420    let p_query_exchange = params.exchange;
3421    let p_query_mic_code = params.mic_code;
3422    let p_query_country = params.country;
3423    let p_query_start_date = params.start_date;
3424    let p_query_end_date = params.end_date;
3425
3426    let uri_str = format!("{}/ipo_calendar", configuration.base_path);
3427    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3428
3429    if let Some(ref param_value) = p_query_exchange {
3430        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3431    }
3432    if let Some(ref param_value) = p_query_mic_code {
3433        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3434    }
3435    if let Some(ref param_value) = p_query_country {
3436        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3437    }
3438    if let Some(ref param_value) = p_query_start_date {
3439        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3440    }
3441    if let Some(ref param_value) = p_query_end_date {
3442        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3443    }
3444    if let Some(ref user_agent) = configuration.user_agent {
3445        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3446    }
3447    if let Some(ref apikey) = configuration.api_key {
3448        let key = apikey.key.clone();
3449        let value = match apikey.prefix {
3450            Some(ref prefix) => format!("{} {}", prefix, key),
3451            None => key,
3452        };
3453        req_builder = req_builder.header("Authorization", value);
3454    };
3455
3456    let req = req_builder.build()?;
3457    let resp = configuration.client.execute(req).await?;
3458
3459    let status = resp.status();
3460    let content_type = resp
3461        .headers()
3462        .get("content-type")
3463        .and_then(|v| v.to_str().ok())
3464        .unwrap_or("application/octet-stream");
3465    let content_type = super::ContentType::from(content_type);
3466
3467    if !status.is_client_error() && !status.is_server_error() {
3468        let content = resp.text().await?;
3469        match content_type {
3470            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3471            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIpoCalendar200ResponseEnum`"))),
3472            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::GetIpoCalendar200ResponseEnum`")))),
3473        }
3474    } else {
3475        let content = resp.text().await?;
3476        let entity: Option<GetIpoCalendarError> = serde_json::from_str(&content).ok();
3477        Err(Error::ResponseError(ResponseContent {
3478            status,
3479            content,
3480            entity,
3481        }))
3482    }
3483}
3484
3485/// 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.
3486pub async fn get_key_executives(
3487    configuration: &configuration::Configuration,
3488    params: GetKeyExecutivesParams,
3489) -> Result<models::GetKeyExecutives200ResponseEnum, Error<GetKeyExecutivesError>> {
3490    // Extract parameters from params struct
3491    let p_query_symbol = params.symbol;
3492    let p_query_figi = params.figi;
3493    let p_query_isin = params.isin;
3494    let p_query_cusip = params.cusip;
3495    let p_query_exchange = params.exchange;
3496    let p_query_mic_code = params.mic_code;
3497    let p_query_country = params.country;
3498
3499    let uri_str = format!("{}/key_executives", configuration.base_path);
3500    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3501
3502    if let Some(ref param_value) = p_query_symbol {
3503        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3504    }
3505    if let Some(ref param_value) = p_query_figi {
3506        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3507    }
3508    if let Some(ref param_value) = p_query_isin {
3509        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3510    }
3511    if let Some(ref param_value) = p_query_cusip {
3512        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3513    }
3514    if let Some(ref param_value) = p_query_exchange {
3515        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3516    }
3517    if let Some(ref param_value) = p_query_mic_code {
3518        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3519    }
3520    if let Some(ref param_value) = p_query_country {
3521        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3522    }
3523    if let Some(ref user_agent) = configuration.user_agent {
3524        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3525    }
3526    if let Some(ref apikey) = configuration.api_key {
3527        let key = apikey.key.clone();
3528        let value = match apikey.prefix {
3529            Some(ref prefix) => format!("{} {}", prefix, key),
3530            None => key,
3531        };
3532        req_builder = req_builder.header("Authorization", value);
3533    };
3534
3535    let req = req_builder.build()?;
3536    let resp = configuration.client.execute(req).await?;
3537
3538    let status = resp.status();
3539    let content_type = resp
3540        .headers()
3541        .get("content-type")
3542        .and_then(|v| v.to_str().ok())
3543        .unwrap_or("application/octet-stream");
3544    let content_type = super::ContentType::from(content_type);
3545
3546    if !status.is_client_error() && !status.is_server_error() {
3547        let content = resp.text().await?;
3548        match content_type {
3549            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3550            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetKeyExecutives200ResponseEnum`"))),
3551            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::GetKeyExecutives200ResponseEnum`")))),
3552        }
3553    } else {
3554        let content = resp.text().await?;
3555        let entity: Option<GetKeyExecutivesError> = serde_json::from_str(&content).ok();
3556        Err(Error::ResponseError(ResponseContent {
3557            status,
3558            content,
3559            entity,
3560        }))
3561    }
3562}
3563
3564/// 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.
3565pub async fn get_last_changes(
3566    configuration: &configuration::Configuration,
3567    params: GetLastChangesParams,
3568) -> Result<models::GetLastChanges200ResponseEnum, Error<GetLastChangesError>> {
3569    // Extract parameters from params struct
3570    let p_path_endpoint = params.endpoint;
3571    let p_query_start_date = params.start_date;
3572    let p_query_symbol = params.symbol;
3573    let p_query_exchange = params.exchange;
3574    let p_query_mic_code = params.mic_code;
3575    let p_query_country = params.country;
3576    let p_query_page = params.page;
3577    let p_query_outputsize = params.outputsize;
3578
3579    let uri_str = format!(
3580        "{}/last_change/{endpoint}",
3581        configuration.base_path,
3582        endpoint = crate::apis::urlencode(p_path_endpoint)
3583    );
3584    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3585
3586    if let Some(ref param_value) = p_query_start_date {
3587        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3588    }
3589    if let Some(ref param_value) = p_query_symbol {
3590        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3591    }
3592    if let Some(ref param_value) = p_query_exchange {
3593        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3594    }
3595    if let Some(ref param_value) = p_query_mic_code {
3596        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3597    }
3598    if let Some(ref param_value) = p_query_country {
3599        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3600    }
3601    if let Some(ref param_value) = p_query_page {
3602        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3603    }
3604    if let Some(ref param_value) = p_query_outputsize {
3605        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3606    }
3607    if let Some(ref user_agent) = configuration.user_agent {
3608        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3609    }
3610    if let Some(ref apikey) = configuration.api_key {
3611        let key = apikey.key.clone();
3612        let value = match apikey.prefix {
3613            Some(ref prefix) => format!("{} {}", prefix, key),
3614            None => key,
3615        };
3616        req_builder = req_builder.header("Authorization", value);
3617    };
3618
3619    let req = req_builder.build()?;
3620    let resp = configuration.client.execute(req).await?;
3621
3622    let status = resp.status();
3623    let content_type = resp
3624        .headers()
3625        .get("content-type")
3626        .and_then(|v| v.to_str().ok())
3627        .unwrap_or("application/octet-stream");
3628    let content_type = super::ContentType::from(content_type);
3629
3630    if !status.is_client_error() && !status.is_server_error() {
3631        let content = resp.text().await?;
3632        match content_type {
3633            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3634            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetLastChanges200ResponseEnum`"))),
3635            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::GetLastChanges200ResponseEnum`")))),
3636        }
3637    } else {
3638        let content = resp.text().await?;
3639        let entity: Option<GetLastChangesError> = serde_json::from_str(&content).ok();
3640        Err(Error::ResponseError(ResponseContent {
3641            status,
3642            content,
3643            entity,
3644        }))
3645    }
3646}
3647
3648/// 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.
3649pub async fn get_logo(
3650    configuration: &configuration::Configuration,
3651    params: GetLogoParams,
3652) -> Result<models::GetLogo200ResponseEnum, Error<GetLogoError>> {
3653    // Extract parameters from params struct
3654    let p_query_symbol = params.symbol;
3655    let p_query_exchange = params.exchange;
3656    let p_query_mic_code = params.mic_code;
3657    let p_query_country = params.country;
3658
3659    let uri_str = format!("{}/logo", configuration.base_path);
3660    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3661
3662    req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3663    if let Some(ref param_value) = p_query_exchange {
3664        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3665    }
3666    if let Some(ref param_value) = p_query_mic_code {
3667        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3668    }
3669    if let Some(ref param_value) = p_query_country {
3670        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3671    }
3672    if let Some(ref user_agent) = configuration.user_agent {
3673        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3674    }
3675    if let Some(ref apikey) = configuration.api_key {
3676        let key = apikey.key.clone();
3677        let value = match apikey.prefix {
3678            Some(ref prefix) => format!("{} {}", prefix, key),
3679            None => key,
3680        };
3681        req_builder = req_builder.header("Authorization", value);
3682    };
3683
3684    let req = req_builder.build()?;
3685    let resp = configuration.client.execute(req).await?;
3686
3687    let status = resp.status();
3688    let content_type = resp
3689        .headers()
3690        .get("content-type")
3691        .and_then(|v| v.to_str().ok())
3692        .unwrap_or("application/octet-stream");
3693    let content_type = super::ContentType::from(content_type);
3694
3695    if !status.is_client_error() && !status.is_server_error() {
3696        let content = resp.text().await?;
3697        match content_type {
3698            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3699            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetLogo200ResponseEnum`"))),
3700            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::GetLogo200ResponseEnum`")))),
3701        }
3702    } else {
3703        let content = resp.text().await?;
3704        let entity: Option<GetLogoError> = serde_json::from_str(&content).ok();
3705        Err(Error::ResponseError(ResponseContent {
3706            status,
3707            content,
3708            entity,
3709        }))
3710    }
3711}
3712
3713/// 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.
3714pub async fn get_market_cap(
3715    configuration: &configuration::Configuration,
3716    params: GetMarketCapParams,
3717) -> Result<models::GetMarketCap200ResponseEnum, Error<GetMarketCapError>> {
3718    // Extract parameters from params struct
3719    let p_query_symbol = params.symbol;
3720    let p_query_figi = params.figi;
3721    let p_query_isin = params.isin;
3722    let p_query_cusip = params.cusip;
3723    let p_query_exchange = params.exchange;
3724    let p_query_mic_code = params.mic_code;
3725    let p_query_country = params.country;
3726    let p_query_start_date = params.start_date;
3727    let p_query_end_date = params.end_date;
3728    let p_query_page = params.page;
3729    let p_query_outputsize = params.outputsize;
3730
3731    let uri_str = format!("{}/market_cap", configuration.base_path);
3732    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3733
3734    if let Some(ref param_value) = p_query_symbol {
3735        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3736    }
3737    if let Some(ref param_value) = p_query_figi {
3738        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3739    }
3740    if let Some(ref param_value) = p_query_isin {
3741        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3742    }
3743    if let Some(ref param_value) = p_query_cusip {
3744        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3745    }
3746    if let Some(ref param_value) = p_query_exchange {
3747        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3748    }
3749    if let Some(ref param_value) = p_query_mic_code {
3750        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3751    }
3752    if let Some(ref param_value) = p_query_country {
3753        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3754    }
3755    if let Some(ref param_value) = p_query_start_date {
3756        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3757    }
3758    if let Some(ref param_value) = p_query_end_date {
3759        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3760    }
3761    if let Some(ref param_value) = p_query_page {
3762        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3763    }
3764    if let Some(ref param_value) = p_query_outputsize {
3765        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3766    }
3767    if let Some(ref user_agent) = configuration.user_agent {
3768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3769    }
3770    if let Some(ref apikey) = configuration.api_key {
3771        let key = apikey.key.clone();
3772        let value = match apikey.prefix {
3773            Some(ref prefix) => format!("{} {}", prefix, key),
3774            None => key,
3775        };
3776        req_builder = req_builder.header("Authorization", value);
3777    };
3778
3779    let req = req_builder.build()?;
3780    let resp = configuration.client.execute(req).await?;
3781
3782    let status = resp.status();
3783    let content_type = resp
3784        .headers()
3785        .get("content-type")
3786        .and_then(|v| v.to_str().ok())
3787        .unwrap_or("application/octet-stream");
3788    let content_type = super::ContentType::from(content_type);
3789
3790    if !status.is_client_error() && !status.is_server_error() {
3791        let content = resp.text().await?;
3792        match content_type {
3793            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3794            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMarketCap200ResponseEnum`"))),
3795            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::GetMarketCap200ResponseEnum`")))),
3796        }
3797    } else {
3798        let content = resp.text().await?;
3799        let entity: Option<GetMarketCapError> = serde_json::from_str(&content).ok();
3800        Err(Error::ResponseError(ResponseContent {
3801            status,
3802            content,
3803            entity,
3804        }))
3805    }
3806}
3807
3808/// 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.
3809pub async fn get_profile(
3810    configuration: &configuration::Configuration,
3811    params: GetProfileParams,
3812) -> Result<models::GetProfile200ResponseEnum, Error<GetProfileError>> {
3813    // Extract parameters from params struct
3814    let p_query_symbol = params.symbol;
3815    let p_query_figi = params.figi;
3816    let p_query_isin = params.isin;
3817    let p_query_cusip = params.cusip;
3818    let p_query_exchange = params.exchange;
3819    let p_query_mic_code = params.mic_code;
3820    let p_query_country = params.country;
3821
3822    let uri_str = format!("{}/profile", configuration.base_path);
3823    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3824
3825    if let Some(ref param_value) = p_query_symbol {
3826        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3827    }
3828    if let Some(ref param_value) = p_query_figi {
3829        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3830    }
3831    if let Some(ref param_value) = p_query_isin {
3832        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3833    }
3834    if let Some(ref param_value) = p_query_cusip {
3835        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3836    }
3837    if let Some(ref param_value) = p_query_exchange {
3838        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3839    }
3840    if let Some(ref param_value) = p_query_mic_code {
3841        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3842    }
3843    if let Some(ref param_value) = p_query_country {
3844        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3845    }
3846    if let Some(ref user_agent) = configuration.user_agent {
3847        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3848    }
3849    if let Some(ref apikey) = configuration.api_key {
3850        let key = apikey.key.clone();
3851        let value = match apikey.prefix {
3852            Some(ref prefix) => format!("{} {}", prefix, key),
3853            None => key,
3854        };
3855        req_builder = req_builder.header("Authorization", value);
3856    };
3857
3858    let req = req_builder.build()?;
3859    let resp = configuration.client.execute(req).await?;
3860
3861    let status = resp.status();
3862    let content_type = resp
3863        .headers()
3864        .get("content-type")
3865        .and_then(|v| v.to_str().ok())
3866        .unwrap_or("application/octet-stream");
3867    let content_type = super::ContentType::from(content_type);
3868
3869    if !status.is_client_error() && !status.is_server_error() {
3870        let content = resp.text().await?;
3871        match content_type {
3872            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3873            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetProfile200ResponseEnum`"))),
3874            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::GetProfile200ResponseEnum`")))),
3875        }
3876    } else {
3877        let content = resp.text().await?;
3878        let entity: Option<GetProfileError> = serde_json::from_str(&content).ok();
3879        Err(Error::ResponseError(ResponseContent {
3880            status,
3881            content,
3882            entity,
3883        }))
3884    }
3885}
3886
3887/// 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.
3888pub async fn get_splits(
3889    configuration: &configuration::Configuration,
3890    params: GetSplitsParams,
3891) -> Result<models::GetSplits200ResponseEnum, Error<GetSplitsError>> {
3892    // Extract parameters from params struct
3893    let p_query_symbol = params.symbol;
3894    let p_query_figi = params.figi;
3895    let p_query_isin = params.isin;
3896    let p_query_cusip = params.cusip;
3897    let p_query_exchange = params.exchange;
3898    let p_query_mic_code = params.mic_code;
3899    let p_query_country = params.country;
3900    let p_query_range = params.range;
3901    let p_query_start_date = params.start_date;
3902    let p_query_end_date = params.end_date;
3903
3904    let uri_str = format!("{}/splits", configuration.base_path);
3905    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3906
3907    if let Some(ref param_value) = p_query_symbol {
3908        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3909    }
3910    if let Some(ref param_value) = p_query_figi {
3911        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3912    }
3913    if let Some(ref param_value) = p_query_isin {
3914        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3915    }
3916    if let Some(ref param_value) = p_query_cusip {
3917        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3918    }
3919    if let Some(ref param_value) = p_query_exchange {
3920        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3921    }
3922    if let Some(ref param_value) = p_query_mic_code {
3923        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3924    }
3925    if let Some(ref param_value) = p_query_country {
3926        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3927    }
3928    if let Some(ref param_value) = p_query_range {
3929        req_builder = req_builder.query(&[("range", &param_value.to_string())]);
3930    }
3931    if let Some(ref param_value) = p_query_start_date {
3932        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
3933    }
3934    if let Some(ref param_value) = p_query_end_date {
3935        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
3936    }
3937    if let Some(ref user_agent) = configuration.user_agent {
3938        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3939    }
3940    if let Some(ref apikey) = configuration.api_key {
3941        let key = apikey.key.clone();
3942        let value = match apikey.prefix {
3943            Some(ref prefix) => format!("{} {}", prefix, key),
3944            None => key,
3945        };
3946        req_builder = req_builder.header("Authorization", value);
3947    };
3948
3949    let req = req_builder.build()?;
3950    let resp = configuration.client.execute(req).await?;
3951
3952    let status = resp.status();
3953    let content_type = resp
3954        .headers()
3955        .get("content-type")
3956        .and_then(|v| v.to_str().ok())
3957        .unwrap_or("application/octet-stream");
3958    let content_type = super::ContentType::from(content_type);
3959
3960    if !status.is_client_error() && !status.is_server_error() {
3961        let content = resp.text().await?;
3962        match content_type {
3963            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3964            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSplits200ResponseEnum`"))),
3965            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::GetSplits200ResponseEnum`")))),
3966        }
3967    } else {
3968        let content = resp.text().await?;
3969        let entity: Option<GetSplitsError> = serde_json::from_str(&content).ok();
3970        Err(Error::ResponseError(ResponseContent {
3971            status,
3972            content,
3973            entity,
3974        }))
3975    }
3976}
3977
3978/// 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.
3979pub async fn get_splits_calendar(
3980    configuration: &configuration::Configuration,
3981    params: GetSplitsCalendarParams,
3982) -> Result<models::GetSplitsCalendar200ResponseEnum, Error<GetSplitsCalendarError>> {
3983    // Extract parameters from params struct
3984    let p_query_symbol = params.symbol;
3985    let p_query_figi = params.figi;
3986    let p_query_isin = params.isin;
3987    let p_query_cusip = params.cusip;
3988    let p_query_exchange = params.exchange;
3989    let p_query_mic_code = params.mic_code;
3990    let p_query_country = params.country;
3991    let p_query_start_date = params.start_date;
3992    let p_query_end_date = params.end_date;
3993    let p_query_outputsize = params.outputsize;
3994    let p_query_page = params.page;
3995
3996    let uri_str = format!("{}/splits_calendar", configuration.base_path);
3997    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3998
3999    if let Some(ref param_value) = p_query_symbol {
4000        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
4001    }
4002    if let Some(ref param_value) = p_query_figi {
4003        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
4004    }
4005    if let Some(ref param_value) = p_query_isin {
4006        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
4007    }
4008    if let Some(ref param_value) = p_query_cusip {
4009        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
4010    }
4011    if let Some(ref param_value) = p_query_exchange {
4012        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
4013    }
4014    if let Some(ref param_value) = p_query_mic_code {
4015        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
4016    }
4017    if let Some(ref param_value) = p_query_country {
4018        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
4019    }
4020    if let Some(ref param_value) = p_query_start_date {
4021        req_builder = req_builder.query(&[("start_date", &param_value.to_string())]);
4022    }
4023    if let Some(ref param_value) = p_query_end_date {
4024        req_builder = req_builder.query(&[("end_date", &param_value.to_string())]);
4025    }
4026    if let Some(ref param_value) = p_query_outputsize {
4027        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
4028    }
4029    if let Some(ref param_value) = p_query_page {
4030        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4031    }
4032    if let Some(ref user_agent) = configuration.user_agent {
4033        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4034    }
4035    if let Some(ref apikey) = configuration.api_key {
4036        let key = apikey.key.clone();
4037        let value = match apikey.prefix {
4038            Some(ref prefix) => format!("{} {}", prefix, key),
4039            None => key,
4040        };
4041        req_builder = req_builder.header("Authorization", value);
4042    };
4043
4044    let req = req_builder.build()?;
4045    let resp = configuration.client.execute(req).await?;
4046
4047    let status = resp.status();
4048    let content_type = resp
4049        .headers()
4050        .get("content-type")
4051        .and_then(|v| v.to_str().ok())
4052        .unwrap_or("application/octet-stream");
4053    let content_type = super::ContentType::from(content_type);
4054
4055    if !status.is_client_error() && !status.is_server_error() {
4056        let content = resp.text().await?;
4057        match content_type {
4058            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4059            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSplitsCalendar200ResponseEnum`"))),
4060            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::GetSplitsCalendar200ResponseEnum`")))),
4061        }
4062    } else {
4063        let content = resp.text().await?;
4064        let entity: Option<GetSplitsCalendarError> = serde_json::from_str(&content).ok();
4065        Err(Error::ResponseError(ResponseContent {
4066            status,
4067            content,
4068            entity,
4069        }))
4070    }
4071}
4072
4073/// 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.
4074pub async fn get_statistics(
4075    configuration: &configuration::Configuration,
4076    params: GetStatisticsParams,
4077) -> Result<models::GetStatistics200ResponseEnum, Error<GetStatisticsError>> {
4078    // Extract parameters from params struct
4079    let p_query_symbol = params.symbol;
4080    let p_query_figi = params.figi;
4081    let p_query_isin = params.isin;
4082    let p_query_cusip = params.cusip;
4083    let p_query_exchange = params.exchange;
4084    let p_query_mic_code = params.mic_code;
4085    let p_query_country = params.country;
4086
4087    let uri_str = format!("{}/statistics", configuration.base_path);
4088    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4089
4090    if let Some(ref param_value) = p_query_symbol {
4091        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
4092    }
4093    if let Some(ref param_value) = p_query_figi {
4094        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
4095    }
4096    if let Some(ref param_value) = p_query_isin {
4097        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
4098    }
4099    if let Some(ref param_value) = p_query_cusip {
4100        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
4101    }
4102    if let Some(ref param_value) = p_query_exchange {
4103        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
4104    }
4105    if let Some(ref param_value) = p_query_mic_code {
4106        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
4107    }
4108    if let Some(ref param_value) = p_query_country {
4109        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
4110    }
4111    if let Some(ref user_agent) = configuration.user_agent {
4112        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4113    }
4114    if let Some(ref apikey) = configuration.api_key {
4115        let key = apikey.key.clone();
4116        let value = match apikey.prefix {
4117            Some(ref prefix) => format!("{} {}", prefix, key),
4118            None => key,
4119        };
4120        req_builder = req_builder.header("Authorization", value);
4121    };
4122
4123    let req = req_builder.build()?;
4124    let resp = configuration.client.execute(req).await?;
4125
4126    let status = resp.status();
4127    let content_type = resp
4128        .headers()
4129        .get("content-type")
4130        .and_then(|v| v.to_str().ok())
4131        .unwrap_or("application/octet-stream");
4132    let content_type = super::ContentType::from(content_type);
4133
4134    if !status.is_client_error() && !status.is_server_error() {
4135        let content = resp.text().await?;
4136        match content_type {
4137            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4138            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetStatistics200ResponseEnum`"))),
4139            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::GetStatistics200ResponseEnum`")))),
4140        }
4141    } else {
4142        let content = resp.text().await?;
4143        let entity: Option<GetStatisticsError> = serde_json::from_str(&content).ok();
4144        Err(Error::ResponseError(ResponseContent {
4145            status,
4146            content,
4147            entity,
4148        }))
4149    }
4150}