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