twelve_data_client/apis/
reference_data_api.rs

1/*
2 * Twelve Data API
3 *
4 * ## Overview  Welcome to Twelve Data developer docs — your gateway to comprehensive financial market data through a powerful and easy-to-use API. Twelve Data provides access to financial markets across over 50 global countries, covering more than 1 million public instruments, including stocks, forex, ETFs, mutual funds, commodities, and cryptocurrencies.  ## Quickstart  To get started, you'll need to sign up for an API key. Once you have your API key, you can start making requests to the API.  ### Step 1: Create Twelve Data account  Sign up on the Twelve Data website to create your account [here](https://twelvedata.com/register). This gives you access to the API dashboard and your API key.  ### Step 2: Get your API key  After signing in, navigate to your [dashboard](https://twelvedata.com/account/api-keys) to find your unique API key. This key is required to authenticate all API and WebSocket requests.  ### Step 3: Make your first request  Try a simple API call with cURL to fetch the latest price for Apple (AAPL):  ``` curl \"https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key\" ```  ### Step 4: Make a request from Python or Javascript  Use our client libraries or standard HTTP clients to make API calls programmatically. Here’s an example in [Python](https://github.com/twelvedata/twelvedata-python) and JavaScript:  #### Python (using official Twelve Data SDK):  ```python from twelvedata import TDClient  # Initialize client with your API key td = TDClient(apikey=\"your_api_key\")  # Get latest price for Apple price = td.price(symbol=\"AAPL\").as_json()  print(price) ```  #### JavaScript (Node.js):  ```javascript const fetch = require('node-fetch');  fetch('https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key') &nbsp;&nbsp;.then(response => response.json()) &nbsp;&nbsp;.then(data => console.log(data)); ```  ### Step 5: Perform correlation analysis between Tesla and Microsoft prices  Fetch historical price data for Tesla (TSLA) and Microsoft (MSFT) and calculate the correlation of their closing prices:  ```python from twelvedata import TDClient import pandas as pd  # Initialize client with your API key td = TDClient(apikey=\"your_api_key\")  # Fetch historical price data for Tesla tsla_ts = td.time_series( &nbsp;&nbsp;&nbsp;&nbsp;symbol=\"TSLA\", &nbsp;&nbsp;&nbsp;&nbsp;interval=\"1day\", &nbsp;&nbsp;&nbsp;&nbsp;outputsize=100 ).as_pandas()  # Fetch historical price data for Microsoft msft_ts = td.time_series( &nbsp;&nbsp;&nbsp;&nbsp;symbol=\"MSFT\", &nbsp;&nbsp;&nbsp;&nbsp;interval=\"1day\", &nbsp;&nbsp;&nbsp;&nbsp;outputsize=100 ).as_pandas()  # Align data on datetime index combined = pd.concat( &nbsp;&nbsp;&nbsp;&nbsp;[tsla_ts['close'].astype(float), msft_ts['close'].astype(float)], &nbsp;&nbsp;&nbsp;&nbsp;axis=1, &nbsp;&nbsp;&nbsp;&nbsp;keys=[\"TSLA\", \"MSFT\"] ).dropna()  # Calculate correlation correlation = combined[\"TSLA\"].corr(combined[\"MSFT\"]) print(f\"Correlation of closing prices between TSLA and MSFT: {correlation:.2f}\") ```  ### Authentication  Authenticate your requests using one of these methods:  #### Query parameter method ``` GET https://api.twelvedata.com/endpoint?symbol=AAPL&apikey=your_api_key ```  #### HTTP header method (recommended) ``` Authorization: apikey your_api_key ```  ##### API key useful information <ul> <li> Demo API key (<code>apikey=demo</code>) available for demo requests</li> <li> Personal API key required for full access</li> <li> Premium endpoints and data require higher-tier plans (testable with <a href=\"https://twelvedata.com/exchanges\">trial symbols</a>)</li> </ul>  ### API endpoints   Service | Base URL | ---------|----------|  REST API | `https://api.twelvedata.com` |  WebSocket | `wss://ws.twelvedata.com` |  ### Parameter guidelines <ul> <li><b>Separator:</b> Use <code>&</code> to separate multiple parameters</li> <li><b>Case sensitivity:</b> Parameter names are case-insensitive</li>  <ul><li><code>symbol=AAPL</code> = <code>symbol=aapl</code></li></ul>  <li><b>Multiple values:</b> Separate with commas where supported</li> </ul>  ### Response handling  #### Default format All responses return JSON format by default unless otherwise specified.  #### Null values <b>Important:</b> Some response fields may contain `null` values when data is unavailable for specific metrics. This is expected behavior, not an error.  ##### Best Practices: <ul> <li>Always implement <code>null</code> value handling in your application</li> <li>Use defensive programming techniques for data processing</li> <li>Consider fallback values or error handling for critical metrics</li> </ul>  #### Error handling Structure your code to gracefully handle: <ul> <li>Network timeouts</li> <li>Rate limiting responses</li> <li>Invalid parameter errors</li> <li>Data unavailability periods</li> </ul>  ##### Best practices <ul> <li><b>Rate limits:</b> Adhere to your plan’s rate limits to avoid throttling. Check your dashboard for details.</li> <li><b>Error handling:</b> Implement retry logic for transient errors (e.g., <code>429 Too Many Requests</code>).</li> <li><b>Caching:</b> Cache responses for frequently accessed data to reduce API calls and improve performance.</li> <li><b>Secure storage:</b> Store your API key securely and never expose it in client-side code or public repositories.</li> </ul>  ## Errors  Twelve Data API employs a standardized error response format, delivering a JSON object with `code`, `message`, and `status` keys for clear and consistent error communication.  ### Codes  Below is a table of possible error codes, their HTTP status, meanings, and resolution steps:   Code | status | Meaning | Resolution |  --- | --- | --- | --- |  **400** | Bad Request | Invalid or incorrect parameter(s) provided. | Check the `message` in the response for details. Refer to the API Documenta­tion to correct the input. |  **401** | Unauthor­ized | Invalid or incorrect API key. | Verify your API key is correct. Sign up for a key <a href=\"https://twelvedata.com/account/api-keys\">here</a>. |  **403** | Forbidden | API key lacks permissions for the requested resource (upgrade required). | Upgrade your plan <a href=\"https://twelvedata.com/pricing\">here</a>. |  **404** | Not Found | Requested data could not be found. | Adjust parameters to be less strict as they may be too restrictive. |  **414** | Parameter Too Long | Input parameter array exceeds the allowed length. | Follow the `message` guidance to adjust the parameter length. |  **429** | Too Many Requests | API request limit reached for your key. | Wait briefly or upgrade your plan <a href=\"https://twelvedata.com/pricing\">here</a>. |  **500** | Internal Server Error | Server-side issue occurred; retry later. | Contact support <a href=\"https://twelvedata.com/contact\">here</a> for assistance. |  ### Example error response  Consider the following invalid request:  ``` https://api.twelvedata.com/time_series?symbol=AAPL&interval=0.99min&apikey=your_api_key ```  Due to the incorrect `interval` value, the API returns:  ```json { &nbsp;&nbsp;\"code\": 400, &nbsp;&nbsp;\"message\": \"Invalid **interval** provided: 0.99min. Supported intervals: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 8h, 1day, 1week, 1month\", &nbsp;&nbsp;\"status\": \"error\" } ```  Refer to the API Documentation for valid parameter values to resolve such errors.  ## Libraries  Twelve Data provides a growing ecosystem of libraries and integrations to help you build faster and smarter in your preferred environment. Official libraries are actively maintained by the Twelve Data team, while selected community-built libraries offer additional flexibility.  A full list is available on our [GitHub profile](https://github.com/search?q=twelvedata).  ### Official SDKs <ul> <li><b>Python:</b> <a href=\"https://github.com/twelvedata/twelvedata-python\">twelvedata-python</a></li> <li><b>R:</b> <a href=\"https://github.com/twelvedata/twelvedata-r-sdk\">twelvedata-r-sdk</a></li> </ul>  ### AI integrations <ul> <li><b>Twelve Data MCP Server:</b> <a href=\"https://github.com/twelvedata/mcp\">Repository</a> — Model Context Protocol (MCP) server that provides seamless integration with AI assistants and language models, enabling direct access to Twelve Data's financial market data within conversational interfaces and AI workflows.</li> </ul>  ### Spreadsheet add-ons <ul> <li><b>Excel:</b> <a href=\"https://twelvedata.com/excel\">Excel Add-in</a></li> <li><b>Google Sheets:</b> <a href=\"https://twelvedata.com/google-sheets\">Google Sheets Add-on</a></li> </ul>  ### Community libraries  The community has developed libraries in several popular languages. You can explore more community libraries on [GitHub](https://github.com/search?q=twelvedata). <ul> <li><b>C#:</b> <a href=\"https://github.com/pseudomarkets/TwelveDataSharp\">TwelveDataSharp</a></li> <li><b>JavaScript:</b> <a href=\"https://github.com/evzaboun/twelvedata\">twelvedata</a></li> <li><b>PHP:</b> <a href=\"https://github.com/ingelby/twelvedata\">twelvedata</a></li> <li><b>Go:</b> <a href=\"https://github.com/soulgarden/twelvedata\">twelvedata</a></li> <li><b>TypeScript:</b> <a href=\"https://github.com/Clyde-Goodall/twelve-data-wrapper\">twelve-data-wrapper</a></li> </ul>  ### Other Twelve Data repositories <ul> <li><b>searchindex</b> <i>(Go)</i>: <a href=\"https://github.com/twelvedata/searchindex\">Repository</a> — In-memory search index by strings</li> <li><b>ws-tools</b> <i>(Python)</i>: <a href=\"https://github.com/twelvedata/ws-tools\">Repository</a> — Utility tools for WebSocket stream handling</li> </ul>  ### API specification <ul> <li><b>OpenAPI / Swagger:</b> Access the <a href=\"https://api.twelvedata.com/doc/swagger/openapi.json\">complete API specification</a> in OpenAPI format. You can use this file to automatically generate client libraries in your preferred programming language, explore the API interactively via Swagger tools, or integrate Twelve Data seamlessly into your AI and LLM workflows.</li> </ul>
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17/// struct for passing parameters to the method [`get_bonds`]
18#[derive(Clone, Debug, Default, Serialize, Deserialize)]
19pub struct GetBondsParams {
20    /// The ticker symbol of an instrument for which data is requested
21    pub symbol: Option<String>,
22    /// Filter by exchange name
23    pub exchange: Option<String>,
24    /// Filter by country name or alpha code, e.g., `United States` or `US`
25    pub country: Option<String>,
26    /// The format of the response data
27    pub format: Option<String>,
28    /// The separator used in the CSV response data
29    pub delimiter: Option<String>,
30    /// Adds info on which plan symbol is available
31    pub show_plan: Option<bool>,
32    /// Page number of the results to fetch
33    pub page: Option<i64>,
34    /// Determines the number of data points returned in the output
35    pub outputsize: Option<i64>
36}
37
38impl GetBondsParams {
39    /// Create a new builder for this parameter struct
40    pub fn builder() -> GetBondsParamsBuilder {
41        GetBondsParamsBuilder::default()
42    }
43}
44
45/// Builder for [`GetBondsParams`]
46#[derive(Clone, Debug, Default)]
47pub struct GetBondsParamsBuilder {
48    /// The ticker symbol of an instrument for which data is requested
49    symbol: Option<String>,
50    /// Filter by exchange name
51    exchange: Option<String>,
52    /// Filter by country name or alpha code, e.g., `United States` or `US`
53    country: Option<String>,
54    /// The format of the response data
55    format: Option<String>,
56    /// The separator used in the CSV response data
57    delimiter: Option<String>,
58    /// Adds info on which plan symbol is available
59    show_plan: Option<bool>,
60    /// Page number of the results to fetch
61    page: Option<i64>,
62    /// Determines the number of data points returned in the output
63    outputsize: Option<i64>
64}
65
66impl GetBondsParamsBuilder {
67    /// The ticker symbol of an instrument for which data is requested
68    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
69        self.symbol = Some(symbol.into());
70        self
71    }
72    /// Filter by exchange name
73    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
74        self.exchange = Some(exchange.into());
75        self
76    }
77    /// Filter by country name or alpha code, e.g., `United States` or `US`
78    pub fn country(mut self, country: impl Into<String>) -> Self {
79        self.country = Some(country.into());
80        self
81    }
82    /// The format of the response data
83    pub fn format(mut self, format: impl Into<String>) -> Self {
84        self.format = Some(format.into());
85        self
86    }
87    /// The separator used in the CSV response data
88    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
89        self.delimiter = Some(delimiter.into());
90        self
91    }
92    /// Adds info on which plan symbol is available
93    pub fn show_plan(mut self, show_plan: bool) -> Self {
94        self.show_plan = Some(show_plan);
95        self
96    }
97    /// Page number of the results to fetch
98    pub fn page(mut self, page: i64) -> Self {
99        self.page = Some(page);
100        self
101    }
102    /// Determines the number of data points returned in the output
103    pub fn outputsize(mut self, outputsize: i64) -> Self {
104        self.outputsize = Some(outputsize);
105        self
106    }
107
108    /// Build the parameter struct
109    pub fn build(self) -> GetBondsParams {
110        GetBondsParams {
111            symbol: self.symbol,
112            exchange: self.exchange,
113            country: self.country,
114            format: self.format,
115            delimiter: self.delimiter,
116            show_plan: self.show_plan,
117            page: self.page,
118            outputsize: self.outputsize
119        }
120    }
121}
122
123/// struct for passing parameters to the method [`get_commodities`]
124#[derive(Clone, Debug, Default, Serialize, Deserialize)]
125pub struct GetCommoditiesParams {
126    /// The ticker symbol of an instrument for which data is requested
127    pub symbol: Option<String>,
128    /// Filter by category of commodity
129    pub category: Option<String>,
130    /// The format of the response data
131    pub format: Option<String>,
132    /// The separator used in the CSV response data
133    pub delimiter: Option<String>
134}
135
136impl GetCommoditiesParams {
137    /// Create a new builder for this parameter struct
138    pub fn builder() -> GetCommoditiesParamsBuilder {
139        GetCommoditiesParamsBuilder::default()
140    }
141}
142
143/// Builder for [`GetCommoditiesParams`]
144#[derive(Clone, Debug, Default)]
145pub struct GetCommoditiesParamsBuilder {
146    /// The ticker symbol of an instrument for which data is requested
147    symbol: Option<String>,
148    /// Filter by category of commodity
149    category: Option<String>,
150    /// The format of the response data
151    format: Option<String>,
152    /// The separator used in the CSV response data
153    delimiter: Option<String>
154}
155
156impl GetCommoditiesParamsBuilder {
157    /// The ticker symbol of an instrument for which data is requested
158    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
159        self.symbol = Some(symbol.into());
160        self
161    }
162    /// Filter by category of commodity
163    pub fn category(mut self, category: impl Into<String>) -> Self {
164        self.category = Some(category.into());
165        self
166    }
167    /// The format of the response data
168    pub fn format(mut self, format: impl Into<String>) -> Self {
169        self.format = Some(format.into());
170        self
171    }
172    /// The separator used in the CSV response data
173    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
174        self.delimiter = Some(delimiter.into());
175        self
176    }
177
178    /// Build the parameter struct
179    pub fn build(self) -> GetCommoditiesParams {
180        GetCommoditiesParams {
181            symbol: self.symbol,
182            category: self.category,
183            format: self.format,
184            delimiter: self.delimiter
185        }
186    }
187}
188
189/// struct for passing parameters to the method [`get_cross_listings`]
190#[derive(Clone, Debug, Default, Serialize, Deserialize)]
191pub struct GetCrossListingsParams {
192    /// The ticker symbol of an instrument for which data is requested
193    pub symbol: String,
194    /// Exchange where instrument is traded
195    pub exchange: Option<String>,
196    /// Market identifier code (MIC) under ISO 10383 standard
197    pub mic_code: Option<String>,
198    /// Country to which stock exchange belongs to
199    pub country: Option<String>
200}
201
202impl GetCrossListingsParams {
203    /// Create a new builder for this parameter struct
204    pub fn builder() -> GetCrossListingsParamsBuilder {
205        GetCrossListingsParamsBuilder::default()
206    }
207}
208
209/// Builder for [`GetCrossListingsParams`]
210#[derive(Clone, Debug, Default)]
211pub struct GetCrossListingsParamsBuilder {
212    /// The ticker symbol of an instrument for which data is requested
213    symbol: String,
214    /// Exchange where instrument is traded
215    exchange: Option<String>,
216    /// Market identifier code (MIC) under ISO 10383 standard
217    mic_code: Option<String>,
218    /// Country to which stock exchange belongs to
219    country: Option<String>
220}
221
222impl GetCrossListingsParamsBuilder {
223    /// The ticker symbol of an instrument for which data is requested
224    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
225        self.symbol = symbol.into();
226        self
227    }
228    /// Exchange where instrument is traded
229    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
230        self.exchange = Some(exchange.into());
231        self
232    }
233    /// Market identifier code (MIC) under ISO 10383 standard
234    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
235        self.mic_code = Some(mic_code.into());
236        self
237    }
238    /// Country to which stock exchange belongs to
239    pub fn country(mut self, country: impl Into<String>) -> Self {
240        self.country = Some(country.into());
241        self
242    }
243
244    /// Build the parameter struct
245    pub fn build(self) -> GetCrossListingsParams {
246        GetCrossListingsParams {
247            symbol: self.symbol,
248            exchange: self.exchange,
249            mic_code: self.mic_code,
250            country: self.country
251        }
252    }
253}
254
255/// struct for passing parameters to the method [`get_cryptocurrencies`]
256#[derive(Clone, Debug, Default, Serialize, Deserialize)]
257pub struct GetCryptocurrenciesParams {
258    /// The ticker symbol of an instrument for which data is requested
259    pub symbol: Option<String>,
260    /// Filter by exchange name. E.g. `Binance`, `Coinbase`, etc.
261    pub exchange: Option<String>,
262    /// Filter by currency base
263    pub currency_base: Option<String>,
264    /// Filter by currency quote
265    pub currency_quote: Option<String>,
266    /// The format of the response data
267    pub format: Option<String>,
268    /// The separator used in the CSV response data
269    pub delimiter: Option<String>
270}
271
272impl GetCryptocurrenciesParams {
273    /// Create a new builder for this parameter struct
274    pub fn builder() -> GetCryptocurrenciesParamsBuilder {
275        GetCryptocurrenciesParamsBuilder::default()
276    }
277}
278
279/// Builder for [`GetCryptocurrenciesParams`]
280#[derive(Clone, Debug, Default)]
281pub struct GetCryptocurrenciesParamsBuilder {
282    /// The ticker symbol of an instrument for which data is requested
283    symbol: Option<String>,
284    /// Filter by exchange name. E.g. `Binance`, `Coinbase`, etc.
285    exchange: Option<String>,
286    /// Filter by currency base
287    currency_base: Option<String>,
288    /// Filter by currency quote
289    currency_quote: Option<String>,
290    /// The format of the response data
291    format: Option<String>,
292    /// The separator used in the CSV response data
293    delimiter: Option<String>
294}
295
296impl GetCryptocurrenciesParamsBuilder {
297    /// The ticker symbol of an instrument for which data is requested
298    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
299        self.symbol = Some(symbol.into());
300        self
301    }
302    /// Filter by exchange name. E.g. `Binance`, `Coinbase`, etc.
303    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
304        self.exchange = Some(exchange.into());
305        self
306    }
307    /// Filter by currency base
308    pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
309        self.currency_base = Some(currency_base.into());
310        self
311    }
312    /// Filter by currency quote
313    pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
314        self.currency_quote = Some(currency_quote.into());
315        self
316    }
317    /// The format of the response data
318    pub fn format(mut self, format: impl Into<String>) -> Self {
319        self.format = Some(format.into());
320        self
321    }
322    /// The separator used in the CSV response data
323    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
324        self.delimiter = Some(delimiter.into());
325        self
326    }
327
328    /// Build the parameter struct
329    pub fn build(self) -> GetCryptocurrenciesParams {
330        GetCryptocurrenciesParams {
331            symbol: self.symbol,
332            exchange: self.exchange,
333            currency_base: self.currency_base,
334            currency_quote: self.currency_quote,
335            format: self.format,
336            delimiter: self.delimiter
337        }
338    }
339}
340
341/// struct for passing parameters to the method [`get_cryptocurrency_exchanges`]
342#[derive(Clone, Debug, Default, Serialize, Deserialize)]
343pub struct GetCryptocurrencyExchangesParams {
344    /// The format of the response data
345    pub format: Option<String>,
346    /// Specify the delimiter used when downloading the CSV file
347    pub delimiter: Option<String>
348}
349
350impl GetCryptocurrencyExchangesParams {
351    /// Create a new builder for this parameter struct
352    pub fn builder() -> GetCryptocurrencyExchangesParamsBuilder {
353        GetCryptocurrencyExchangesParamsBuilder::default()
354    }
355}
356
357/// Builder for [`GetCryptocurrencyExchangesParams`]
358#[derive(Clone, Debug, Default)]
359pub struct GetCryptocurrencyExchangesParamsBuilder {
360    /// The format of the response data
361    format: Option<String>,
362    /// Specify the delimiter used when downloading the CSV file
363    delimiter: Option<String>
364}
365
366impl GetCryptocurrencyExchangesParamsBuilder {
367    /// The format of the response data
368    pub fn format(mut self, format: impl Into<String>) -> Self {
369        self.format = Some(format.into());
370        self
371    }
372    /// Specify the delimiter used when downloading the CSV file
373    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
374        self.delimiter = Some(delimiter.into());
375        self
376    }
377
378    /// Build the parameter struct
379    pub fn build(self) -> GetCryptocurrencyExchangesParams {
380        GetCryptocurrencyExchangesParams {
381            format: self.format,
382            delimiter: self.delimiter
383        }
384    }
385}
386
387/// struct for passing parameters to the method [`get_earliest_timestamp`]
388#[derive(Clone, Debug, Default, Serialize, Deserialize)]
389pub struct GetEarliestTimestampParams {
390    /// Interval between two consecutive points in time series.
391    pub interval: String,
392    /// Symbol ticker of the instrument.
393    pub symbol: Option<String>,
394    /// Filter by financial instrument global identifier (FIGI).
395    pub figi: Option<String>,
396    /// Filter by international securities identification number (ISIN)
397    pub isin: Option<String>,
398    /// 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
399    pub cusip: Option<String>,
400    /// Exchange where instrument is traded.
401    pub exchange: Option<String>,
402    /// Market Identifier Code (MIC) under ISO 10383 standard.
403    pub mic_code: Option<String>,
404    /// Timezone at which output datetime will be displayed. Supports: <ul> <li>1. <code>Exchange</code> for local exchange time</li> <li>2. <code>UTC</code> for datetime at universal UTC standard</li> <li>3. Timezone name according to the IANA Time Zone Database. E.g. <code>America/New_York</code>, <code>Asia/Singapore</code>. Full list of timezones can be found <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\" target=\"blank\">here</a>.</li> </ul> <i>Take note that the IANA Timezone name is case-sensitive</i>
405    pub timezone: Option<String>
406}
407
408impl GetEarliestTimestampParams {
409    /// Create a new builder for this parameter struct
410    pub fn builder() -> GetEarliestTimestampParamsBuilder {
411        GetEarliestTimestampParamsBuilder::default()
412    }
413}
414
415/// Builder for [`GetEarliestTimestampParams`]
416#[derive(Clone, Debug, Default)]
417pub struct GetEarliestTimestampParamsBuilder {
418    /// Interval between two consecutive points in time series.
419    interval: String,
420    /// Symbol ticker of the instrument.
421    symbol: Option<String>,
422    /// Filter by financial instrument global identifier (FIGI).
423    figi: Option<String>,
424    /// Filter by international securities identification number (ISIN)
425    isin: Option<String>,
426    /// 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
427    cusip: Option<String>,
428    /// Exchange where instrument is traded.
429    exchange: Option<String>,
430    /// Market Identifier Code (MIC) under ISO 10383 standard.
431    mic_code: Option<String>,
432    /// Timezone at which output datetime will be displayed. Supports: <ul> <li>1. <code>Exchange</code> for local exchange time</li> <li>2. <code>UTC</code> for datetime at universal UTC standard</li> <li>3. Timezone name according to the IANA Time Zone Database. E.g. <code>America/New_York</code>, <code>Asia/Singapore</code>. Full list of timezones can be found <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\" target=\"blank\">here</a>.</li> </ul> <i>Take note that the IANA Timezone name is case-sensitive</i>
433    timezone: Option<String>
434}
435
436impl GetEarliestTimestampParamsBuilder {
437    /// Interval between two consecutive points in time series.
438    pub fn interval(mut self, interval: impl Into<String>) -> Self {
439        self.interval = interval.into();
440        self
441    }
442    /// Symbol ticker of the instrument.
443    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
444        self.symbol = Some(symbol.into());
445        self
446    }
447    /// Filter by financial instrument global identifier (FIGI).
448    pub fn figi(mut self, figi: impl Into<String>) -> Self {
449        self.figi = Some(figi.into());
450        self
451    }
452    /// Filter by international securities identification number (ISIN)
453    pub fn isin(mut self, isin: impl Into<String>) -> Self {
454        self.isin = Some(isin.into());
455        self
456    }
457    /// 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
458    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
459        self.cusip = Some(cusip.into());
460        self
461    }
462    /// Exchange where instrument is traded.
463    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
464        self.exchange = Some(exchange.into());
465        self
466    }
467    /// Market Identifier Code (MIC) under ISO 10383 standard.
468    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
469        self.mic_code = Some(mic_code.into());
470        self
471    }
472    /// Timezone at which output datetime will be displayed. Supports: <ul> <li>1. <code>Exchange</code> for local exchange time</li> <li>2. <code>UTC</code> for datetime at universal UTC standard</li> <li>3. Timezone name according to the IANA Time Zone Database. E.g. <code>America/New_York</code>, <code>Asia/Singapore</code>. Full list of timezones can be found <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\" target=\"blank\">here</a>.</li> </ul> <i>Take note that the IANA Timezone name is case-sensitive</i>
473    pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
474        self.timezone = Some(timezone.into());
475        self
476    }
477
478    /// Build the parameter struct
479    pub fn build(self) -> GetEarliestTimestampParams {
480        GetEarliestTimestampParams {
481            interval: self.interval,
482            symbol: self.symbol,
483            figi: self.figi,
484            isin: self.isin,
485            cusip: self.cusip,
486            exchange: self.exchange,
487            mic_code: self.mic_code,
488            timezone: self.timezone
489        }
490    }
491}
492
493/// struct for passing parameters to the method [`get_etf`]
494#[derive(Clone, Debug, Default, Serialize, Deserialize)]
495pub struct GetEtfParams {
496    /// The ticker symbol of an instrument for which data is requested
497    pub symbol: Option<String>,
498    /// Filter by financial instrument global identifier (FIGI)
499    pub figi: Option<String>,
500    /// Filter by international securities identification number (ISIN)
501    pub isin: Option<String>,
502    /// 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
503    pub cusip: Option<String>,
504    /// The CIK of an instrument for which data is requested
505    pub cik: Option<String>,
506    /// Filter by exchange name
507    pub exchange: Option<String>,
508    /// Filter by market identifier code (MIC) under ISO 10383 standard
509    pub mic_code: Option<String>,
510    /// Filter by country name or alpha code, e.g., `United States` or `US`
511    pub country: Option<String>,
512    /// The format of the response data
513    pub format: Option<String>,
514    /// The separator used in the CSV response data
515    pub delimiter: Option<String>,
516    /// Adds info on which plan symbol is available
517    pub show_plan: Option<bool>,
518    /// Include delisted identifiers
519    pub include_delisted: Option<bool>
520}
521
522impl GetEtfParams {
523    /// Create a new builder for this parameter struct
524    pub fn builder() -> GetEtfParamsBuilder {
525        GetEtfParamsBuilder::default()
526    }
527}
528
529/// Builder for [`GetEtfParams`]
530#[derive(Clone, Debug, Default)]
531pub struct GetEtfParamsBuilder {
532    /// The ticker symbol of an instrument for which data is requested
533    symbol: Option<String>,
534    /// Filter by financial instrument global identifier (FIGI)
535    figi: Option<String>,
536    /// Filter by international securities identification number (ISIN)
537    isin: Option<String>,
538    /// 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
539    cusip: Option<String>,
540    /// The CIK of an instrument for which data is requested
541    cik: Option<String>,
542    /// Filter by exchange name
543    exchange: Option<String>,
544    /// Filter by market identifier code (MIC) under ISO 10383 standard
545    mic_code: Option<String>,
546    /// Filter by country name or alpha code, e.g., `United States` or `US`
547    country: Option<String>,
548    /// The format of the response data
549    format: Option<String>,
550    /// The separator used in the CSV response data
551    delimiter: Option<String>,
552    /// Adds info on which plan symbol is available
553    show_plan: Option<bool>,
554    /// Include delisted identifiers
555    include_delisted: Option<bool>
556}
557
558impl GetEtfParamsBuilder {
559    /// The ticker symbol of an instrument for which data is requested
560    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
561        self.symbol = Some(symbol.into());
562        self
563    }
564    /// Filter by financial instrument global identifier (FIGI)
565    pub fn figi(mut self, figi: impl Into<String>) -> Self {
566        self.figi = Some(figi.into());
567        self
568    }
569    /// Filter by international securities identification number (ISIN)
570    pub fn isin(mut self, isin: impl Into<String>) -> Self {
571        self.isin = Some(isin.into());
572        self
573    }
574    /// 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
575    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
576        self.cusip = Some(cusip.into());
577        self
578    }
579    /// The CIK of an instrument for which data is requested
580    pub fn cik(mut self, cik: impl Into<String>) -> Self {
581        self.cik = Some(cik.into());
582        self
583    }
584    /// Filter by exchange name
585    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
586        self.exchange = Some(exchange.into());
587        self
588    }
589    /// Filter by market identifier code (MIC) under ISO 10383 standard
590    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
591        self.mic_code = Some(mic_code.into());
592        self
593    }
594    /// Filter by country name or alpha code, e.g., `United States` or `US`
595    pub fn country(mut self, country: impl Into<String>) -> Self {
596        self.country = Some(country.into());
597        self
598    }
599    /// The format of the response data
600    pub fn format(mut self, format: impl Into<String>) -> Self {
601        self.format = Some(format.into());
602        self
603    }
604    /// The separator used in the CSV response data
605    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
606        self.delimiter = Some(delimiter.into());
607        self
608    }
609    /// Adds info on which plan symbol is available
610    pub fn show_plan(mut self, show_plan: bool) -> Self {
611        self.show_plan = Some(show_plan);
612        self
613    }
614    /// Include delisted identifiers
615    pub fn include_delisted(mut self, include_delisted: bool) -> Self {
616        self.include_delisted = Some(include_delisted);
617        self
618    }
619
620    /// Build the parameter struct
621    pub fn build(self) -> GetEtfParams {
622        GetEtfParams {
623            symbol: self.symbol,
624            figi: self.figi,
625            isin: self.isin,
626            cusip: self.cusip,
627            cik: self.cik,
628            exchange: self.exchange,
629            mic_code: self.mic_code,
630            country: self.country,
631            format: self.format,
632            delimiter: self.delimiter,
633            show_plan: self.show_plan,
634            include_delisted: self.include_delisted
635        }
636    }
637}
638
639/// struct for passing parameters to the method [`get_etfs_family`]
640#[derive(Clone, Debug, Default, Serialize, Deserialize)]
641pub struct GetEtfsFamilyParams {
642    /// Filter by country name or alpha code, e.g., `United States` or `US`
643    pub country: Option<String>,
644    /// Filter by investment company that manages the fund
645    pub fund_family: Option<String>
646}
647
648impl GetEtfsFamilyParams {
649    /// Create a new builder for this parameter struct
650    pub fn builder() -> GetEtfsFamilyParamsBuilder {
651        GetEtfsFamilyParamsBuilder::default()
652    }
653}
654
655/// Builder for [`GetEtfsFamilyParams`]
656#[derive(Clone, Debug, Default)]
657pub struct GetEtfsFamilyParamsBuilder {
658    /// Filter by country name or alpha code, e.g., `United States` or `US`
659    country: Option<String>,
660    /// Filter by investment company that manages the fund
661    fund_family: Option<String>
662}
663
664impl GetEtfsFamilyParamsBuilder {
665    /// Filter by country name or alpha code, e.g., `United States` or `US`
666    pub fn country(mut self, country: impl Into<String>) -> Self {
667        self.country = Some(country.into());
668        self
669    }
670    /// Filter by investment company that manages the fund
671    pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
672        self.fund_family = Some(fund_family.into());
673        self
674    }
675
676    /// Build the parameter struct
677    pub fn build(self) -> GetEtfsFamilyParams {
678        GetEtfsFamilyParams {
679            country: self.country,
680            fund_family: self.fund_family
681        }
682    }
683}
684
685/// struct for passing parameters to the method [`get_etfs_list`]
686#[derive(Clone, Debug, Default, Serialize, Deserialize)]
687pub struct GetEtfsListParams {
688    /// Filter by symbol
689    pub symbol: Option<String>,
690    /// Filter by financial instrument global identifier (FIGI)
691    pub figi: Option<String>,
692    /// Filter by international securities identification number (ISIN)
693    pub isin: Option<String>,
694    /// 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
695    pub cusip: Option<String>,
696    /// The CIK of an instrument for which data is requested
697    pub cik: Option<String>,
698    /// Filter by country name or alpha code, e.g., `United States` or `US`
699    pub country: Option<String>,
700    /// Filter by investment company that manages the fund
701    pub fund_family: Option<String>,
702    /// Filter by the type of fund
703    pub fund_type: Option<String>,
704    /// Page number
705    pub page: Option<i64>,
706    /// Number of records in response
707    pub outputsize: Option<i64>
708}
709
710impl GetEtfsListParams {
711    /// Create a new builder for this parameter struct
712    pub fn builder() -> GetEtfsListParamsBuilder {
713        GetEtfsListParamsBuilder::default()
714    }
715}
716
717/// Builder for [`GetEtfsListParams`]
718#[derive(Clone, Debug, Default)]
719pub struct GetEtfsListParamsBuilder {
720    /// Filter by symbol
721    symbol: Option<String>,
722    /// Filter by financial instrument global identifier (FIGI)
723    figi: Option<String>,
724    /// Filter by international securities identification number (ISIN)
725    isin: Option<String>,
726    /// 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
727    cusip: Option<String>,
728    /// The CIK of an instrument for which data is requested
729    cik: Option<String>,
730    /// Filter by country name or alpha code, e.g., `United States` or `US`
731    country: Option<String>,
732    /// Filter by investment company that manages the fund
733    fund_family: Option<String>,
734    /// Filter by the type of fund
735    fund_type: Option<String>,
736    /// Page number
737    page: Option<i64>,
738    /// Number of records in response
739    outputsize: Option<i64>
740}
741
742impl GetEtfsListParamsBuilder {
743    /// Filter by symbol
744    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
745        self.symbol = Some(symbol.into());
746        self
747    }
748    /// Filter by financial instrument global identifier (FIGI)
749    pub fn figi(mut self, figi: impl Into<String>) -> Self {
750        self.figi = Some(figi.into());
751        self
752    }
753    /// Filter by international securities identification number (ISIN)
754    pub fn isin(mut self, isin: impl Into<String>) -> Self {
755        self.isin = Some(isin.into());
756        self
757    }
758    /// 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
759    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
760        self.cusip = Some(cusip.into());
761        self
762    }
763    /// The CIK of an instrument for which data is requested
764    pub fn cik(mut self, cik: impl Into<String>) -> Self {
765        self.cik = Some(cik.into());
766        self
767    }
768    /// Filter by country name or alpha code, e.g., `United States` or `US`
769    pub fn country(mut self, country: impl Into<String>) -> Self {
770        self.country = Some(country.into());
771        self
772    }
773    /// Filter by investment company that manages the fund
774    pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
775        self.fund_family = Some(fund_family.into());
776        self
777    }
778    /// Filter by the type of fund
779    pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
780        self.fund_type = Some(fund_type.into());
781        self
782    }
783    /// Page number
784    pub fn page(mut self, page: i64) -> Self {
785        self.page = Some(page);
786        self
787    }
788    /// Number of records in response
789    pub fn outputsize(mut self, outputsize: i64) -> Self {
790        self.outputsize = Some(outputsize);
791        self
792    }
793
794    /// Build the parameter struct
795    pub fn build(self) -> GetEtfsListParams {
796        GetEtfsListParams {
797            symbol: self.symbol,
798            figi: self.figi,
799            isin: self.isin,
800            cusip: self.cusip,
801            cik: self.cik,
802            country: self.country,
803            fund_family: self.fund_family,
804            fund_type: self.fund_type,
805            page: self.page,
806            outputsize: self.outputsize
807        }
808    }
809}
810
811/// struct for passing parameters to the method [`get_etfs_type`]
812#[derive(Clone, Debug, Default, Serialize, Deserialize)]
813pub struct GetEtfsTypeParams {
814    /// Filter by country name or alpha code, e.g., `United States` or `US`
815    pub country: Option<String>,
816    /// Filter by the type of fund
817    pub fund_type: Option<String>
818}
819
820impl GetEtfsTypeParams {
821    /// Create a new builder for this parameter struct
822    pub fn builder() -> GetEtfsTypeParamsBuilder {
823        GetEtfsTypeParamsBuilder::default()
824    }
825}
826
827/// Builder for [`GetEtfsTypeParams`]
828#[derive(Clone, Debug, Default)]
829pub struct GetEtfsTypeParamsBuilder {
830    /// Filter by country name or alpha code, e.g., `United States` or `US`
831    country: Option<String>,
832    /// Filter by the type of fund
833    fund_type: Option<String>
834}
835
836impl GetEtfsTypeParamsBuilder {
837    /// Filter by country name or alpha code, e.g., `United States` or `US`
838    pub fn country(mut self, country: impl Into<String>) -> Self {
839        self.country = Some(country.into());
840        self
841    }
842    /// Filter by the type of fund
843    pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
844        self.fund_type = Some(fund_type.into());
845        self
846    }
847
848    /// Build the parameter struct
849    pub fn build(self) -> GetEtfsTypeParams {
850        GetEtfsTypeParams {
851            country: self.country,
852            fund_type: self.fund_type
853        }
854    }
855}
856
857/// struct for passing parameters to the method [`get_exchange_schedule`]
858#[derive(Clone, Debug, Default, Serialize, Deserialize)]
859pub struct GetExchangeScheduleParams {
860    /// Filter by exchange name
861    pub mic_name: Option<String>,
862    /// Filter by market identifier code (MIC) under ISO 10383 standard
863    pub mic_code: Option<String>,
864    /// Filter by country name or alpha code, e.g., `United States` or `US`
865    pub country: Option<String>,
866    /// <p> If a date is provided, the API returns the schedule for the specified date; otherwise, it returns the default (common) schedule. </p> The date can be specified in one of the following formats: <ul> <li>An exact date (e.g., <code>2021-10-27</code>)</li> <li>A human-readable keyword: <code>today</code> or <code>yesterday</code></li> <li>A full datetime string in UTC (e.g., <code>2025-04-11T20:00:00</code>) to retrieve the schedule corresponding to the day in the specified time.</li> </ul> When using a datetime value, the resulting schedule will correspond to the local calendar day at the specified time. For example, <code>2025-04-11T20:00:00 UTC</code> corresponds to: <ul> <li><code>2025-04-11</code> in the <code>America/New_York</code> timezone</li> <li><code>2025-04-12</code> in the <code>Australia/Sydney</code> timezone</li> </ul>
867    pub date: Option<String>
868}
869
870impl GetExchangeScheduleParams {
871    /// Create a new builder for this parameter struct
872    pub fn builder() -> GetExchangeScheduleParamsBuilder {
873        GetExchangeScheduleParamsBuilder::default()
874    }
875}
876
877/// Builder for [`GetExchangeScheduleParams`]
878#[derive(Clone, Debug, Default)]
879pub struct GetExchangeScheduleParamsBuilder {
880    /// Filter by exchange name
881    mic_name: Option<String>,
882    /// Filter by market identifier code (MIC) under ISO 10383 standard
883    mic_code: Option<String>,
884    /// Filter by country name or alpha code, e.g., `United States` or `US`
885    country: Option<String>,
886    /// <p> If a date is provided, the API returns the schedule for the specified date; otherwise, it returns the default (common) schedule. </p> The date can be specified in one of the following formats: <ul> <li>An exact date (e.g., <code>2021-10-27</code>)</li> <li>A human-readable keyword: <code>today</code> or <code>yesterday</code></li> <li>A full datetime string in UTC (e.g., <code>2025-04-11T20:00:00</code>) to retrieve the schedule corresponding to the day in the specified time.</li> </ul> When using a datetime value, the resulting schedule will correspond to the local calendar day at the specified time. For example, <code>2025-04-11T20:00:00 UTC</code> corresponds to: <ul> <li><code>2025-04-11</code> in the <code>America/New_York</code> timezone</li> <li><code>2025-04-12</code> in the <code>Australia/Sydney</code> timezone</li> </ul>
887    date: Option<String>
888}
889
890impl GetExchangeScheduleParamsBuilder {
891    /// Filter by exchange name
892    pub fn mic_name(mut self, mic_name: impl Into<String>) -> Self {
893        self.mic_name = Some(mic_name.into());
894        self
895    }
896    /// Filter by market identifier code (MIC) under ISO 10383 standard
897    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
898        self.mic_code = Some(mic_code.into());
899        self
900    }
901    /// Filter by country name or alpha code, e.g., `United States` or `US`
902    pub fn country(mut self, country: impl Into<String>) -> Self {
903        self.country = Some(country.into());
904        self
905    }
906    /// <p> If a date is provided, the API returns the schedule for the specified date; otherwise, it returns the default (common) schedule. </p> The date can be specified in one of the following formats: <ul> <li>An exact date (e.g., <code>2021-10-27</code>)</li> <li>A human-readable keyword: <code>today</code> or <code>yesterday</code></li> <li>A full datetime string in UTC (e.g., <code>2025-04-11T20:00:00</code>) to retrieve the schedule corresponding to the day in the specified time.</li> </ul> When using a datetime value, the resulting schedule will correspond to the local calendar day at the specified time. For example, <code>2025-04-11T20:00:00 UTC</code> corresponds to: <ul> <li><code>2025-04-11</code> in the <code>America/New_York</code> timezone</li> <li><code>2025-04-12</code> in the <code>Australia/Sydney</code> timezone</li> </ul>
907    pub fn date(mut self, date: impl Into<String>) -> Self {
908        self.date = Some(date.into());
909        self
910    }
911
912    /// Build the parameter struct
913    pub fn build(self) -> GetExchangeScheduleParams {
914        GetExchangeScheduleParams {
915            mic_name: self.mic_name,
916            mic_code: self.mic_code,
917            country: self.country,
918            date: self.date
919        }
920    }
921}
922
923/// struct for passing parameters to the method [`get_exchanges`]
924#[derive(Clone, Debug, Default, Serialize, Deserialize)]
925pub struct GetExchangesParams {
926    /// The asset class to which the instrument belongs
927    pub r#type: Option<String>,
928    /// Filter by exchange name
929    pub name: Option<String>,
930    /// Filter by market identifier code (MIC) under ISO 10383 standard
931    pub code: Option<String>,
932    /// Filter by country name or alpha code, e.g., `United States` or `US`
933    pub country: Option<String>,
934    /// The format of the response data
935    pub format: Option<String>,
936    /// The separator used in the CSV response data
937    pub delimiter: Option<String>,
938    /// Adds info on which plan symbol is available
939    pub show_plan: Option<bool>
940}
941
942impl GetExchangesParams {
943    /// Create a new builder for this parameter struct
944    pub fn builder() -> GetExchangesParamsBuilder {
945        GetExchangesParamsBuilder::default()
946    }
947}
948
949/// Builder for [`GetExchangesParams`]
950#[derive(Clone, Debug, Default)]
951pub struct GetExchangesParamsBuilder {
952    /// The asset class to which the instrument belongs
953    r#type: Option<String>,
954    /// Filter by exchange name
955    name: Option<String>,
956    /// Filter by market identifier code (MIC) under ISO 10383 standard
957    code: Option<String>,
958    /// Filter by country name or alpha code, e.g., `United States` or `US`
959    country: Option<String>,
960    /// The format of the response data
961    format: Option<String>,
962    /// The separator used in the CSV response data
963    delimiter: Option<String>,
964    /// Adds info on which plan symbol is available
965    show_plan: Option<bool>
966}
967
968impl GetExchangesParamsBuilder {
969    /// The asset class to which the instrument belongs
970    pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
971        self.r#type = Some(r#type.into());
972        self
973    }
974    /// Filter by exchange name
975    pub fn name(mut self, name: impl Into<String>) -> Self {
976        self.name = Some(name.into());
977        self
978    }
979    /// Filter by market identifier code (MIC) under ISO 10383 standard
980    pub fn code(mut self, code: impl Into<String>) -> Self {
981        self.code = Some(code.into());
982        self
983    }
984    /// Filter by country name or alpha code, e.g., `United States` or `US`
985    pub fn country(mut self, country: impl Into<String>) -> Self {
986        self.country = Some(country.into());
987        self
988    }
989    /// The format of the response data
990    pub fn format(mut self, format: impl Into<String>) -> Self {
991        self.format = Some(format.into());
992        self
993    }
994    /// The separator used in the CSV response data
995    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
996        self.delimiter = Some(delimiter.into());
997        self
998    }
999    /// Adds info on which plan symbol is available
1000    pub fn show_plan(mut self, show_plan: bool) -> Self {
1001        self.show_plan = Some(show_plan);
1002        self
1003    }
1004
1005    /// Build the parameter struct
1006    pub fn build(self) -> GetExchangesParams {
1007        GetExchangesParams {
1008            r#type: self.r#type,
1009            name: self.name,
1010            code: self.code,
1011            country: self.country,
1012            format: self.format,
1013            delimiter: self.delimiter,
1014            show_plan: self.show_plan
1015        }
1016    }
1017}
1018
1019/// struct for passing parameters to the method [`get_forex_pairs`]
1020#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1021pub struct GetForexPairsParams {
1022    /// The ticker symbol of an instrument for which data is requested
1023    pub symbol: Option<String>,
1024    /// Filter by currency base
1025    pub currency_base: Option<String>,
1026    /// Filter by currency quote
1027    pub currency_quote: Option<String>,
1028    /// The format of the response data
1029    pub format: Option<String>,
1030    /// The separator used in the CSV response data
1031    pub delimiter: Option<String>
1032}
1033
1034impl GetForexPairsParams {
1035    /// Create a new builder for this parameter struct
1036    pub fn builder() -> GetForexPairsParamsBuilder {
1037        GetForexPairsParamsBuilder::default()
1038    }
1039}
1040
1041/// Builder for [`GetForexPairsParams`]
1042#[derive(Clone, Debug, Default)]
1043pub struct GetForexPairsParamsBuilder {
1044    /// The ticker symbol of an instrument for which data is requested
1045    symbol: Option<String>,
1046    /// Filter by currency base
1047    currency_base: Option<String>,
1048    /// Filter by currency quote
1049    currency_quote: Option<String>,
1050    /// The format of the response data
1051    format: Option<String>,
1052    /// The separator used in the CSV response data
1053    delimiter: Option<String>
1054}
1055
1056impl GetForexPairsParamsBuilder {
1057    /// The ticker symbol of an instrument for which data is requested
1058    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1059        self.symbol = Some(symbol.into());
1060        self
1061    }
1062    /// Filter by currency base
1063    pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
1064        self.currency_base = Some(currency_base.into());
1065        self
1066    }
1067    /// Filter by currency quote
1068    pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
1069        self.currency_quote = Some(currency_quote.into());
1070        self
1071    }
1072    /// The format of the response data
1073    pub fn format(mut self, format: impl Into<String>) -> Self {
1074        self.format = Some(format.into());
1075        self
1076    }
1077    /// The separator used in the CSV response data
1078    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1079        self.delimiter = Some(delimiter.into());
1080        self
1081    }
1082
1083    /// Build the parameter struct
1084    pub fn build(self) -> GetForexPairsParams {
1085        GetForexPairsParams {
1086            symbol: self.symbol,
1087            currency_base: self.currency_base,
1088            currency_quote: self.currency_quote,
1089            format: self.format,
1090            delimiter: self.delimiter
1091        }
1092    }
1093}
1094
1095/// struct for passing parameters to the method [`get_funds`]
1096#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1097pub struct GetFundsParams {
1098    /// The ticker symbol of an instrument for which data is requested
1099    pub symbol: Option<String>,
1100    /// Filter by financial instrument global identifier (FIGI)
1101    pub figi: Option<String>,
1102    /// Filter by international securities identification number (ISIN)
1103    pub isin: Option<String>,
1104    /// 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
1105    pub cusip: Option<String>,
1106    /// The CIK of an instrument for which data is requested
1107    pub cik: Option<String>,
1108    /// Filter by exchange name
1109    pub exchange: Option<String>,
1110    /// Filter by country name or alpha code, e.g., `United States` or `US`
1111    pub country: Option<String>,
1112    /// The format of the response data
1113    pub format: Option<String>,
1114    /// The separator used in the CSV response data
1115    pub delimiter: Option<String>,
1116    /// Adds info on which plan symbol is available
1117    pub show_plan: Option<bool>,
1118    /// Page number of the results to fetch
1119    pub page: Option<i64>,
1120    /// Determines the number of data points returned in the output
1121    pub outputsize: Option<i64>
1122}
1123
1124impl GetFundsParams {
1125    /// Create a new builder for this parameter struct
1126    pub fn builder() -> GetFundsParamsBuilder {
1127        GetFundsParamsBuilder::default()
1128    }
1129}
1130
1131/// Builder for [`GetFundsParams`]
1132#[derive(Clone, Debug, Default)]
1133pub struct GetFundsParamsBuilder {
1134    /// The ticker symbol of an instrument for which data is requested
1135    symbol: Option<String>,
1136    /// Filter by financial instrument global identifier (FIGI)
1137    figi: Option<String>,
1138    /// Filter by international securities identification number (ISIN)
1139    isin: Option<String>,
1140    /// 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
1141    cusip: Option<String>,
1142    /// The CIK of an instrument for which data is requested
1143    cik: Option<String>,
1144    /// Filter by exchange name
1145    exchange: Option<String>,
1146    /// Filter by country name or alpha code, e.g., `United States` or `US`
1147    country: Option<String>,
1148    /// The format of the response data
1149    format: Option<String>,
1150    /// The separator used in the CSV response data
1151    delimiter: Option<String>,
1152    /// Adds info on which plan symbol is available
1153    show_plan: Option<bool>,
1154    /// Page number of the results to fetch
1155    page: Option<i64>,
1156    /// Determines the number of data points returned in the output
1157    outputsize: Option<i64>
1158}
1159
1160impl GetFundsParamsBuilder {
1161    /// The ticker symbol of an instrument for which data is requested
1162    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1163        self.symbol = Some(symbol.into());
1164        self
1165    }
1166    /// Filter by financial instrument global identifier (FIGI)
1167    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1168        self.figi = Some(figi.into());
1169        self
1170    }
1171    /// Filter by international securities identification number (ISIN)
1172    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1173        self.isin = Some(isin.into());
1174        self
1175    }
1176    /// 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
1177    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1178        self.cusip = Some(cusip.into());
1179        self
1180    }
1181    /// The CIK of an instrument for which data is requested
1182    pub fn cik(mut self, cik: impl Into<String>) -> Self {
1183        self.cik = Some(cik.into());
1184        self
1185    }
1186    /// Filter by exchange name
1187    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1188        self.exchange = Some(exchange.into());
1189        self
1190    }
1191    /// Filter by country name or alpha code, e.g., `United States` or `US`
1192    pub fn country(mut self, country: impl Into<String>) -> Self {
1193        self.country = Some(country.into());
1194        self
1195    }
1196    /// The format of the response data
1197    pub fn format(mut self, format: impl Into<String>) -> Self {
1198        self.format = Some(format.into());
1199        self
1200    }
1201    /// The separator used in the CSV response data
1202    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1203        self.delimiter = Some(delimiter.into());
1204        self
1205    }
1206    /// Adds info on which plan symbol is available
1207    pub fn show_plan(mut self, show_plan: bool) -> Self {
1208        self.show_plan = Some(show_plan);
1209        self
1210    }
1211    /// Page number of the results to fetch
1212    pub fn page(mut self, page: i64) -> Self {
1213        self.page = Some(page);
1214        self
1215    }
1216    /// Determines the number of data points returned in the output
1217    pub fn outputsize(mut self, outputsize: i64) -> Self {
1218        self.outputsize = Some(outputsize);
1219        self
1220    }
1221
1222    /// Build the parameter struct
1223    pub fn build(self) -> GetFundsParams {
1224        GetFundsParams {
1225            symbol: self.symbol,
1226            figi: self.figi,
1227            isin: self.isin,
1228            cusip: self.cusip,
1229            cik: self.cik,
1230            exchange: self.exchange,
1231            country: self.country,
1232            format: self.format,
1233            delimiter: self.delimiter,
1234            show_plan: self.show_plan,
1235            page: self.page,
1236            outputsize: self.outputsize
1237        }
1238    }
1239}
1240
1241/// struct for passing parameters to the method [`get_market_state`]
1242#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1243pub struct GetMarketStateParams {
1244    /// The exchange name where the instrument is traded.
1245    pub exchange: Option<String>,
1246    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded.
1247    pub code: Option<String>,
1248    /// The country where the exchange is located. Takes country name or alpha code.
1249    pub country: Option<String>
1250}
1251
1252impl GetMarketStateParams {
1253    /// Create a new builder for this parameter struct
1254    pub fn builder() -> GetMarketStateParamsBuilder {
1255        GetMarketStateParamsBuilder::default()
1256    }
1257}
1258
1259/// Builder for [`GetMarketStateParams`]
1260#[derive(Clone, Debug, Default)]
1261pub struct GetMarketStateParamsBuilder {
1262    /// The exchange name where the instrument is traded.
1263    exchange: Option<String>,
1264    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded.
1265    code: Option<String>,
1266    /// The country where the exchange is located. Takes country name or alpha code.
1267    country: Option<String>
1268}
1269
1270impl GetMarketStateParamsBuilder {
1271    /// The exchange name where the instrument is traded.
1272    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1273        self.exchange = Some(exchange.into());
1274        self
1275    }
1276    /// The Market Identifier Code (MIC) of the exchange where the instrument is traded.
1277    pub fn code(mut self, code: impl Into<String>) -> Self {
1278        self.code = Some(code.into());
1279        self
1280    }
1281    /// The country where the exchange is located. Takes country name or alpha code.
1282    pub fn country(mut self, country: impl Into<String>) -> Self {
1283        self.country = Some(country.into());
1284        self
1285    }
1286
1287    /// Build the parameter struct
1288    pub fn build(self) -> GetMarketStateParams {
1289        GetMarketStateParams {
1290            exchange: self.exchange,
1291            code: self.code,
1292            country: self.country
1293        }
1294    }
1295}
1296
1297/// struct for passing parameters to the method [`get_mutual_funds_family`]
1298#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1299pub struct GetMutualFundsFamilyParams {
1300    /// Filter by investment company that manages the fund
1301    pub fund_family: Option<String>,
1302    /// Filter by country name or alpha code, e.g., `United States` or `US`
1303    pub country: Option<String>
1304}
1305
1306impl GetMutualFundsFamilyParams {
1307    /// Create a new builder for this parameter struct
1308    pub fn builder() -> GetMutualFundsFamilyParamsBuilder {
1309        GetMutualFundsFamilyParamsBuilder::default()
1310    }
1311}
1312
1313/// Builder for [`GetMutualFundsFamilyParams`]
1314#[derive(Clone, Debug, Default)]
1315pub struct GetMutualFundsFamilyParamsBuilder {
1316    /// Filter by investment company that manages the fund
1317    fund_family: Option<String>,
1318    /// Filter by country name or alpha code, e.g., `United States` or `US`
1319    country: Option<String>
1320}
1321
1322impl GetMutualFundsFamilyParamsBuilder {
1323    /// Filter by investment company that manages the fund
1324    pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1325        self.fund_family = Some(fund_family.into());
1326        self
1327    }
1328    /// Filter by country name or alpha code, e.g., `United States` or `US`
1329    pub fn country(mut self, country: impl Into<String>) -> Self {
1330        self.country = Some(country.into());
1331        self
1332    }
1333
1334    /// Build the parameter struct
1335    pub fn build(self) -> GetMutualFundsFamilyParams {
1336        GetMutualFundsFamilyParams {
1337            fund_family: self.fund_family,
1338            country: self.country
1339        }
1340    }
1341}
1342
1343/// struct for passing parameters to the method [`get_mutual_funds_list`]
1344#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1345pub struct GetMutualFundsListParams {
1346    /// Filter by symbol
1347    pub symbol: Option<String>,
1348    /// Filter by financial instrument global identifier (FIGI)
1349    pub figi: Option<String>,
1350    /// Filter by international securities identification number (ISIN)
1351    pub isin: Option<String>,
1352    /// 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
1353    pub cusip: Option<String>,
1354    /// The CIK of an instrument for which data is requested
1355    pub cik: Option<String>,
1356    /// Filter by country name or alpha code, e.g., `United States` or `US`
1357    pub country: Option<String>,
1358    /// Filter by investment company that manages the fund
1359    pub fund_family: Option<String>,
1360    /// Filter by the type of fund
1361    pub fund_type: Option<String>,
1362    /// Filter by performance rating from `0` to `5`
1363    pub performance_rating: Option<i64>,
1364    /// Filter by risk rating from `0` to `5`
1365    pub risk_rating: Option<i64>,
1366    /// Page number
1367    pub page: Option<i64>,
1368    /// Number of records in response
1369    pub outputsize: Option<i64>
1370}
1371
1372impl GetMutualFundsListParams {
1373    /// Create a new builder for this parameter struct
1374    pub fn builder() -> GetMutualFundsListParamsBuilder {
1375        GetMutualFundsListParamsBuilder::default()
1376    }
1377}
1378
1379/// Builder for [`GetMutualFundsListParams`]
1380#[derive(Clone, Debug, Default)]
1381pub struct GetMutualFundsListParamsBuilder {
1382    /// Filter by symbol
1383    symbol: Option<String>,
1384    /// Filter by financial instrument global identifier (FIGI)
1385    figi: Option<String>,
1386    /// Filter by international securities identification number (ISIN)
1387    isin: Option<String>,
1388    /// 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
1389    cusip: Option<String>,
1390    /// The CIK of an instrument for which data is requested
1391    cik: Option<String>,
1392    /// Filter by country name or alpha code, e.g., `United States` or `US`
1393    country: Option<String>,
1394    /// Filter by investment company that manages the fund
1395    fund_family: Option<String>,
1396    /// Filter by the type of fund
1397    fund_type: Option<String>,
1398    /// Filter by performance rating from `0` to `5`
1399    performance_rating: Option<i64>,
1400    /// Filter by risk rating from `0` to `5`
1401    risk_rating: Option<i64>,
1402    /// Page number
1403    page: Option<i64>,
1404    /// Number of records in response
1405    outputsize: Option<i64>
1406}
1407
1408impl GetMutualFundsListParamsBuilder {
1409    /// Filter by symbol
1410    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1411        self.symbol = Some(symbol.into());
1412        self
1413    }
1414    /// Filter by financial instrument global identifier (FIGI)
1415    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1416        self.figi = Some(figi.into());
1417        self
1418    }
1419    /// Filter by international securities identification number (ISIN)
1420    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1421        self.isin = Some(isin.into());
1422        self
1423    }
1424    /// 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
1425    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1426        self.cusip = Some(cusip.into());
1427        self
1428    }
1429    /// The CIK of an instrument for which data is requested
1430    pub fn cik(mut self, cik: impl Into<String>) -> Self {
1431        self.cik = Some(cik.into());
1432        self
1433    }
1434    /// Filter by country name or alpha code, 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    /// Filter by investment company that manages the fund
1440    pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1441        self.fund_family = Some(fund_family.into());
1442        self
1443    }
1444    /// Filter by the type of fund
1445    pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1446        self.fund_type = Some(fund_type.into());
1447        self
1448    }
1449    /// Filter by performance rating from `0` to `5`
1450    pub fn performance_rating(mut self, performance_rating: i64) -> Self {
1451        self.performance_rating = Some(performance_rating);
1452        self
1453    }
1454    /// Filter by risk rating from `0` to `5`
1455    pub fn risk_rating(mut self, risk_rating: i64) -> Self {
1456        self.risk_rating = Some(risk_rating);
1457        self
1458    }
1459    /// Page number
1460    pub fn page(mut self, page: i64) -> Self {
1461        self.page = Some(page);
1462        self
1463    }
1464    /// Number of records in response
1465    pub fn outputsize(mut self, outputsize: i64) -> Self {
1466        self.outputsize = Some(outputsize);
1467        self
1468    }
1469
1470    /// Build the parameter struct
1471    pub fn build(self) -> GetMutualFundsListParams {
1472        GetMutualFundsListParams {
1473            symbol: self.symbol,
1474            figi: self.figi,
1475            isin: self.isin,
1476            cusip: self.cusip,
1477            cik: self.cik,
1478            country: self.country,
1479            fund_family: self.fund_family,
1480            fund_type: self.fund_type,
1481            performance_rating: self.performance_rating,
1482            risk_rating: self.risk_rating,
1483            page: self.page,
1484            outputsize: self.outputsize
1485        }
1486    }
1487}
1488
1489/// struct for passing parameters to the method [`get_mutual_funds_type`]
1490#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1491pub struct GetMutualFundsTypeParams {
1492    /// Filter by the type of fund
1493    pub fund_type: Option<String>,
1494    /// Filter by country name or alpha code, e.g., `United States` or `US`
1495    pub country: Option<String>
1496}
1497
1498impl GetMutualFundsTypeParams {
1499    /// Create a new builder for this parameter struct
1500    pub fn builder() -> GetMutualFundsTypeParamsBuilder {
1501        GetMutualFundsTypeParamsBuilder::default()
1502    }
1503}
1504
1505/// Builder for [`GetMutualFundsTypeParams`]
1506#[derive(Clone, Debug, Default)]
1507pub struct GetMutualFundsTypeParamsBuilder {
1508    /// Filter by the type of fund
1509    fund_type: Option<String>,
1510    /// Filter by country name or alpha code, e.g., `United States` or `US`
1511    country: Option<String>
1512}
1513
1514impl GetMutualFundsTypeParamsBuilder {
1515    /// Filter by the type of fund
1516    pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1517        self.fund_type = Some(fund_type.into());
1518        self
1519    }
1520    /// Filter by country name or alpha code, e.g., `United States` or `US`
1521    pub fn country(mut self, country: impl Into<String>) -> Self {
1522        self.country = Some(country.into());
1523        self
1524    }
1525
1526    /// Build the parameter struct
1527    pub fn build(self) -> GetMutualFundsTypeParams {
1528        GetMutualFundsTypeParams {
1529            fund_type: self.fund_type,
1530            country: self.country
1531        }
1532    }
1533}
1534
1535/// struct for passing parameters to the method [`get_stocks`]
1536#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1537pub struct GetStocksParams {
1538    /// The ticker symbol of an instrument for which data is requested
1539    pub symbol: Option<String>,
1540    /// Filter by financial instrument global identifier (FIGI)
1541    pub figi: Option<String>,
1542    /// Filter by international securities identification number (ISIN)
1543    pub isin: Option<String>,
1544    /// 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
1545    pub cusip: Option<String>,
1546    /// The CIK of an instrument for which data is requested
1547    pub cik: Option<String>,
1548    /// Filter by exchange name
1549    pub exchange: Option<String>,
1550    /// Filter by market identifier code (MIC) under ISO 10383 standard
1551    pub mic_code: Option<String>,
1552    /// Filter by country name or alpha code, e.g., `United States` or `US`
1553    pub country: Option<String>,
1554    /// The asset class to which the instrument belongs
1555    pub r#type: Option<String>,
1556    /// The format of the response data
1557    pub format: Option<String>,
1558    /// The separator used in the CSV response data
1559    pub delimiter: Option<String>,
1560    /// Adds info on which plan symbol is available
1561    pub show_plan: Option<bool>,
1562    /// Include delisted identifiers
1563    pub include_delisted: Option<bool>
1564}
1565
1566impl GetStocksParams {
1567    /// Create a new builder for this parameter struct
1568    pub fn builder() -> GetStocksParamsBuilder {
1569        GetStocksParamsBuilder::default()
1570    }
1571}
1572
1573/// Builder for [`GetStocksParams`]
1574#[derive(Clone, Debug, Default)]
1575pub struct GetStocksParamsBuilder {
1576    /// The ticker symbol of an instrument for which data is requested
1577    symbol: Option<String>,
1578    /// Filter by financial instrument global identifier (FIGI)
1579    figi: Option<String>,
1580    /// Filter by international securities identification number (ISIN)
1581    isin: Option<String>,
1582    /// 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
1583    cusip: Option<String>,
1584    /// The CIK of an instrument for which data is requested
1585    cik: Option<String>,
1586    /// Filter by exchange name
1587    exchange: Option<String>,
1588    /// Filter by market identifier code (MIC) under ISO 10383 standard
1589    mic_code: Option<String>,
1590    /// Filter by country name or alpha code, e.g., `United States` or `US`
1591    country: Option<String>,
1592    /// The asset class to which the instrument belongs
1593    r#type: Option<String>,
1594    /// The format of the response data
1595    format: Option<String>,
1596    /// The separator used in the CSV response data
1597    delimiter: Option<String>,
1598    /// Adds info on which plan symbol is available
1599    show_plan: Option<bool>,
1600    /// Include delisted identifiers
1601    include_delisted: Option<bool>
1602}
1603
1604impl GetStocksParamsBuilder {
1605    /// The ticker symbol of an instrument for which data is requested
1606    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1607        self.symbol = Some(symbol.into());
1608        self
1609    }
1610    /// Filter by financial instrument global identifier (FIGI)
1611    pub fn figi(mut self, figi: impl Into<String>) -> Self {
1612        self.figi = Some(figi.into());
1613        self
1614    }
1615    /// Filter by international securities identification number (ISIN)
1616    pub fn isin(mut self, isin: impl Into<String>) -> Self {
1617        self.isin = Some(isin.into());
1618        self
1619    }
1620    /// 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
1621    pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1622        self.cusip = Some(cusip.into());
1623        self
1624    }
1625    /// The CIK of an instrument for which data is requested
1626    pub fn cik(mut self, cik: impl Into<String>) -> Self {
1627        self.cik = Some(cik.into());
1628        self
1629    }
1630    /// Filter by exchange name
1631    pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1632        self.exchange = Some(exchange.into());
1633        self
1634    }
1635    /// Filter by market identifier code (MIC) under ISO 10383 standard
1636    pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1637        self.mic_code = Some(mic_code.into());
1638        self
1639    }
1640    /// Filter by country name or alpha code, e.g., `United States` or `US`
1641    pub fn country(mut self, country: impl Into<String>) -> Self {
1642        self.country = Some(country.into());
1643        self
1644    }
1645    /// The asset class to which the instrument belongs
1646    pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
1647        self.r#type = Some(r#type.into());
1648        self
1649    }
1650    /// The format of the response data
1651    pub fn format(mut self, format: impl Into<String>) -> Self {
1652        self.format = Some(format.into());
1653        self
1654    }
1655    /// The separator used in the CSV response data
1656    pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1657        self.delimiter = Some(delimiter.into());
1658        self
1659    }
1660    /// Adds info on which plan symbol is available
1661    pub fn show_plan(mut self, show_plan: bool) -> Self {
1662        self.show_plan = Some(show_plan);
1663        self
1664    }
1665    /// Include delisted identifiers
1666    pub fn include_delisted(mut self, include_delisted: bool) -> Self {
1667        self.include_delisted = Some(include_delisted);
1668        self
1669    }
1670
1671    /// Build the parameter struct
1672    pub fn build(self) -> GetStocksParams {
1673        GetStocksParams {
1674            symbol: self.symbol,
1675            figi: self.figi,
1676            isin: self.isin,
1677            cusip: self.cusip,
1678            cik: self.cik,
1679            exchange: self.exchange,
1680            mic_code: self.mic_code,
1681            country: self.country,
1682            r#type: self.r#type,
1683            format: self.format,
1684            delimiter: self.delimiter,
1685            show_plan: self.show_plan,
1686            include_delisted: self.include_delisted
1687        }
1688    }
1689}
1690
1691/// struct for passing parameters to the method [`get_symbol_search`]
1692#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1693pub struct GetSymbolSearchParams {
1694    /// Symbol to search. Supports: <ul> <li>Ticker symbol of instrument.</li> <li>International securities identification number (ISIN). <li>Financial instrument global identifier (FIGI). <li>Composite FIGI.</li> <li>Share Class FIGI.</li> </ul>
1695    pub symbol: String,
1696    /// Number of matches in response. Max <code>120</code>
1697    pub outputsize: Option<i64>,
1698    /// Adds info on which plan symbol is available.
1699    pub show_plan: Option<bool>
1700}
1701
1702impl GetSymbolSearchParams {
1703    /// Create a new builder for this parameter struct
1704    pub fn builder() -> GetSymbolSearchParamsBuilder {
1705        GetSymbolSearchParamsBuilder::default()
1706    }
1707}
1708
1709/// Builder for [`GetSymbolSearchParams`]
1710#[derive(Clone, Debug, Default)]
1711pub struct GetSymbolSearchParamsBuilder {
1712    /// Symbol to search. Supports: <ul> <li>Ticker symbol of instrument.</li> <li>International securities identification number (ISIN). <li>Financial instrument global identifier (FIGI). <li>Composite FIGI.</li> <li>Share Class FIGI.</li> </ul>
1713    symbol: String,
1714    /// Number of matches in response. Max <code>120</code>
1715    outputsize: Option<i64>,
1716    /// Adds info on which plan symbol is available.
1717    show_plan: Option<bool>
1718}
1719
1720impl GetSymbolSearchParamsBuilder {
1721    /// Symbol to search. Supports: <ul> <li>Ticker symbol of instrument.</li> <li>International securities identification number (ISIN). <li>Financial instrument global identifier (FIGI). <li>Composite FIGI.</li> <li>Share Class FIGI.</li> </ul>
1722    pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1723        self.symbol = symbol.into();
1724        self
1725    }
1726    /// Number of matches in response. Max <code>120</code>
1727    pub fn outputsize(mut self, outputsize: i64) -> Self {
1728        self.outputsize = Some(outputsize);
1729        self
1730    }
1731    /// Adds info on which plan symbol is available.
1732    pub fn show_plan(mut self, show_plan: bool) -> Self {
1733        self.show_plan = Some(show_plan);
1734        self
1735    }
1736
1737    /// Build the parameter struct
1738    pub fn build(self) -> GetSymbolSearchParams {
1739        GetSymbolSearchParams {
1740            symbol: self.symbol,
1741            outputsize: self.outputsize,
1742            show_plan: self.show_plan
1743        }
1744    }
1745}
1746
1747
1748/// struct for typed errors of method [`get_bonds`]
1749#[derive(Debug, Clone, Serialize, Deserialize)]
1750#[serde(untagged)]
1751pub enum GetBondsError {
1752    UnknownValue(serde_json::Value),
1753}
1754
1755/// struct for typed errors of method [`get_commodities`]
1756#[derive(Debug, Clone, Serialize, Deserialize)]
1757#[serde(untagged)]
1758pub enum GetCommoditiesError {
1759    UnknownValue(serde_json::Value),
1760}
1761
1762/// struct for typed errors of method [`get_countries`]
1763#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum GetCountriesError {
1766    UnknownValue(serde_json::Value),
1767}
1768
1769/// struct for typed errors of method [`get_cross_listings`]
1770#[derive(Debug, Clone, Serialize, Deserialize)]
1771#[serde(untagged)]
1772pub enum GetCrossListingsError {
1773    UnknownValue(serde_json::Value),
1774}
1775
1776/// struct for typed errors of method [`get_cryptocurrencies`]
1777#[derive(Debug, Clone, Serialize, Deserialize)]
1778#[serde(untagged)]
1779pub enum GetCryptocurrenciesError {
1780    UnknownValue(serde_json::Value),
1781}
1782
1783/// struct for typed errors of method [`get_cryptocurrency_exchanges`]
1784#[derive(Debug, Clone, Serialize, Deserialize)]
1785#[serde(untagged)]
1786pub enum GetCryptocurrencyExchangesError {
1787    UnknownValue(serde_json::Value),
1788}
1789
1790/// struct for typed errors of method [`get_earliest_timestamp`]
1791#[derive(Debug, Clone, Serialize, Deserialize)]
1792#[serde(untagged)]
1793pub enum GetEarliestTimestampError {
1794    UnknownValue(serde_json::Value),
1795}
1796
1797/// struct for typed errors of method [`get_etf`]
1798#[derive(Debug, Clone, Serialize, Deserialize)]
1799#[serde(untagged)]
1800pub enum GetEtfError {
1801    UnknownValue(serde_json::Value),
1802}
1803
1804/// struct for typed errors of method [`get_etfs_family`]
1805#[derive(Debug, Clone, Serialize, Deserialize)]
1806#[serde(untagged)]
1807pub enum GetEtfsFamilyError {
1808    UnknownValue(serde_json::Value),
1809}
1810
1811/// struct for typed errors of method [`get_etfs_list`]
1812#[derive(Debug, Clone, Serialize, Deserialize)]
1813#[serde(untagged)]
1814pub enum GetEtfsListError {
1815    UnknownValue(serde_json::Value),
1816}
1817
1818/// struct for typed errors of method [`get_etfs_type`]
1819#[derive(Debug, Clone, Serialize, Deserialize)]
1820#[serde(untagged)]
1821pub enum GetEtfsTypeError {
1822    UnknownValue(serde_json::Value),
1823}
1824
1825/// struct for typed errors of method [`get_exchange_schedule`]
1826#[derive(Debug, Clone, Serialize, Deserialize)]
1827#[serde(untagged)]
1828pub enum GetExchangeScheduleError {
1829    UnknownValue(serde_json::Value),
1830}
1831
1832/// struct for typed errors of method [`get_exchanges`]
1833#[derive(Debug, Clone, Serialize, Deserialize)]
1834#[serde(untagged)]
1835pub enum GetExchangesError {
1836    UnknownValue(serde_json::Value),
1837}
1838
1839/// struct for typed errors of method [`get_forex_pairs`]
1840#[derive(Debug, Clone, Serialize, Deserialize)]
1841#[serde(untagged)]
1842pub enum GetForexPairsError {
1843    UnknownValue(serde_json::Value),
1844}
1845
1846/// struct for typed errors of method [`get_funds`]
1847#[derive(Debug, Clone, Serialize, Deserialize)]
1848#[serde(untagged)]
1849pub enum GetFundsError {
1850    UnknownValue(serde_json::Value),
1851}
1852
1853/// struct for typed errors of method [`get_instrument_type`]
1854#[derive(Debug, Clone, Serialize, Deserialize)]
1855#[serde(untagged)]
1856pub enum GetInstrumentTypeError {
1857    UnknownValue(serde_json::Value),
1858}
1859
1860/// struct for typed errors of method [`get_intervals`]
1861#[derive(Debug, Clone, Serialize, Deserialize)]
1862#[serde(untagged)]
1863pub enum GetIntervalsError {
1864    UnknownValue(serde_json::Value),
1865}
1866
1867/// struct for typed errors of method [`get_market_state`]
1868#[derive(Debug, Clone, Serialize, Deserialize)]
1869#[serde(untagged)]
1870pub enum GetMarketStateError {
1871    UnknownValue(serde_json::Value),
1872}
1873
1874/// struct for typed errors of method [`get_mutual_funds_family`]
1875#[derive(Debug, Clone, Serialize, Deserialize)]
1876#[serde(untagged)]
1877pub enum GetMutualFundsFamilyError {
1878    UnknownValue(serde_json::Value),
1879}
1880
1881/// struct for typed errors of method [`get_mutual_funds_list`]
1882#[derive(Debug, Clone, Serialize, Deserialize)]
1883#[serde(untagged)]
1884pub enum GetMutualFundsListError {
1885    UnknownValue(serde_json::Value),
1886}
1887
1888/// struct for typed errors of method [`get_mutual_funds_type`]
1889#[derive(Debug, Clone, Serialize, Deserialize)]
1890#[serde(untagged)]
1891pub enum GetMutualFundsTypeError {
1892    UnknownValue(serde_json::Value),
1893}
1894
1895/// struct for typed errors of method [`get_stocks`]
1896#[derive(Debug, Clone, Serialize, Deserialize)]
1897#[serde(untagged)]
1898pub enum GetStocksError {
1899    UnknownValue(serde_json::Value),
1900}
1901
1902/// struct for typed errors of method [`get_symbol_search`]
1903#[derive(Debug, Clone, Serialize, Deserialize)]
1904#[serde(untagged)]
1905pub enum GetSymbolSearchError {
1906    UnknownValue(serde_json::Value),
1907}
1908
1909/// struct for typed errors of method [`get_technical_indicators`]
1910#[derive(Debug, Clone, Serialize, Deserialize)]
1911#[serde(untagged)]
1912pub enum GetTechnicalIndicatorsError {
1913    UnknownValue(serde_json::Value),
1914}
1915
1916
1917/// The fixed income endpoint provides a daily updated list of available bonds. It returns an array containing detailed information about each bond, including identifiers, names, and other relevant attributes.
1918pub async fn get_bonds(configuration: &configuration::Configuration, params: GetBondsParams) -> Result<models::GetBonds200Response, Error<GetBondsError>> {
1919    // Extract parameters from params struct
1920    let p_query_symbol = params.symbol;
1921    let p_query_exchange = params.exchange;
1922    let p_query_country = params.country;
1923    let p_query_format = params.format;
1924    let p_query_delimiter = params.delimiter;
1925    let p_query_show_plan = params.show_plan;
1926    let p_query_page = params.page;
1927    let p_query_outputsize = params.outputsize;
1928
1929    let uri_str = format!("{}/bonds", configuration.base_path);
1930    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1931
1932    if let Some(ref param_value) = p_query_symbol {
1933        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
1934    }
1935    if let Some(ref param_value) = p_query_exchange {
1936        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
1937    }
1938    if let Some(ref param_value) = p_query_country {
1939        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1940    }
1941    if let Some(ref param_value) = p_query_format {
1942        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1943    }
1944    if let Some(ref param_value) = p_query_delimiter {
1945        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
1946    }
1947    if let Some(ref param_value) = p_query_show_plan {
1948        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
1949    }
1950    if let Some(ref param_value) = p_query_page {
1951        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1952    }
1953    if let Some(ref param_value) = p_query_outputsize {
1954        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
1955    }
1956    if let Some(ref user_agent) = configuration.user_agent {
1957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1958    }
1959    if let Some(ref apikey) = configuration.api_key {
1960        let key = apikey.key.clone();
1961        let value = match apikey.prefix {
1962            Some(ref prefix) => format!("{} {}", prefix, key),
1963            None => key,
1964        };
1965        req_builder = req_builder.header("Authorization", value);
1966    };
1967
1968    let req = req_builder.build()?;
1969    let resp = configuration.client.execute(req).await?;
1970
1971    let status = resp.status();
1972    let content_type = resp
1973        .headers()
1974        .get("content-type")
1975        .and_then(|v| v.to_str().ok())
1976        .unwrap_or("application/octet-stream");
1977    let content_type = super::ContentType::from(content_type);
1978
1979    if !status.is_client_error() && !status.is_server_error() {
1980        let content = resp.text().await?;
1981        match content_type {
1982            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1983            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBonds200Response`"))),
1984            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::GetBonds200Response`")))),
1985        }
1986    } else {
1987        let content = resp.text().await?;
1988        let entity: Option<GetBondsError> = serde_json::from_str(&content).ok();
1989        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1990    }
1991}
1992
1993/// The commodities endpoint provides a daily updated list of available commodity pairs, across precious metals, livestock, softs, grains, etc.
1994pub async fn get_commodities(configuration: &configuration::Configuration, params: GetCommoditiesParams) -> Result<models::GetCommodities200Response, Error<GetCommoditiesError>> {
1995    // Extract parameters from params struct
1996    let p_query_symbol = params.symbol;
1997    let p_query_category = params.category;
1998    let p_query_format = params.format;
1999    let p_query_delimiter = params.delimiter;
2000
2001    let uri_str = format!("{}/commodities", configuration.base_path);
2002    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2003
2004    if let Some(ref param_value) = p_query_symbol {
2005        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2006    }
2007    if let Some(ref param_value) = p_query_category {
2008        req_builder = req_builder.query(&[("category", &param_value.to_string())]);
2009    }
2010    if let Some(ref param_value) = p_query_format {
2011        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2012    }
2013    if let Some(ref param_value) = p_query_delimiter {
2014        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2015    }
2016    if let Some(ref user_agent) = configuration.user_agent {
2017        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2018    }
2019    if let Some(ref apikey) = configuration.api_key {
2020        let key = apikey.key.clone();
2021        let value = match apikey.prefix {
2022            Some(ref prefix) => format!("{} {}", prefix, key),
2023            None => key,
2024        };
2025        req_builder = req_builder.header("Authorization", value);
2026    };
2027
2028    let req = req_builder.build()?;
2029    let resp = configuration.client.execute(req).await?;
2030
2031    let status = resp.status();
2032    let content_type = resp
2033        .headers()
2034        .get("content-type")
2035        .and_then(|v| v.to_str().ok())
2036        .unwrap_or("application/octet-stream");
2037    let content_type = super::ContentType::from(content_type);
2038
2039    if !status.is_client_error() && !status.is_server_error() {
2040        let content = resp.text().await?;
2041        match content_type {
2042            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2043            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCommodities200Response`"))),
2044            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::GetCommodities200Response`")))),
2045        }
2046    } else {
2047        let content = resp.text().await?;
2048        let entity: Option<GetCommoditiesError> = serde_json::from_str(&content).ok();
2049        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2050    }
2051}
2052
2053/// The countries endpoint provides a comprehensive list of countries, including their ISO codes, official names, capitals, and currencies. This data is essential for applications requiring accurate country information for tasks such as localization, currency conversion, or geographic analysis.
2054pub async fn get_countries(configuration: &configuration::Configuration) -> Result<models::GetCountries200Response, Error<GetCountriesError>> {
2055
2056    let uri_str = format!("{}/countries", configuration.base_path);
2057    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2058
2059    if let Some(ref user_agent) = configuration.user_agent {
2060        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2061    }
2062    if let Some(ref apikey) = configuration.api_key {
2063        let key = apikey.key.clone();
2064        let value = match apikey.prefix {
2065            Some(ref prefix) => format!("{} {}", prefix, key),
2066            None => key,
2067        };
2068        req_builder = req_builder.header("Authorization", value);
2069    };
2070
2071    let req = req_builder.build()?;
2072    let resp = configuration.client.execute(req).await?;
2073
2074    let status = resp.status();
2075    let content_type = resp
2076        .headers()
2077        .get("content-type")
2078        .and_then(|v| v.to_str().ok())
2079        .unwrap_or("application/octet-stream");
2080    let content_type = super::ContentType::from(content_type);
2081
2082    if !status.is_client_error() && !status.is_server_error() {
2083        let content = resp.text().await?;
2084        match content_type {
2085            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2086            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCountries200Response`"))),
2087            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::GetCountries200Response`")))),
2088        }
2089    } else {
2090        let content = resp.text().await?;
2091        let entity: Option<GetCountriesError> = serde_json::from_str(&content).ok();
2092        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2093    }
2094}
2095
2096/// The cross_listings endpoint provides a daily updated list of cross-listed symbols for a specified financial instrument. Cross-listed symbols represent the same security available on multiple exchanges. This endpoint is useful for identifying all the exchanges where a particular security is traded, allowing users to access comprehensive trading information across different markets.
2097pub async fn get_cross_listings(configuration: &configuration::Configuration, params: GetCrossListingsParams) -> Result<models::GetCrossListings200Response, Error<GetCrossListingsError>> {
2098    // Extract parameters from params struct
2099    let p_query_symbol = params.symbol;
2100    let p_query_exchange = params.exchange;
2101    let p_query_mic_code = params.mic_code;
2102    let p_query_country = params.country;
2103
2104    let uri_str = format!("{}/cross_listings", configuration.base_path);
2105    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2106
2107    req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
2108    if let Some(ref param_value) = p_query_exchange {
2109        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2110    }
2111    if let Some(ref param_value) = p_query_mic_code {
2112        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2113    }
2114    if let Some(ref param_value) = p_query_country {
2115        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2116    }
2117    if let Some(ref user_agent) = configuration.user_agent {
2118        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2119    }
2120    if let Some(ref apikey) = configuration.api_key {
2121        let key = apikey.key.clone();
2122        let value = match apikey.prefix {
2123            Some(ref prefix) => format!("{} {}", prefix, key),
2124            None => key,
2125        };
2126        req_builder = req_builder.header("Authorization", value);
2127    };
2128
2129    let req = req_builder.build()?;
2130    let resp = configuration.client.execute(req).await?;
2131
2132    let status = resp.status();
2133    let content_type = resp
2134        .headers()
2135        .get("content-type")
2136        .and_then(|v| v.to_str().ok())
2137        .unwrap_or("application/octet-stream");
2138    let content_type = super::ContentType::from(content_type);
2139
2140    if !status.is_client_error() && !status.is_server_error() {
2141        let content = resp.text().await?;
2142        match content_type {
2143            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2144            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCrossListings200Response`"))),
2145            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::GetCrossListings200Response`")))),
2146        }
2147    } else {
2148        let content = resp.text().await?;
2149        let entity: Option<GetCrossListingsError> = serde_json::from_str(&content).ok();
2150        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2151    }
2152}
2153
2154/// The cryptocurrencies endpoint provides a daily updated list of all available cryptos. It returns an array containing detailed information about each cryptocurrency, including its symbol, name, and other relevant identifiers. This endpoint is useful for retrieving a comprehensive catalog of cryptocurrencies for applications that require up-to-date market listings or need to display available crypto assets to users.
2155pub async fn get_cryptocurrencies(configuration: &configuration::Configuration, params: GetCryptocurrenciesParams) -> Result<models::GetCryptocurrencies200Response, Error<GetCryptocurrenciesError>> {
2156    // Extract parameters from params struct
2157    let p_query_symbol = params.symbol;
2158    let p_query_exchange = params.exchange;
2159    let p_query_currency_base = params.currency_base;
2160    let p_query_currency_quote = params.currency_quote;
2161    let p_query_format = params.format;
2162    let p_query_delimiter = params.delimiter;
2163
2164    let uri_str = format!("{}/cryptocurrencies", configuration.base_path);
2165    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2166
2167    if let Some(ref param_value) = p_query_symbol {
2168        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2169    }
2170    if let Some(ref param_value) = p_query_exchange {
2171        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2172    }
2173    if let Some(ref param_value) = p_query_currency_base {
2174        req_builder = req_builder.query(&[("currency_base", &param_value.to_string())]);
2175    }
2176    if let Some(ref param_value) = p_query_currency_quote {
2177        req_builder = req_builder.query(&[("currency_quote", &param_value.to_string())]);
2178    }
2179    if let Some(ref param_value) = p_query_format {
2180        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2181    }
2182    if let Some(ref param_value) = p_query_delimiter {
2183        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2184    }
2185    if let Some(ref user_agent) = configuration.user_agent {
2186        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2187    }
2188    if let Some(ref apikey) = configuration.api_key {
2189        let key = apikey.key.clone();
2190        let value = match apikey.prefix {
2191            Some(ref prefix) => format!("{} {}", prefix, key),
2192            None => key,
2193        };
2194        req_builder = req_builder.header("Authorization", value);
2195    };
2196
2197    let req = req_builder.build()?;
2198    let resp = configuration.client.execute(req).await?;
2199
2200    let status = resp.status();
2201    let content_type = resp
2202        .headers()
2203        .get("content-type")
2204        .and_then(|v| v.to_str().ok())
2205        .unwrap_or("application/octet-stream");
2206    let content_type = super::ContentType::from(content_type);
2207
2208    if !status.is_client_error() && !status.is_server_error() {
2209        let content = resp.text().await?;
2210        match content_type {
2211            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2212            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCryptocurrencies200Response`"))),
2213            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::GetCryptocurrencies200Response`")))),
2214        }
2215    } else {
2216        let content = resp.text().await?;
2217        let entity: Option<GetCryptocurrenciesError> = serde_json::from_str(&content).ok();
2218        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2219    }
2220}
2221
2222/// The cryptocurrency exchanges endpoint provides a daily updated list of available cryptocurrency exchanges. It returns an array containing details about each exchange, such as exchange names and identifiers.
2223pub async fn get_cryptocurrency_exchanges(configuration: &configuration::Configuration, params: GetCryptocurrencyExchangesParams) -> Result<models::GetCryptocurrencyExchanges200Response, Error<GetCryptocurrencyExchangesError>> {
2224    // Extract parameters from params struct
2225    let p_query_format = params.format;
2226    let p_query_delimiter = params.delimiter;
2227
2228    let uri_str = format!("{}/cryptocurrency_exchanges", configuration.base_path);
2229    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2230
2231    if let Some(ref param_value) = p_query_format {
2232        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2233    }
2234    if let Some(ref param_value) = p_query_delimiter {
2235        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2236    }
2237    if let Some(ref user_agent) = configuration.user_agent {
2238        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2239    }
2240    if let Some(ref apikey) = configuration.api_key {
2241        let key = apikey.key.clone();
2242        let value = match apikey.prefix {
2243            Some(ref prefix) => format!("{} {}", prefix, key),
2244            None => key,
2245        };
2246        req_builder = req_builder.header("Authorization", value);
2247    };
2248
2249    let req = req_builder.build()?;
2250    let resp = configuration.client.execute(req).await?;
2251
2252    let status = resp.status();
2253    let content_type = resp
2254        .headers()
2255        .get("content-type")
2256        .and_then(|v| v.to_str().ok())
2257        .unwrap_or("application/octet-stream");
2258    let content_type = super::ContentType::from(content_type);
2259
2260    if !status.is_client_error() && !status.is_server_error() {
2261        let content = resp.text().await?;
2262        match content_type {
2263            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2264            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCryptocurrencyExchanges200Response`"))),
2265            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::GetCryptocurrencyExchanges200Response`")))),
2266        }
2267    } else {
2268        let content = resp.text().await?;
2269        let entity: Option<GetCryptocurrencyExchangesError> = serde_json::from_str(&content).ok();
2270        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2271    }
2272}
2273
2274/// The earliest_timestamp endpoint provides the earliest available date and time for a specified financial instrument at a given data interval. This endpoint is useful for determining the starting point of historical data availability for various assets, such as stocks or currencies, allowing users to understand the time range covered by the data.
2275pub async fn get_earliest_timestamp(configuration: &configuration::Configuration, params: GetEarliestTimestampParams) -> Result<models::GetEarliestTimestamp200Response, Error<GetEarliestTimestampError>> {
2276    // Extract parameters from params struct
2277    let p_query_interval = params.interval;
2278    let p_query_symbol = params.symbol;
2279    let p_query_figi = params.figi;
2280    let p_query_isin = params.isin;
2281    let p_query_cusip = params.cusip;
2282    let p_query_exchange = params.exchange;
2283    let p_query_mic_code = params.mic_code;
2284    let p_query_timezone = params.timezone;
2285
2286    let uri_str = format!("{}/earliest_timestamp", configuration.base_path);
2287    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2288
2289    if let Some(ref param_value) = p_query_symbol {
2290        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2291    }
2292    if let Some(ref param_value) = p_query_figi {
2293        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2294    }
2295    if let Some(ref param_value) = p_query_isin {
2296        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2297    }
2298    if let Some(ref param_value) = p_query_cusip {
2299        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2300    }
2301    req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
2302    if let Some(ref param_value) = p_query_exchange {
2303        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2304    }
2305    if let Some(ref param_value) = p_query_mic_code {
2306        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2307    }
2308    if let Some(ref param_value) = p_query_timezone {
2309        req_builder = req_builder.query(&[("timezone", &param_value.to_string())]);
2310    }
2311    if let Some(ref user_agent) = configuration.user_agent {
2312        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2313    }
2314    if let Some(ref apikey) = configuration.api_key {
2315        let key = apikey.key.clone();
2316        let value = match apikey.prefix {
2317            Some(ref prefix) => format!("{} {}", prefix, key),
2318            None => key,
2319        };
2320        req_builder = req_builder.header("Authorization", value);
2321    };
2322
2323    let req = req_builder.build()?;
2324    let resp = configuration.client.execute(req).await?;
2325
2326    let status = resp.status();
2327    let content_type = resp
2328        .headers()
2329        .get("content-type")
2330        .and_then(|v| v.to_str().ok())
2331        .unwrap_or("application/octet-stream");
2332    let content_type = super::ContentType::from(content_type);
2333
2334    if !status.is_client_error() && !status.is_server_error() {
2335        let content = resp.text().await?;
2336        match content_type {
2337            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2338            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEarliestTimestamp200Response`"))),
2339            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::GetEarliestTimestamp200Response`")))),
2340        }
2341    } else {
2342        let content = resp.text().await?;
2343        let entity: Option<GetEarliestTimestampError> = serde_json::from_str(&content).ok();
2344        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2345    }
2346}
2347
2348/// The ETFs endpoint provides a daily updated list of all available Exchange-Traded Funds. It returns an array containing detailed information about each ETF, including its symbol, name, and other relevant identifiers. This endpoint is useful for retrieving a comprehensive catalog of ETFs for portfolio management, investment tracking, or financial analysis.
2349pub async fn get_etf(configuration: &configuration::Configuration, params: GetEtfParams) -> Result<models::GetEtf200Response, Error<GetEtfError>> {
2350    // Extract parameters from params struct
2351    let p_query_symbol = params.symbol;
2352    let p_query_figi = params.figi;
2353    let p_query_isin = params.isin;
2354    let p_query_cusip = params.cusip;
2355    let p_query_cik = params.cik;
2356    let p_query_exchange = params.exchange;
2357    let p_query_mic_code = params.mic_code;
2358    let p_query_country = params.country;
2359    let p_query_format = params.format;
2360    let p_query_delimiter = params.delimiter;
2361    let p_query_show_plan = params.show_plan;
2362    let p_query_include_delisted = params.include_delisted;
2363
2364    let uri_str = format!("{}/etfs", configuration.base_path);
2365    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2366
2367    if let Some(ref param_value) = p_query_symbol {
2368        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2369    }
2370    if let Some(ref param_value) = p_query_figi {
2371        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2372    }
2373    if let Some(ref param_value) = p_query_isin {
2374        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2375    }
2376    if let Some(ref param_value) = p_query_cusip {
2377        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2378    }
2379    if let Some(ref param_value) = p_query_cik {
2380        req_builder = req_builder.query(&[("cik", &param_value.to_string())]);
2381    }
2382    if let Some(ref param_value) = p_query_exchange {
2383        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2384    }
2385    if let Some(ref param_value) = p_query_mic_code {
2386        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2387    }
2388    if let Some(ref param_value) = p_query_country {
2389        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2390    }
2391    if let Some(ref param_value) = p_query_format {
2392        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2393    }
2394    if let Some(ref param_value) = p_query_delimiter {
2395        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2396    }
2397    if let Some(ref param_value) = p_query_show_plan {
2398        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
2399    }
2400    if let Some(ref param_value) = p_query_include_delisted {
2401        req_builder = req_builder.query(&[("include_delisted", &param_value.to_string())]);
2402    }
2403    if let Some(ref user_agent) = configuration.user_agent {
2404        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2405    }
2406    if let Some(ref apikey) = configuration.api_key {
2407        let key = apikey.key.clone();
2408        let value = match apikey.prefix {
2409            Some(ref prefix) => format!("{} {}", prefix, key),
2410            None => key,
2411        };
2412        req_builder = req_builder.header("Authorization", value);
2413    };
2414
2415    let req = req_builder.build()?;
2416    let resp = configuration.client.execute(req).await?;
2417
2418    let status = resp.status();
2419    let content_type = resp
2420        .headers()
2421        .get("content-type")
2422        .and_then(|v| v.to_str().ok())
2423        .unwrap_or("application/octet-stream");
2424    let content_type = super::ContentType::from(content_type);
2425
2426    if !status.is_client_error() && !status.is_server_error() {
2427        let content = resp.text().await?;
2428        match content_type {
2429            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2430            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtf200Response`"))),
2431            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::GetEtf200Response`")))),
2432        }
2433    } else {
2434        let content = resp.text().await?;
2435        let entity: Option<GetEtfError> = serde_json::from_str(&content).ok();
2436        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2437    }
2438}
2439
2440/// Retrieve a comprehensive list of exchange-traded fund (ETF) families, providing users with detailed information on various ETF groups available in the market. This endpoint is ideal for users looking to explore different ETF categories, compare offerings, or integrate ETF family data into their financial applications.
2441pub async fn get_etfs_family(configuration: &configuration::Configuration, params: GetEtfsFamilyParams) -> Result<models::GetEtfsFamily200Response, Error<GetEtfsFamilyError>> {
2442    // Extract parameters from params struct
2443    let p_query_country = params.country;
2444    let p_query_fund_family = params.fund_family;
2445
2446    let uri_str = format!("{}/etfs/family", configuration.base_path);
2447    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2448
2449    if let Some(ref param_value) = p_query_country {
2450        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2451    }
2452    if let Some(ref param_value) = p_query_fund_family {
2453        req_builder = req_builder.query(&[("fund_family", &param_value.to_string())]);
2454    }
2455    if let Some(ref user_agent) = configuration.user_agent {
2456        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2457    }
2458    if let Some(ref apikey) = configuration.api_key {
2459        let key = apikey.key.clone();
2460        let value = match apikey.prefix {
2461            Some(ref prefix) => format!("{} {}", prefix, key),
2462            None => key,
2463        };
2464        req_builder = req_builder.header("Authorization", value);
2465    };
2466
2467    let req = req_builder.build()?;
2468    let resp = configuration.client.execute(req).await?;
2469
2470    let status = resp.status();
2471    let content_type = resp
2472        .headers()
2473        .get("content-type")
2474        .and_then(|v| v.to_str().ok())
2475        .unwrap_or("application/octet-stream");
2476    let content_type = super::ContentType::from(content_type);
2477
2478    if !status.is_client_error() && !status.is_server_error() {
2479        let content = resp.text().await?;
2480        match content_type {
2481            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2482            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsFamily200Response`"))),
2483            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::GetEtfsFamily200Response`")))),
2484        }
2485    } else {
2486        let content = resp.text().await?;
2487        let entity: Option<GetEtfsFamilyError> = serde_json::from_str(&content).ok();
2488        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2489    }
2490}
2491
2492/// The ETFs directory endpoint provides a daily updated list of exchange-traded funds, sorted by total assets in descending order. This endpoint is useful for retrieving comprehensive ETF data, including fund names and asset values, to assist users in quickly identifying the ETFs available.
2493pub async fn get_etfs_list(configuration: &configuration::Configuration, params: GetEtfsListParams) -> Result<models::GetEtfsList200Response, Error<GetEtfsListError>> {
2494    // Extract parameters from params struct
2495    let p_query_symbol = params.symbol;
2496    let p_query_figi = params.figi;
2497    let p_query_isin = params.isin;
2498    let p_query_cusip = params.cusip;
2499    let p_query_cik = params.cik;
2500    let p_query_country = params.country;
2501    let p_query_fund_family = params.fund_family;
2502    let p_query_fund_type = params.fund_type;
2503    let p_query_page = params.page;
2504    let p_query_outputsize = params.outputsize;
2505
2506    let uri_str = format!("{}/etfs/list", configuration.base_path);
2507    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2508
2509    if let Some(ref param_value) = p_query_symbol {
2510        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2511    }
2512    if let Some(ref param_value) = p_query_figi {
2513        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2514    }
2515    if let Some(ref param_value) = p_query_isin {
2516        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2517    }
2518    if let Some(ref param_value) = p_query_cusip {
2519        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2520    }
2521    if let Some(ref param_value) = p_query_cik {
2522        req_builder = req_builder.query(&[("cik", &param_value.to_string())]);
2523    }
2524    if let Some(ref param_value) = p_query_country {
2525        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2526    }
2527    if let Some(ref param_value) = p_query_fund_family {
2528        req_builder = req_builder.query(&[("fund_family", &param_value.to_string())]);
2529    }
2530    if let Some(ref param_value) = p_query_fund_type {
2531        req_builder = req_builder.query(&[("fund_type", &param_value.to_string())]);
2532    }
2533    if let Some(ref param_value) = p_query_page {
2534        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2535    }
2536    if let Some(ref param_value) = p_query_outputsize {
2537        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2538    }
2539    if let Some(ref user_agent) = configuration.user_agent {
2540        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2541    }
2542    if let Some(ref apikey) = configuration.api_key {
2543        let key = apikey.key.clone();
2544        let value = match apikey.prefix {
2545            Some(ref prefix) => format!("{} {}", prefix, key),
2546            None => key,
2547        };
2548        req_builder = req_builder.header("Authorization", value);
2549    };
2550
2551    let req = req_builder.build()?;
2552    let resp = configuration.client.execute(req).await?;
2553
2554    let status = resp.status();
2555    let content_type = resp
2556        .headers()
2557        .get("content-type")
2558        .and_then(|v| v.to_str().ok())
2559        .unwrap_or("application/octet-stream");
2560    let content_type = super::ContentType::from(content_type);
2561
2562    if !status.is_client_error() && !status.is_server_error() {
2563        let content = resp.text().await?;
2564        match content_type {
2565            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2566            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsList200Response`"))),
2567            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::GetEtfsList200Response`")))),
2568        }
2569    } else {
2570        let content = resp.text().await?;
2571        let entity: Option<GetEtfsListError> = serde_json::from_str(&content).ok();
2572        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2573    }
2574}
2575
2576/// The ETFs Types endpoint provides a concise list of ETF categories by market (e.g., Singapore, United States), including types like \"Equity Precious Metals\" and \"Large Blend.\" It supports targeted investment research and portfolio diversification.
2577pub async fn get_etfs_type(configuration: &configuration::Configuration, params: GetEtfsTypeParams) -> Result<models::GetEtfsType200Response, Error<GetEtfsTypeError>> {
2578    // Extract parameters from params struct
2579    let p_query_country = params.country;
2580    let p_query_fund_type = params.fund_type;
2581
2582    let uri_str = format!("{}/etfs/type", configuration.base_path);
2583    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2584
2585    if let Some(ref param_value) = p_query_country {
2586        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2587    }
2588    if let Some(ref param_value) = p_query_fund_type {
2589        req_builder = req_builder.query(&[("fund_type", &param_value.to_string())]);
2590    }
2591    if let Some(ref user_agent) = configuration.user_agent {
2592        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2593    }
2594    if let Some(ref apikey) = configuration.api_key {
2595        let key = apikey.key.clone();
2596        let value = match apikey.prefix {
2597            Some(ref prefix) => format!("{} {}", prefix, key),
2598            None => key,
2599        };
2600        req_builder = req_builder.header("Authorization", value);
2601    };
2602
2603    let req = req_builder.build()?;
2604    let resp = configuration.client.execute(req).await?;
2605
2606    let status = resp.status();
2607    let content_type = resp
2608        .headers()
2609        .get("content-type")
2610        .and_then(|v| v.to_str().ok())
2611        .unwrap_or("application/octet-stream");
2612    let content_type = super::ContentType::from(content_type);
2613
2614    if !status.is_client_error() && !status.is_server_error() {
2615        let content = resp.text().await?;
2616        match content_type {
2617            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2618            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsType200Response`"))),
2619            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::GetEtfsType200Response`")))),
2620        }
2621    } else {
2622        let content = resp.text().await?;
2623        let entity: Option<GetEtfsTypeError> = serde_json::from_str(&content).ok();
2624        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2625    }
2626}
2627
2628/// The exchanges schedule endpoint provides detailed information about various stock exchanges, including their trading hours and operational days. This data is essential for users who need to know when specific exchanges are open for trading, allowing them to plan their activities around the availability of these markets.
2629pub async fn get_exchange_schedule(configuration: &configuration::Configuration, params: GetExchangeScheduleParams) -> Result<models::GetExchangeSchedule200Response, Error<GetExchangeScheduleError>> {
2630    // Extract parameters from params struct
2631    let p_query_mic_name = params.mic_name;
2632    let p_query_mic_code = params.mic_code;
2633    let p_query_country = params.country;
2634    let p_query_date = params.date;
2635
2636    let uri_str = format!("{}/exchange_schedule", configuration.base_path);
2637    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2638
2639    if let Some(ref param_value) = p_query_mic_name {
2640        req_builder = req_builder.query(&[("mic_name", &param_value.to_string())]);
2641    }
2642    if let Some(ref param_value) = p_query_mic_code {
2643        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
2644    }
2645    if let Some(ref param_value) = p_query_country {
2646        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2647    }
2648    if let Some(ref param_value) = p_query_date {
2649        req_builder = req_builder.query(&[("date", &param_value.to_string())]);
2650    }
2651    if let Some(ref user_agent) = configuration.user_agent {
2652        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2653    }
2654    if let Some(ref apikey) = configuration.api_key {
2655        let key = apikey.key.clone();
2656        let value = match apikey.prefix {
2657            Some(ref prefix) => format!("{} {}", prefix, key),
2658            None => key,
2659        };
2660        req_builder = req_builder.header("Authorization", value);
2661    };
2662
2663    let req = req_builder.build()?;
2664    let resp = configuration.client.execute(req).await?;
2665
2666    let status = resp.status();
2667    let content_type = resp
2668        .headers()
2669        .get("content-type")
2670        .and_then(|v| v.to_str().ok())
2671        .unwrap_or("application/octet-stream");
2672    let content_type = super::ContentType::from(content_type);
2673
2674    if !status.is_client_error() && !status.is_server_error() {
2675        let content = resp.text().await?;
2676        match content_type {
2677            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2678            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchangeSchedule200Response`"))),
2679            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::GetExchangeSchedule200Response`")))),
2680        }
2681    } else {
2682        let content = resp.text().await?;
2683        let entity: Option<GetExchangeScheduleError> = serde_json::from_str(&content).ok();
2684        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2685    }
2686}
2687
2688/// The exchanges endpoint provides a comprehensive list of all available equity exchanges. It returns an array containing detailed information about each exchange, such as exchange code, name, country, and timezone. This data is updated daily.
2689pub async fn get_exchanges(configuration: &configuration::Configuration, params: GetExchangesParams) -> Result<models::GetExchanges200Response, Error<GetExchangesError>> {
2690    // Extract parameters from params struct
2691    let p_query_type = params.r#type;
2692    let p_query_name = params.name;
2693    let p_query_code = params.code;
2694    let p_query_country = params.country;
2695    let p_query_format = params.format;
2696    let p_query_delimiter = params.delimiter;
2697    let p_query_show_plan = params.show_plan;
2698
2699    let uri_str = format!("{}/exchanges", configuration.base_path);
2700    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2701
2702    if let Some(ref param_value) = p_query_type {
2703        req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
2704    }
2705    if let Some(ref param_value) = p_query_name {
2706        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
2707    }
2708    if let Some(ref param_value) = p_query_code {
2709        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
2710    }
2711    if let Some(ref param_value) = p_query_country {
2712        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2713    }
2714    if let Some(ref param_value) = p_query_format {
2715        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2716    }
2717    if let Some(ref param_value) = p_query_delimiter {
2718        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2719    }
2720    if let Some(ref param_value) = p_query_show_plan {
2721        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
2722    }
2723    if let Some(ref user_agent) = configuration.user_agent {
2724        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2725    }
2726    if let Some(ref apikey) = configuration.api_key {
2727        let key = apikey.key.clone();
2728        let value = match apikey.prefix {
2729            Some(ref prefix) => format!("{} {}", prefix, key),
2730            None => key,
2731        };
2732        req_builder = req_builder.header("Authorization", value);
2733    };
2734
2735    let req = req_builder.build()?;
2736    let resp = configuration.client.execute(req).await?;
2737
2738    let status = resp.status();
2739    let content_type = resp
2740        .headers()
2741        .get("content-type")
2742        .and_then(|v| v.to_str().ok())
2743        .unwrap_or("application/octet-stream");
2744    let content_type = super::ContentType::from(content_type);
2745
2746    if !status.is_client_error() && !status.is_server_error() {
2747        let content = resp.text().await?;
2748        match content_type {
2749            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2750            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchanges200Response`"))),
2751            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::GetExchanges200Response`")))),
2752        }
2753    } else {
2754        let content = resp.text().await?;
2755        let entity: Option<GetExchangesError> = serde_json::from_str(&content).ok();
2756        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2757    }
2758}
2759
2760/// The forex pairs endpoint provides a comprehensive list of all available foreign exchange currency pairs. It returns an array of forex pairs, which is updated daily.
2761pub async fn get_forex_pairs(configuration: &configuration::Configuration, params: GetForexPairsParams) -> Result<models::GetForexPairs200Response, Error<GetForexPairsError>> {
2762    // Extract parameters from params struct
2763    let p_query_symbol = params.symbol;
2764    let p_query_currency_base = params.currency_base;
2765    let p_query_currency_quote = params.currency_quote;
2766    let p_query_format = params.format;
2767    let p_query_delimiter = params.delimiter;
2768
2769    let uri_str = format!("{}/forex_pairs", configuration.base_path);
2770    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2771
2772    if let Some(ref param_value) = p_query_symbol {
2773        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2774    }
2775    if let Some(ref param_value) = p_query_currency_base {
2776        req_builder = req_builder.query(&[("currency_base", &param_value.to_string())]);
2777    }
2778    if let Some(ref param_value) = p_query_currency_quote {
2779        req_builder = req_builder.query(&[("currency_quote", &param_value.to_string())]);
2780    }
2781    if let Some(ref param_value) = p_query_format {
2782        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2783    }
2784    if let Some(ref param_value) = p_query_delimiter {
2785        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2786    }
2787    if let Some(ref user_agent) = configuration.user_agent {
2788        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2789    }
2790    if let Some(ref apikey) = configuration.api_key {
2791        let key = apikey.key.clone();
2792        let value = match apikey.prefix {
2793            Some(ref prefix) => format!("{} {}", prefix, key),
2794            None => key,
2795        };
2796        req_builder = req_builder.header("Authorization", value);
2797    };
2798
2799    let req = req_builder.build()?;
2800    let resp = configuration.client.execute(req).await?;
2801
2802    let status = resp.status();
2803    let content_type = resp
2804        .headers()
2805        .get("content-type")
2806        .and_then(|v| v.to_str().ok())
2807        .unwrap_or("application/octet-stream");
2808    let content_type = super::ContentType::from(content_type);
2809
2810    if !status.is_client_error() && !status.is_server_error() {
2811        let content = resp.text().await?;
2812        match content_type {
2813            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2814            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetForexPairs200Response`"))),
2815            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::GetForexPairs200Response`")))),
2816        }
2817    } else {
2818        let content = resp.text().await?;
2819        let entity: Option<GetForexPairsError> = serde_json::from_str(&content).ok();
2820        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2821    }
2822}
2823
2824/// The funds endpoint provides a daily updated list of available investment funds. It returns an array containing detailed information about each fund, including identifiers, names, and other relevant attributes.
2825pub async fn get_funds(configuration: &configuration::Configuration, params: GetFundsParams) -> Result<models::GetFunds200Response, Error<GetFundsError>> {
2826    // Extract parameters from params struct
2827    let p_query_symbol = params.symbol;
2828    let p_query_figi = params.figi;
2829    let p_query_isin = params.isin;
2830    let p_query_cusip = params.cusip;
2831    let p_query_cik = params.cik;
2832    let p_query_exchange = params.exchange;
2833    let p_query_country = params.country;
2834    let p_query_format = params.format;
2835    let p_query_delimiter = params.delimiter;
2836    let p_query_show_plan = params.show_plan;
2837    let p_query_page = params.page;
2838    let p_query_outputsize = params.outputsize;
2839
2840    let uri_str = format!("{}/funds", configuration.base_path);
2841    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2842
2843    if let Some(ref param_value) = p_query_symbol {
2844        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
2845    }
2846    if let Some(ref param_value) = p_query_figi {
2847        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
2848    }
2849    if let Some(ref param_value) = p_query_isin {
2850        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
2851    }
2852    if let Some(ref param_value) = p_query_cusip {
2853        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
2854    }
2855    if let Some(ref param_value) = p_query_cik {
2856        req_builder = req_builder.query(&[("cik", &param_value.to_string())]);
2857    }
2858    if let Some(ref param_value) = p_query_exchange {
2859        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
2860    }
2861    if let Some(ref param_value) = p_query_country {
2862        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
2863    }
2864    if let Some(ref param_value) = p_query_format {
2865        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2866    }
2867    if let Some(ref param_value) = p_query_delimiter {
2868        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
2869    }
2870    if let Some(ref param_value) = p_query_show_plan {
2871        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
2872    }
2873    if let Some(ref param_value) = p_query_page {
2874        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2875    }
2876    if let Some(ref param_value) = p_query_outputsize {
2877        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
2878    }
2879    if let Some(ref user_agent) = configuration.user_agent {
2880        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2881    }
2882    if let Some(ref apikey) = configuration.api_key {
2883        let key = apikey.key.clone();
2884        let value = match apikey.prefix {
2885            Some(ref prefix) => format!("{} {}", prefix, key),
2886            None => key,
2887        };
2888        req_builder = req_builder.header("Authorization", value);
2889    };
2890
2891    let req = req_builder.build()?;
2892    let resp = configuration.client.execute(req).await?;
2893
2894    let status = resp.status();
2895    let content_type = resp
2896        .headers()
2897        .get("content-type")
2898        .and_then(|v| v.to_str().ok())
2899        .unwrap_or("application/octet-stream");
2900    let content_type = super::ContentType::from(content_type);
2901
2902    if !status.is_client_error() && !status.is_server_error() {
2903        let content = resp.text().await?;
2904        match content_type {
2905            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2906            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetFunds200Response`"))),
2907            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::GetFunds200Response`")))),
2908        }
2909    } else {
2910        let content = resp.text().await?;
2911        let entity: Option<GetFundsError> = serde_json::from_str(&content).ok();
2912        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2913    }
2914}
2915
2916/// The instrument type endpoint lists all available financial instrument types, such as stocks, ETFs, and cryptos. This information is essential for users to identify and categorize different financial instruments when accessing or analyzing market data.
2917pub async fn get_instrument_type(configuration: &configuration::Configuration) -> Result<models::GetInstrumentType200Response, Error<GetInstrumentTypeError>> {
2918
2919    let uri_str = format!("{}/instrument_type", configuration.base_path);
2920    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2921
2922    if let Some(ref user_agent) = configuration.user_agent {
2923        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2924    }
2925    if let Some(ref apikey) = configuration.api_key {
2926        let key = apikey.key.clone();
2927        let value = match apikey.prefix {
2928            Some(ref prefix) => format!("{} {}", prefix, key),
2929            None => key,
2930        };
2931        req_builder = req_builder.header("Authorization", value);
2932    };
2933
2934    let req = req_builder.build()?;
2935    let resp = configuration.client.execute(req).await?;
2936
2937    let status = resp.status();
2938    let content_type = resp
2939        .headers()
2940        .get("content-type")
2941        .and_then(|v| v.to_str().ok())
2942        .unwrap_or("application/octet-stream");
2943    let content_type = super::ContentType::from(content_type);
2944
2945    if !status.is_client_error() && !status.is_server_error() {
2946        let content = resp.text().await?;
2947        match content_type {
2948            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2949            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetInstrumentType200Response`"))),
2950            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::GetInstrumentType200Response`")))),
2951        }
2952    } else {
2953        let content = resp.text().await?;
2954        let entity: Option<GetInstrumentTypeError> = serde_json::from_str(&content).ok();
2955        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2956    }
2957}
2958
2959/// The intervals endpoint provides a list of supported time intervals that can be used for querying financial data.
2960pub async fn get_intervals(configuration: &configuration::Configuration) -> Result<models::GetIntervals200Response, Error<GetIntervalsError>> {
2961
2962    let uri_str = format!("{}/intervals", configuration.base_path);
2963    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2964
2965    if let Some(ref user_agent) = configuration.user_agent {
2966        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2967    }
2968    if let Some(ref apikey) = configuration.api_key {
2969        let key = apikey.key.clone();
2970        let value = match apikey.prefix {
2971            Some(ref prefix) => format!("{} {}", prefix, key),
2972            None => key,
2973        };
2974        req_builder = req_builder.header("Authorization", value);
2975    };
2976
2977    let req = req_builder.build()?;
2978    let resp = configuration.client.execute(req).await?;
2979
2980    let status = resp.status();
2981    let content_type = resp
2982        .headers()
2983        .get("content-type")
2984        .and_then(|v| v.to_str().ok())
2985        .unwrap_or("application/octet-stream");
2986    let content_type = super::ContentType::from(content_type);
2987
2988    if !status.is_client_error() && !status.is_server_error() {
2989        let content = resp.text().await?;
2990        match content_type {
2991            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2992            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetIntervals200Response`"))),
2993            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::GetIntervals200Response`")))),
2994        }
2995    } else {
2996        let content = resp.text().await?;
2997        let entity: Option<GetIntervalsError> = serde_json::from_str(&content).ok();
2998        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2999    }
3000}
3001
3002/// The market state endpoint provides real-time information on the operational status of all available stock exchanges. It returns data on whether each exchange is currently open or closed, along with the time remaining until the next opening or closing. This endpoint is useful for users who need to monitor exchange hours and plan their trading activities accordingly.
3003pub async fn get_market_state(configuration: &configuration::Configuration, params: GetMarketStateParams) -> Result<Vec<models::MarketStateResponseItem>, Error<GetMarketStateError>> {
3004    // Extract parameters from params struct
3005    let p_query_exchange = params.exchange;
3006    let p_query_code = params.code;
3007    let p_query_country = params.country;
3008
3009    let uri_str = format!("{}/market_state", configuration.base_path);
3010    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3011
3012    if let Some(ref param_value) = p_query_exchange {
3013        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3014    }
3015    if let Some(ref param_value) = p_query_code {
3016        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
3017    }
3018    if let Some(ref param_value) = p_query_country {
3019        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3020    }
3021    if let Some(ref user_agent) = configuration.user_agent {
3022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3023    }
3024    if let Some(ref apikey) = configuration.api_key {
3025        let key = apikey.key.clone();
3026        let value = match apikey.prefix {
3027            Some(ref prefix) => format!("{} {}", prefix, key),
3028            None => key,
3029        };
3030        req_builder = req_builder.header("Authorization", value);
3031    };
3032
3033    let req = req_builder.build()?;
3034    let resp = configuration.client.execute(req).await?;
3035
3036    let status = resp.status();
3037    let content_type = resp
3038        .headers()
3039        .get("content-type")
3040        .and_then(|v| v.to_str().ok())
3041        .unwrap_or("application/octet-stream");
3042    let content_type = super::ContentType::from(content_type);
3043
3044    if !status.is_client_error() && !status.is_server_error() {
3045        let content = resp.text().await?;
3046        match content_type {
3047            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3048            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::MarketStateResponseItem&gt;`"))),
3049            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::MarketStateResponseItem&gt;`")))),
3050        }
3051    } else {
3052        let content = resp.text().await?;
3053        let entity: Option<GetMarketStateError> = serde_json::from_str(&content).ok();
3054        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3055    }
3056}
3057
3058/// The mutual funds family endpoint provides a comprehensive list of MF families, which are groups of mutual funds managed by the same investment company. This data is useful for users looking to explore or compare different fund families, understand the range of investment options offered by each, and identify potential investment opportunities within specific fund families.
3059pub async fn get_mutual_funds_family(configuration: &configuration::Configuration, params: GetMutualFundsFamilyParams) -> Result<models::GetMutualFundsFamily200Response, Error<GetMutualFundsFamilyError>> {
3060    // Extract parameters from params struct
3061    let p_query_fund_family = params.fund_family;
3062    let p_query_country = params.country;
3063
3064    let uri_str = format!("{}/mutual_funds/family", configuration.base_path);
3065    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3066
3067    if let Some(ref param_value) = p_query_fund_family {
3068        req_builder = req_builder.query(&[("fund_family", &param_value.to_string())]);
3069    }
3070    if let Some(ref param_value) = p_query_country {
3071        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3072    }
3073    if let Some(ref user_agent) = configuration.user_agent {
3074        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3075    }
3076    if let Some(ref apikey) = configuration.api_key {
3077        let key = apikey.key.clone();
3078        let value = match apikey.prefix {
3079            Some(ref prefix) => format!("{} {}", prefix, key),
3080            None => key,
3081        };
3082        req_builder = req_builder.header("Authorization", value);
3083    };
3084
3085    let req = req_builder.build()?;
3086    let resp = configuration.client.execute(req).await?;
3087
3088    let status = resp.status();
3089    let content_type = resp
3090        .headers()
3091        .get("content-type")
3092        .and_then(|v| v.to_str().ok())
3093        .unwrap_or("application/octet-stream");
3094    let content_type = super::ContentType::from(content_type);
3095
3096    if !status.is_client_error() && !status.is_server_error() {
3097        let content = resp.text().await?;
3098        match content_type {
3099            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3100            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsFamily200Response`"))),
3101            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::GetMutualFundsFamily200Response`")))),
3102        }
3103    } else {
3104        let content = resp.text().await?;
3105        let entity: Option<GetMutualFundsFamilyError> = serde_json::from_str(&content).ok();
3106        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3107    }
3108}
3109
3110/// The mutual funds directory endpoint provides a daily updated list of mutual funds, sorted in descending order by their total assets value. This endpoint is useful for retrieving an organized overview of available mutual funds.
3111pub async fn get_mutual_funds_list(configuration: &configuration::Configuration, params: GetMutualFundsListParams) -> Result<models::GetMutualFundsList200Response, Error<GetMutualFundsListError>> {
3112    // Extract parameters from params struct
3113    let p_query_symbol = params.symbol;
3114    let p_query_figi = params.figi;
3115    let p_query_isin = params.isin;
3116    let p_query_cusip = params.cusip;
3117    let p_query_cik = params.cik;
3118    let p_query_country = params.country;
3119    let p_query_fund_family = params.fund_family;
3120    let p_query_fund_type = params.fund_type;
3121    let p_query_performance_rating = params.performance_rating;
3122    let p_query_risk_rating = params.risk_rating;
3123    let p_query_page = params.page;
3124    let p_query_outputsize = params.outputsize;
3125
3126    let uri_str = format!("{}/mutual_funds/list", configuration.base_path);
3127    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3128
3129    if let Some(ref param_value) = p_query_symbol {
3130        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3131    }
3132    if let Some(ref param_value) = p_query_figi {
3133        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3134    }
3135    if let Some(ref param_value) = p_query_isin {
3136        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3137    }
3138    if let Some(ref param_value) = p_query_cusip {
3139        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3140    }
3141    if let Some(ref param_value) = p_query_cik {
3142        req_builder = req_builder.query(&[("cik", &param_value.to_string())]);
3143    }
3144    if let Some(ref param_value) = p_query_country {
3145        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3146    }
3147    if let Some(ref param_value) = p_query_fund_family {
3148        req_builder = req_builder.query(&[("fund_family", &param_value.to_string())]);
3149    }
3150    if let Some(ref param_value) = p_query_fund_type {
3151        req_builder = req_builder.query(&[("fund_type", &param_value.to_string())]);
3152    }
3153    if let Some(ref param_value) = p_query_performance_rating {
3154        req_builder = req_builder.query(&[("performance_rating", &param_value.to_string())]);
3155    }
3156    if let Some(ref param_value) = p_query_risk_rating {
3157        req_builder = req_builder.query(&[("risk_rating", &param_value.to_string())]);
3158    }
3159    if let Some(ref param_value) = p_query_page {
3160        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3161    }
3162    if let Some(ref param_value) = p_query_outputsize {
3163        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3164    }
3165    if let Some(ref user_agent) = configuration.user_agent {
3166        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3167    }
3168    if let Some(ref apikey) = configuration.api_key {
3169        let key = apikey.key.clone();
3170        let value = match apikey.prefix {
3171            Some(ref prefix) => format!("{} {}", prefix, key),
3172            None => key,
3173        };
3174        req_builder = req_builder.header("Authorization", value);
3175    };
3176
3177    let req = req_builder.build()?;
3178    let resp = configuration.client.execute(req).await?;
3179
3180    let status = resp.status();
3181    let content_type = resp
3182        .headers()
3183        .get("content-type")
3184        .and_then(|v| v.to_str().ok())
3185        .unwrap_or("application/octet-stream");
3186    let content_type = super::ContentType::from(content_type);
3187
3188    if !status.is_client_error() && !status.is_server_error() {
3189        let content = resp.text().await?;
3190        match content_type {
3191            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3192            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsList200Response`"))),
3193            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::GetMutualFundsList200Response`")))),
3194        }
3195    } else {
3196        let content = resp.text().await?;
3197        let entity: Option<GetMutualFundsListError> = serde_json::from_str(&content).ok();
3198        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3199    }
3200}
3201
3202/// This endpoint provides detailed information on various types of mutual funds, such as equity, bond, and balanced funds, allowing users to understand the different investment options available.
3203pub async fn get_mutual_funds_type(configuration: &configuration::Configuration, params: GetMutualFundsTypeParams) -> Result<models::GetMutualFundsType200Response, Error<GetMutualFundsTypeError>> {
3204    // Extract parameters from params struct
3205    let p_query_fund_type = params.fund_type;
3206    let p_query_country = params.country;
3207
3208    let uri_str = format!("{}/mutual_funds/type", configuration.base_path);
3209    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3210
3211    if let Some(ref param_value) = p_query_fund_type {
3212        req_builder = req_builder.query(&[("fund_type", &param_value.to_string())]);
3213    }
3214    if let Some(ref param_value) = p_query_country {
3215        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3216    }
3217    if let Some(ref user_agent) = configuration.user_agent {
3218        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3219    }
3220    if let Some(ref apikey) = configuration.api_key {
3221        let key = apikey.key.clone();
3222        let value = match apikey.prefix {
3223            Some(ref prefix) => format!("{} {}", prefix, key),
3224            None => key,
3225        };
3226        req_builder = req_builder.header("Authorization", value);
3227    };
3228
3229    let req = req_builder.build()?;
3230    let resp = configuration.client.execute(req).await?;
3231
3232    let status = resp.status();
3233    let content_type = resp
3234        .headers()
3235        .get("content-type")
3236        .and_then(|v| v.to_str().ok())
3237        .unwrap_or("application/octet-stream");
3238    let content_type = super::ContentType::from(content_type);
3239
3240    if !status.is_client_error() && !status.is_server_error() {
3241        let content = resp.text().await?;
3242        match content_type {
3243            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3244            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsType200Response`"))),
3245            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::GetMutualFundsType200Response`")))),
3246        }
3247    } else {
3248        let content = resp.text().await?;
3249        let entity: Option<GetMutualFundsTypeError> = serde_json::from_str(&content).ok();
3250        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3251    }
3252}
3253
3254/// The stocks endpoint provides a daily updated list of all available stock symbols. It returns an array containing the symbols, which can be used to identify and access specific stock data across various services. This endpoint is essential for users needing to retrieve the latest stock symbol information for further data requests or integration into financial applications.
3255pub async fn get_stocks(configuration: &configuration::Configuration, params: GetStocksParams) -> Result<models::GetStocks200Response, Error<GetStocksError>> {
3256    // Extract parameters from params struct
3257    let p_query_symbol = params.symbol;
3258    let p_query_figi = params.figi;
3259    let p_query_isin = params.isin;
3260    let p_query_cusip = params.cusip;
3261    let p_query_cik = params.cik;
3262    let p_query_exchange = params.exchange;
3263    let p_query_mic_code = params.mic_code;
3264    let p_query_country = params.country;
3265    let p_query_type = params.r#type;
3266    let p_query_format = params.format;
3267    let p_query_delimiter = params.delimiter;
3268    let p_query_show_plan = params.show_plan;
3269    let p_query_include_delisted = params.include_delisted;
3270
3271    let uri_str = format!("{}/stocks", configuration.base_path);
3272    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3273
3274    if let Some(ref param_value) = p_query_symbol {
3275        req_builder = req_builder.query(&[("symbol", &param_value.to_string())]);
3276    }
3277    if let Some(ref param_value) = p_query_figi {
3278        req_builder = req_builder.query(&[("figi", &param_value.to_string())]);
3279    }
3280    if let Some(ref param_value) = p_query_isin {
3281        req_builder = req_builder.query(&[("isin", &param_value.to_string())]);
3282    }
3283    if let Some(ref param_value) = p_query_cusip {
3284        req_builder = req_builder.query(&[("cusip", &param_value.to_string())]);
3285    }
3286    if let Some(ref param_value) = p_query_cik {
3287        req_builder = req_builder.query(&[("cik", &param_value.to_string())]);
3288    }
3289    if let Some(ref param_value) = p_query_exchange {
3290        req_builder = req_builder.query(&[("exchange", &param_value.to_string())]);
3291    }
3292    if let Some(ref param_value) = p_query_mic_code {
3293        req_builder = req_builder.query(&[("mic_code", &param_value.to_string())]);
3294    }
3295    if let Some(ref param_value) = p_query_country {
3296        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
3297    }
3298    if let Some(ref param_value) = p_query_type {
3299        req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
3300    }
3301    if let Some(ref param_value) = p_query_format {
3302        req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
3303    }
3304    if let Some(ref param_value) = p_query_delimiter {
3305        req_builder = req_builder.query(&[("delimiter", &param_value.to_string())]);
3306    }
3307    if let Some(ref param_value) = p_query_show_plan {
3308        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
3309    }
3310    if let Some(ref param_value) = p_query_include_delisted {
3311        req_builder = req_builder.query(&[("include_delisted", &param_value.to_string())]);
3312    }
3313    if let Some(ref user_agent) = configuration.user_agent {
3314        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3315    }
3316    if let Some(ref apikey) = configuration.api_key {
3317        let key = apikey.key.clone();
3318        let value = match apikey.prefix {
3319            Some(ref prefix) => format!("{} {}", prefix, key),
3320            None => key,
3321        };
3322        req_builder = req_builder.header("Authorization", value);
3323    };
3324
3325    let req = req_builder.build()?;
3326    let resp = configuration.client.execute(req).await?;
3327
3328    let status = resp.status();
3329    let content_type = resp
3330        .headers()
3331        .get("content-type")
3332        .and_then(|v| v.to_str().ok())
3333        .unwrap_or("application/octet-stream");
3334    let content_type = super::ContentType::from(content_type);
3335
3336    if !status.is_client_error() && !status.is_server_error() {
3337        let content = resp.text().await?;
3338        match content_type {
3339            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3340            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetStocks200Response`"))),
3341            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::GetStocks200Response`")))),
3342        }
3343    } else {
3344        let content = resp.text().await?;
3345        let entity: Option<GetStocksError> = serde_json::from_str(&content).ok();
3346        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3347    }
3348}
3349
3350/// The symbol search endpoint allows users to find financial instruments by name or symbol. It returns a list of matching symbols, ordered by relevance, with the most relevant instrument first. This is useful for quickly locating specific stocks, ETFs, or other financial instruments when only partial information is available.
3351pub async fn get_symbol_search(configuration: &configuration::Configuration, params: GetSymbolSearchParams) -> Result<models::GetSymbolSearch200Response, Error<GetSymbolSearchError>> {
3352    // Extract parameters from params struct
3353    let p_query_symbol = params.symbol;
3354    let p_query_outputsize = params.outputsize;
3355    let p_query_show_plan = params.show_plan;
3356
3357    let uri_str = format!("{}/symbol_search", configuration.base_path);
3358    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3359
3360    req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3361    if let Some(ref param_value) = p_query_outputsize {
3362        req_builder = req_builder.query(&[("outputsize", &param_value.to_string())]);
3363    }
3364    if let Some(ref param_value) = p_query_show_plan {
3365        req_builder = req_builder.query(&[("show_plan", &param_value.to_string())]);
3366    }
3367    if let Some(ref user_agent) = configuration.user_agent {
3368        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3369    }
3370    if let Some(ref apikey) = configuration.api_key {
3371        let key = apikey.key.clone();
3372        let value = match apikey.prefix {
3373            Some(ref prefix) => format!("{} {}", prefix, key),
3374            None => key,
3375        };
3376        req_builder = req_builder.header("Authorization", value);
3377    };
3378
3379    let req = req_builder.build()?;
3380    let resp = configuration.client.execute(req).await?;
3381
3382    let status = resp.status();
3383    let content_type = resp
3384        .headers()
3385        .get("content-type")
3386        .and_then(|v| v.to_str().ok())
3387        .unwrap_or("application/octet-stream");
3388    let content_type = super::ContentType::from(content_type);
3389
3390    if !status.is_client_error() && !status.is_server_error() {
3391        let content = resp.text().await?;
3392        match content_type {
3393            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3394            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSymbolSearch200Response`"))),
3395            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::GetSymbolSearch200Response`")))),
3396        }
3397    } else {
3398        let content = resp.text().await?;
3399        let entity: Option<GetSymbolSearchError> = serde_json::from_str(&content).ok();
3400        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3401    }
3402}
3403
3404/// The technical indicators endpoint provides a comprehensive list of available technical indicators, each represented as an object. This endpoint is useful for developers looking to integrate a variety of technical analysis tools into their applications, allowing for streamlined access to indicator data without needing to manually configure each one.
3405pub async fn get_technical_indicators(configuration: &configuration::Configuration) -> Result<models::GetTechnicalIndicators200Response, Error<GetTechnicalIndicatorsError>> {
3406
3407    let uri_str = format!("{}/technical_indicators", configuration.base_path);
3408    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3409
3410    if let Some(ref user_agent) = configuration.user_agent {
3411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3412    }
3413    if let Some(ref apikey) = configuration.api_key {
3414        let key = apikey.key.clone();
3415        let value = match apikey.prefix {
3416            Some(ref prefix) => format!("{} {}", prefix, key),
3417            None => key,
3418        };
3419        req_builder = req_builder.header("Authorization", value);
3420    };
3421
3422    let req = req_builder.build()?;
3423    let resp = configuration.client.execute(req).await?;
3424
3425    let status = resp.status();
3426    let content_type = resp
3427        .headers()
3428        .get("content-type")
3429        .and_then(|v| v.to_str().ok())
3430        .unwrap_or("application/octet-stream");
3431    let content_type = super::ContentType::from(content_type);
3432
3433    if !status.is_client_error() && !status.is_server_error() {
3434        let content = resp.text().await?;
3435        match content_type {
3436            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3437            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTechnicalIndicators200Response`"))),
3438            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::GetTechnicalIndicators200Response`")))),
3439        }
3440    } else {
3441        let content = resp.text().await?;
3442        let entity: Option<GetTechnicalIndicatorsError> = serde_json::from_str(&content).ok();
3443        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3444    }
3445}
3446