1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17#[derive(Clone, Debug, Default, Serialize, Deserialize)]
19pub struct GetCurrencyConversionParams {
20 pub symbol: String,
22 pub amount: f64,
24 pub date: Option<String>,
26 pub format: Option<String>,
28 pub delimiter: Option<String>,
30 pub dp: Option<i64>,
32 pub timezone: Option<String>
34}
35
36impl GetCurrencyConversionParams {
37 pub fn builder() -> GetCurrencyConversionParamsBuilder {
39 GetCurrencyConversionParamsBuilder::default()
40 }
41}
42
43#[derive(Clone, Debug, Default)]
45pub struct GetCurrencyConversionParamsBuilder {
46 symbol: String,
48 amount: f64,
50 date: Option<String>,
52 format: Option<String>,
54 delimiter: Option<String>,
56 dp: Option<i64>,
58 timezone: Option<String>
60}
61
62impl GetCurrencyConversionParamsBuilder {
63 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
65 self.symbol = symbol.into();
66 self
67 }
68 pub fn amount(mut self, amount: f64) -> Self {
70 self.amount = amount;
71 self
72 }
73 pub fn date(mut self, date: impl Into<String>) -> Self {
75 self.date = Some(date.into());
76 self
77 }
78 pub fn format(mut self, format: impl Into<String>) -> Self {
80 self.format = Some(format.into());
81 self
82 }
83 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
85 self.delimiter = Some(delimiter.into());
86 self
87 }
88 pub fn dp(mut self, dp: i64) -> Self {
90 self.dp = Some(dp);
91 self
92 }
93 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
95 self.timezone = Some(timezone.into());
96 self
97 }
98
99 pub fn build(self) -> GetCurrencyConversionParams {
101 GetCurrencyConversionParams {
102 symbol: self.symbol,
103 amount: self.amount,
104 date: self.date,
105 format: self.format,
106 delimiter: self.delimiter,
107 dp: self.dp,
108 timezone: self.timezone
109 }
110 }
111}
112
113#[derive(Clone, Debug, Default, Serialize, Deserialize)]
115pub struct GetEodParams {
116 pub symbol: Option<String>,
118 pub figi: Option<String>,
120 pub isin: Option<String>,
122 pub cusip: Option<String>,
124 pub exchange: Option<String>,
126 pub mic_code: Option<String>,
128 pub country: Option<String>,
130 pub r#type: Option<String>,
132 pub date: Option<String>,
134 pub prepost: Option<bool>,
136 pub dp: Option<i64>
138}
139
140impl GetEodParams {
141 pub fn builder() -> GetEodParamsBuilder {
143 GetEodParamsBuilder::default()
144 }
145}
146
147#[derive(Clone, Debug, Default)]
149pub struct GetEodParamsBuilder {
150 symbol: Option<String>,
152 figi: Option<String>,
154 isin: Option<String>,
156 cusip: Option<String>,
158 exchange: Option<String>,
160 mic_code: Option<String>,
162 country: Option<String>,
164 r#type: Option<String>,
166 date: Option<String>,
168 prepost: Option<bool>,
170 dp: Option<i64>
172}
173
174impl GetEodParamsBuilder {
175 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
177 self.symbol = Some(symbol.into());
178 self
179 }
180 pub fn figi(mut self, figi: impl Into<String>) -> Self {
182 self.figi = Some(figi.into());
183 self
184 }
185 pub fn isin(mut self, isin: impl Into<String>) -> Self {
187 self.isin = Some(isin.into());
188 self
189 }
190 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
192 self.cusip = Some(cusip.into());
193 self
194 }
195 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
197 self.exchange = Some(exchange.into());
198 self
199 }
200 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
202 self.mic_code = Some(mic_code.into());
203 self
204 }
205 pub fn country(mut self, country: impl Into<String>) -> Self {
207 self.country = Some(country.into());
208 self
209 }
210 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
212 self.r#type = Some(r#type.into());
213 self
214 }
215 pub fn date(mut self, date: impl Into<String>) -> Self {
217 self.date = Some(date.into());
218 self
219 }
220 pub fn prepost(mut self, prepost: bool) -> Self {
222 self.prepost = Some(prepost);
223 self
224 }
225 pub fn dp(mut self, dp: i64) -> Self {
227 self.dp = Some(dp);
228 self
229 }
230
231 pub fn build(self) -> GetEodParams {
233 GetEodParams {
234 symbol: self.symbol,
235 figi: self.figi,
236 isin: self.isin,
237 cusip: self.cusip,
238 exchange: self.exchange,
239 mic_code: self.mic_code,
240 country: self.country,
241 r#type: self.r#type,
242 date: self.date,
243 prepost: self.prepost,
244 dp: self.dp
245 }
246 }
247}
248
249#[derive(Clone, Debug, Default, Serialize, Deserialize)]
251pub struct GetExchangeRateParams {
252 pub symbol: String,
254 pub date: Option<String>,
256 pub format: Option<String>,
258 pub delimiter: Option<String>,
260 pub dp: Option<i64>,
262 pub timezone: Option<String>
264}
265
266impl GetExchangeRateParams {
267 pub fn builder() -> GetExchangeRateParamsBuilder {
269 GetExchangeRateParamsBuilder::default()
270 }
271}
272
273#[derive(Clone, Debug, Default)]
275pub struct GetExchangeRateParamsBuilder {
276 symbol: String,
278 date: Option<String>,
280 format: Option<String>,
282 delimiter: Option<String>,
284 dp: Option<i64>,
286 timezone: Option<String>
288}
289
290impl GetExchangeRateParamsBuilder {
291 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
293 self.symbol = symbol.into();
294 self
295 }
296 pub fn date(mut self, date: impl Into<String>) -> Self {
298 self.date = Some(date.into());
299 self
300 }
301 pub fn format(mut self, format: impl Into<String>) -> Self {
303 self.format = Some(format.into());
304 self
305 }
306 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
308 self.delimiter = Some(delimiter.into());
309 self
310 }
311 pub fn dp(mut self, dp: i64) -> Self {
313 self.dp = Some(dp);
314 self
315 }
316 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
318 self.timezone = Some(timezone.into());
319 self
320 }
321
322 pub fn build(self) -> GetExchangeRateParams {
324 GetExchangeRateParams {
325 symbol: self.symbol,
326 date: self.date,
327 format: self.format,
328 delimiter: self.delimiter,
329 dp: self.dp,
330 timezone: self.timezone
331 }
332 }
333}
334
335#[derive(Clone, Debug, Default, Serialize, Deserialize)]
337pub struct GetMarketMoversParams {
338 pub market: String,
340 pub direction: Option<String>,
342 pub outputsize: Option<i64>,
344 pub country: Option<String>,
346 pub price_greater_than: Option<String>,
348 pub dp: Option<String>
350}
351
352impl GetMarketMoversParams {
353 pub fn builder() -> GetMarketMoversParamsBuilder {
355 GetMarketMoversParamsBuilder::default()
356 }
357}
358
359#[derive(Clone, Debug, Default)]
361pub struct GetMarketMoversParamsBuilder {
362 market: String,
364 direction: Option<String>,
366 outputsize: Option<i64>,
368 country: Option<String>,
370 price_greater_than: Option<String>,
372 dp: Option<String>
374}
375
376impl GetMarketMoversParamsBuilder {
377 pub fn market(mut self, market: impl Into<String>) -> Self {
379 self.market = market.into();
380 self
381 }
382 pub fn direction(mut self, direction: impl Into<String>) -> Self {
384 self.direction = Some(direction.into());
385 self
386 }
387 pub fn outputsize(mut self, outputsize: i64) -> Self {
389 self.outputsize = Some(outputsize);
390 self
391 }
392 pub fn country(mut self, country: impl Into<String>) -> Self {
394 self.country = Some(country.into());
395 self
396 }
397 pub fn price_greater_than(mut self, price_greater_than: impl Into<String>) -> Self {
399 self.price_greater_than = Some(price_greater_than.into());
400 self
401 }
402 pub fn dp(mut self, dp: impl Into<String>) -> Self {
404 self.dp = Some(dp.into());
405 self
406 }
407
408 pub fn build(self) -> GetMarketMoversParams {
410 GetMarketMoversParams {
411 market: self.market,
412 direction: self.direction,
413 outputsize: self.outputsize,
414 country: self.country,
415 price_greater_than: self.price_greater_than,
416 dp: self.dp
417 }
418 }
419}
420
421#[derive(Clone, Debug, Default, Serialize, Deserialize)]
423pub struct GetPriceParams {
424 pub symbol: Option<String>,
426 pub figi: Option<String>,
428 pub isin: Option<String>,
430 pub cusip: Option<String>,
432 pub exchange: Option<String>,
434 pub mic_code: Option<String>,
436 pub country: Option<String>,
438 pub r#type: Option<String>,
440 pub format: Option<String>,
442 pub delimiter: Option<String>,
444 pub prepost: Option<bool>,
446 pub dp: Option<i64>
448}
449
450impl GetPriceParams {
451 pub fn builder() -> GetPriceParamsBuilder {
453 GetPriceParamsBuilder::default()
454 }
455}
456
457#[derive(Clone, Debug, Default)]
459pub struct GetPriceParamsBuilder {
460 symbol: Option<String>,
462 figi: Option<String>,
464 isin: Option<String>,
466 cusip: Option<String>,
468 exchange: Option<String>,
470 mic_code: Option<String>,
472 country: Option<String>,
474 r#type: Option<String>,
476 format: Option<String>,
478 delimiter: Option<String>,
480 prepost: Option<bool>,
482 dp: Option<i64>
484}
485
486impl GetPriceParamsBuilder {
487 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
489 self.symbol = Some(symbol.into());
490 self
491 }
492 pub fn figi(mut self, figi: impl Into<String>) -> Self {
494 self.figi = Some(figi.into());
495 self
496 }
497 pub fn isin(mut self, isin: impl Into<String>) -> Self {
499 self.isin = Some(isin.into());
500 self
501 }
502 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
504 self.cusip = Some(cusip.into());
505 self
506 }
507 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
509 self.exchange = Some(exchange.into());
510 self
511 }
512 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
514 self.mic_code = Some(mic_code.into());
515 self
516 }
517 pub fn country(mut self, country: impl Into<String>) -> Self {
519 self.country = Some(country.into());
520 self
521 }
522 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
524 self.r#type = Some(r#type.into());
525 self
526 }
527 pub fn format(mut self, format: impl Into<String>) -> Self {
529 self.format = Some(format.into());
530 self
531 }
532 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
534 self.delimiter = Some(delimiter.into());
535 self
536 }
537 pub fn prepost(mut self, prepost: bool) -> Self {
539 self.prepost = Some(prepost);
540 self
541 }
542 pub fn dp(mut self, dp: i64) -> Self {
544 self.dp = Some(dp);
545 self
546 }
547
548 pub fn build(self) -> GetPriceParams {
550 GetPriceParams {
551 symbol: self.symbol,
552 figi: self.figi,
553 isin: self.isin,
554 cusip: self.cusip,
555 exchange: self.exchange,
556 mic_code: self.mic_code,
557 country: self.country,
558 r#type: self.r#type,
559 format: self.format,
560 delimiter: self.delimiter,
561 prepost: self.prepost,
562 dp: self.dp
563 }
564 }
565}
566
567#[derive(Clone, Debug, Default, Serialize, Deserialize)]
569pub struct GetQuoteParams {
570 pub symbol: Option<String>,
572 pub figi: Option<String>,
574 pub isin: Option<String>,
576 pub cusip: Option<String>,
578 pub interval: Option<String>,
580 pub exchange: Option<String>,
582 pub mic_code: Option<String>,
584 pub country: Option<String>,
586 pub volume_time_period: Option<i64>,
588 pub r#type: Option<String>,
590 pub format: Option<String>,
592 pub delimiter: Option<String>,
594 pub prepost: Option<bool>,
596 pub eod: Option<bool>,
598 pub rolling_period: Option<i64>,
600 pub dp: Option<i64>,
602 pub timezone: Option<String>
604}
605
606impl GetQuoteParams {
607 pub fn builder() -> GetQuoteParamsBuilder {
609 GetQuoteParamsBuilder::default()
610 }
611}
612
613#[derive(Clone, Debug, Default)]
615pub struct GetQuoteParamsBuilder {
616 symbol: Option<String>,
618 figi: Option<String>,
620 isin: Option<String>,
622 cusip: Option<String>,
624 interval: Option<String>,
626 exchange: Option<String>,
628 mic_code: Option<String>,
630 country: Option<String>,
632 volume_time_period: Option<i64>,
634 r#type: Option<String>,
636 format: Option<String>,
638 delimiter: Option<String>,
640 prepost: Option<bool>,
642 eod: Option<bool>,
644 rolling_period: Option<i64>,
646 dp: Option<i64>,
648 timezone: Option<String>
650}
651
652impl GetQuoteParamsBuilder {
653 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
655 self.symbol = Some(symbol.into());
656 self
657 }
658 pub fn figi(mut self, figi: impl Into<String>) -> Self {
660 self.figi = Some(figi.into());
661 self
662 }
663 pub fn isin(mut self, isin: impl Into<String>) -> Self {
665 self.isin = Some(isin.into());
666 self
667 }
668 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
670 self.cusip = Some(cusip.into());
671 self
672 }
673 pub fn interval(mut self, interval: impl Into<String>) -> Self {
675 self.interval = Some(interval.into());
676 self
677 }
678 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
680 self.exchange = Some(exchange.into());
681 self
682 }
683 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
685 self.mic_code = Some(mic_code.into());
686 self
687 }
688 pub fn country(mut self, country: impl Into<String>) -> Self {
690 self.country = Some(country.into());
691 self
692 }
693 pub fn volume_time_period(mut self, volume_time_period: i64) -> Self {
695 self.volume_time_period = Some(volume_time_period);
696 self
697 }
698 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
700 self.r#type = Some(r#type.into());
701 self
702 }
703 pub fn format(mut self, format: impl Into<String>) -> Self {
705 self.format = Some(format.into());
706 self
707 }
708 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
710 self.delimiter = Some(delimiter.into());
711 self
712 }
713 pub fn prepost(mut self, prepost: bool) -> Self {
715 self.prepost = Some(prepost);
716 self
717 }
718 pub fn eod(mut self, eod: bool) -> Self {
720 self.eod = Some(eod);
721 self
722 }
723 pub fn rolling_period(mut self, rolling_period: i64) -> Self {
725 self.rolling_period = Some(rolling_period);
726 self
727 }
728 pub fn dp(mut self, dp: i64) -> Self {
730 self.dp = Some(dp);
731 self
732 }
733 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
735 self.timezone = Some(timezone.into());
736 self
737 }
738
739 pub fn build(self) -> GetQuoteParams {
741 GetQuoteParams {
742 symbol: self.symbol,
743 figi: self.figi,
744 isin: self.isin,
745 cusip: self.cusip,
746 interval: self.interval,
747 exchange: self.exchange,
748 mic_code: self.mic_code,
749 country: self.country,
750 volume_time_period: self.volume_time_period,
751 r#type: self.r#type,
752 format: self.format,
753 delimiter: self.delimiter,
754 prepost: self.prepost,
755 eod: self.eod,
756 rolling_period: self.rolling_period,
757 dp: self.dp,
758 timezone: self.timezone
759 }
760 }
761}
762
763#[derive(Clone, Debug, Default, Serialize, Deserialize)]
765pub struct GetTimeSeriesParams {
766 pub interval: String,
768 pub symbol: Option<String>,
770 pub isin: Option<String>,
772 pub figi: Option<String>,
774 pub cusip: Option<String>,
776 pub outputsize: Option<i64>,
778 pub exchange: Option<String>,
780 pub mic_code: Option<String>,
782 pub country: Option<String>,
784 pub r#type: Option<String>,
786 pub timezone: Option<String>,
788 pub start_date: Option<String>,
790 pub end_date: Option<String>,
792 pub date: Option<String>,
794 pub order: Option<String>,
796 pub prepost: Option<bool>,
798 pub format: Option<String>,
800 pub delimiter: Option<String>,
802 pub dp: Option<i64>,
804 pub previous_close: Option<bool>,
806 pub adjust: Option<String>
808}
809
810impl GetTimeSeriesParams {
811 pub fn builder() -> GetTimeSeriesParamsBuilder {
813 GetTimeSeriesParamsBuilder::default()
814 }
815}
816
817#[derive(Clone, Debug, Default)]
819pub struct GetTimeSeriesParamsBuilder {
820 interval: String,
822 symbol: Option<String>,
824 isin: Option<String>,
826 figi: Option<String>,
828 cusip: Option<String>,
830 outputsize: Option<i64>,
832 exchange: Option<String>,
834 mic_code: Option<String>,
836 country: Option<String>,
838 r#type: Option<String>,
840 timezone: Option<String>,
842 start_date: Option<String>,
844 end_date: Option<String>,
846 date: Option<String>,
848 order: Option<String>,
850 prepost: Option<bool>,
852 format: Option<String>,
854 delimiter: Option<String>,
856 dp: Option<i64>,
858 previous_close: Option<bool>,
860 adjust: Option<String>
862}
863
864impl GetTimeSeriesParamsBuilder {
865 pub fn interval(mut self, interval: impl Into<String>) -> Self {
867 self.interval = interval.into();
868 self
869 }
870 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
872 self.symbol = Some(symbol.into());
873 self
874 }
875 pub fn isin(mut self, isin: impl Into<String>) -> Self {
877 self.isin = Some(isin.into());
878 self
879 }
880 pub fn figi(mut self, figi: impl Into<String>) -> Self {
882 self.figi = Some(figi.into());
883 self
884 }
885 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
887 self.cusip = Some(cusip.into());
888 self
889 }
890 pub fn outputsize(mut self, outputsize: i64) -> Self {
892 self.outputsize = Some(outputsize);
893 self
894 }
895 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
897 self.exchange = Some(exchange.into());
898 self
899 }
900 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
902 self.mic_code = Some(mic_code.into());
903 self
904 }
905 pub fn country(mut self, country: impl Into<String>) -> Self {
907 self.country = Some(country.into());
908 self
909 }
910 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
912 self.r#type = Some(r#type.into());
913 self
914 }
915 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
917 self.timezone = Some(timezone.into());
918 self
919 }
920 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
922 self.start_date = Some(start_date.into());
923 self
924 }
925 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
927 self.end_date = Some(end_date.into());
928 self
929 }
930 pub fn date(mut self, date: impl Into<String>) -> Self {
932 self.date = Some(date.into());
933 self
934 }
935 pub fn order(mut self, order: impl Into<String>) -> Self {
937 self.order = Some(order.into());
938 self
939 }
940 pub fn prepost(mut self, prepost: bool) -> Self {
942 self.prepost = Some(prepost);
943 self
944 }
945 pub fn format(mut self, format: impl Into<String>) -> Self {
947 self.format = Some(format.into());
948 self
949 }
950 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
952 self.delimiter = Some(delimiter.into());
953 self
954 }
955 pub fn dp(mut self, dp: i64) -> Self {
957 self.dp = Some(dp);
958 self
959 }
960 pub fn previous_close(mut self, previous_close: bool) -> Self {
962 self.previous_close = Some(previous_close);
963 self
964 }
965 pub fn adjust(mut self, adjust: impl Into<String>) -> Self {
967 self.adjust = Some(adjust.into());
968 self
969 }
970
971 pub fn build(self) -> GetTimeSeriesParams {
973 GetTimeSeriesParams {
974 interval: self.interval,
975 symbol: self.symbol,
976 isin: self.isin,
977 figi: self.figi,
978 cusip: self.cusip,
979 outputsize: self.outputsize,
980 exchange: self.exchange,
981 mic_code: self.mic_code,
982 country: self.country,
983 r#type: self.r#type,
984 timezone: self.timezone,
985 start_date: self.start_date,
986 end_date: self.end_date,
987 date: self.date,
988 order: self.order,
989 prepost: self.prepost,
990 format: self.format,
991 delimiter: self.delimiter,
992 dp: self.dp,
993 previous_close: self.previous_close,
994 adjust: self.adjust
995 }
996 }
997}
998
999#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1001pub struct GetTimeSeriesCrossParams {
1002 pub base: String,
1004 pub quote: String,
1006 pub interval: String,
1008 pub base_type: Option<String>,
1010 pub base_exchange: Option<String>,
1012 pub base_mic_code: Option<String>,
1014 pub quote_type: Option<String>,
1016 pub quote_exchange: Option<String>,
1018 pub quote_mic_code: Option<String>,
1020 pub outputsize: Option<i64>,
1022 pub format: Option<String>,
1024 pub delimiter: Option<String>,
1026 pub prepost: Option<bool>,
1028 pub start_date: Option<String>,
1030 pub end_date: Option<String>,
1032 pub adjust: Option<bool>,
1034 pub dp: Option<i64>,
1036 pub timezone: Option<String>
1038}
1039
1040impl GetTimeSeriesCrossParams {
1041 pub fn builder() -> GetTimeSeriesCrossParamsBuilder {
1043 GetTimeSeriesCrossParamsBuilder::default()
1044 }
1045}
1046
1047#[derive(Clone, Debug, Default)]
1049pub struct GetTimeSeriesCrossParamsBuilder {
1050 base: String,
1052 quote: String,
1054 interval: String,
1056 base_type: Option<String>,
1058 base_exchange: Option<String>,
1060 base_mic_code: Option<String>,
1062 quote_type: Option<String>,
1064 quote_exchange: Option<String>,
1066 quote_mic_code: Option<String>,
1068 outputsize: Option<i64>,
1070 format: Option<String>,
1072 delimiter: Option<String>,
1074 prepost: Option<bool>,
1076 start_date: Option<String>,
1078 end_date: Option<String>,
1080 adjust: Option<bool>,
1082 dp: Option<i64>,
1084 timezone: Option<String>
1086}
1087
1088impl GetTimeSeriesCrossParamsBuilder {
1089 pub fn base(mut self, base: impl Into<String>) -> Self {
1091 self.base = base.into();
1092 self
1093 }
1094 pub fn quote(mut self, quote: impl Into<String>) -> Self {
1096 self.quote = quote.into();
1097 self
1098 }
1099 pub fn interval(mut self, interval: impl Into<String>) -> Self {
1101 self.interval = interval.into();
1102 self
1103 }
1104 pub fn base_type(mut self, base_type: impl Into<String>) -> Self {
1106 self.base_type = Some(base_type.into());
1107 self
1108 }
1109 pub fn base_exchange(mut self, base_exchange: impl Into<String>) -> Self {
1111 self.base_exchange = Some(base_exchange.into());
1112 self
1113 }
1114 pub fn base_mic_code(mut self, base_mic_code: impl Into<String>) -> Self {
1116 self.base_mic_code = Some(base_mic_code.into());
1117 self
1118 }
1119 pub fn quote_type(mut self, quote_type: impl Into<String>) -> Self {
1121 self.quote_type = Some(quote_type.into());
1122 self
1123 }
1124 pub fn quote_exchange(mut self, quote_exchange: impl Into<String>) -> Self {
1126 self.quote_exchange = Some(quote_exchange.into());
1127 self
1128 }
1129 pub fn quote_mic_code(mut self, quote_mic_code: impl Into<String>) -> Self {
1131 self.quote_mic_code = Some(quote_mic_code.into());
1132 self
1133 }
1134 pub fn outputsize(mut self, outputsize: i64) -> Self {
1136 self.outputsize = Some(outputsize);
1137 self
1138 }
1139 pub fn format(mut self, format: impl Into<String>) -> Self {
1141 self.format = Some(format.into());
1142 self
1143 }
1144 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1146 self.delimiter = Some(delimiter.into());
1147 self
1148 }
1149 pub fn prepost(mut self, prepost: bool) -> Self {
1151 self.prepost = Some(prepost);
1152 self
1153 }
1154 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1156 self.start_date = Some(start_date.into());
1157 self
1158 }
1159 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1161 self.end_date = Some(end_date.into());
1162 self
1163 }
1164 pub fn adjust(mut self, adjust: bool) -> Self {
1166 self.adjust = Some(adjust);
1167 self
1168 }
1169 pub fn dp(mut self, dp: i64) -> Self {
1171 self.dp = Some(dp);
1172 self
1173 }
1174 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
1176 self.timezone = Some(timezone.into());
1177 self
1178 }
1179
1180 pub fn build(self) -> GetTimeSeriesCrossParams {
1182 GetTimeSeriesCrossParams {
1183 base: self.base,
1184 quote: self.quote,
1185 interval: self.interval,
1186 base_type: self.base_type,
1187 base_exchange: self.base_exchange,
1188 base_mic_code: self.base_mic_code,
1189 quote_type: self.quote_type,
1190 quote_exchange: self.quote_exchange,
1191 quote_mic_code: self.quote_mic_code,
1192 outputsize: self.outputsize,
1193 format: self.format,
1194 delimiter: self.delimiter,
1195 prepost: self.prepost,
1196 start_date: self.start_date,
1197 end_date: self.end_date,
1198 adjust: self.adjust,
1199 dp: self.dp,
1200 timezone: self.timezone
1201 }
1202 }
1203}
1204
1205
1206#[derive(Debug, Clone, Serialize, Deserialize)]
1208#[serde(untagged)]
1209pub enum GetCurrencyConversionError {
1210 UnknownValue(serde_json::Value),
1211}
1212
1213#[derive(Debug, Clone, Serialize, Deserialize)]
1215#[serde(untagged)]
1216pub enum GetEodError {
1217 UnknownValue(serde_json::Value),
1218}
1219
1220#[derive(Debug, Clone, Serialize, Deserialize)]
1222#[serde(untagged)]
1223pub enum GetExchangeRateError {
1224 UnknownValue(serde_json::Value),
1225}
1226
1227#[derive(Debug, Clone, Serialize, Deserialize)]
1229#[serde(untagged)]
1230pub enum GetMarketMoversError {
1231 UnknownValue(serde_json::Value),
1232}
1233
1234#[derive(Debug, Clone, Serialize, Deserialize)]
1236#[serde(untagged)]
1237pub enum GetPriceError {
1238 UnknownValue(serde_json::Value),
1239}
1240
1241#[derive(Debug, Clone, Serialize, Deserialize)]
1243#[serde(untagged)]
1244pub enum GetQuoteError {
1245 UnknownValue(serde_json::Value),
1246}
1247
1248#[derive(Debug, Clone, Serialize, Deserialize)]
1250#[serde(untagged)]
1251pub enum GetTimeSeriesError {
1252 UnknownValue(serde_json::Value),
1253}
1254
1255#[derive(Debug, Clone, Serialize, Deserialize)]
1257#[serde(untagged)]
1258pub enum GetTimeSeriesCrossError {
1259 UnknownValue(serde_json::Value),
1260}
1261
1262
1263pub async fn get_currency_conversion(configuration: &configuration::Configuration, params: GetCurrencyConversionParams) -> Result<models::GetCurrencyConversion200Response, Error<GetCurrencyConversionError>> {
1265 let p_query_symbol = params.symbol;
1267 let p_query_amount = params.amount;
1268 let p_query_date = params.date;
1269 let p_query_format = params.format;
1270 let p_query_delimiter = params.delimiter;
1271 let p_query_dp = params.dp;
1272 let p_query_timezone = params.timezone;
1273
1274 let uri_str = format!("{}/currency_conversion", configuration.base_path);
1275 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1276
1277 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
1278 req_builder = req_builder.query(&[("amount", &p_query_amount.to_string())]);
1279 if let Some(ref param_value) = p_query_date {
1280 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1281 }
1282 if let Some(ref param_value) = p_query_format {
1283 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1284 }
1285 if let Some(ref param_value) = p_query_delimiter {
1286 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1287 }
1288 if let Some(ref param_value) = p_query_dp {
1289 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1290 }
1291 if let Some(ref param_value) = p_query_timezone {
1292 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1293 }
1294 if let Some(ref user_agent) = configuration.user_agent {
1295 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1296 }
1297 if let Some(ref apikey) = configuration.api_key {
1298 let key = apikey.key.clone();
1299 let value = match apikey.prefix {
1300 Some(ref prefix) => format!("{} {}", prefix, key),
1301 None => key,
1302 };
1303 req_builder = req_builder.header("Authorization", value);
1304 };
1305
1306 let req = req_builder.build()?;
1307 let resp = configuration.client.execute(req).await?;
1308
1309 let status = resp.status();
1310 let content_type = resp
1311 .headers()
1312 .get("content-type")
1313 .and_then(|v| v.to_str().ok())
1314 .unwrap_or("application/octet-stream");
1315 let content_type = super::ContentType::from(content_type);
1316
1317 if !status.is_client_error() && !status.is_server_error() {
1318 let content = resp.text().await?;
1319 match content_type {
1320 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1321 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCurrencyConversion200Response`"))),
1322 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::GetCurrencyConversion200Response`")))),
1323 }
1324 } else {
1325 let content = resp.text().await?;
1326 let entity: Option<GetCurrencyConversionError> = serde_json::from_str(&content).ok();
1327 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1328 }
1329}
1330
1331pub async fn get_eod(configuration: &configuration::Configuration, params: GetEodParams) -> Result<models::GetEod200Response, Error<GetEodError>> {
1333 let p_query_symbol = params.symbol;
1335 let p_query_figi = params.figi;
1336 let p_query_isin = params.isin;
1337 let p_query_cusip = params.cusip;
1338 let p_query_exchange = params.exchange;
1339 let p_query_mic_code = params.mic_code;
1340 let p_query_country = params.country;
1341 let p_query_type = params.r#type;
1342 let p_query_date = params.date;
1343 let p_query_prepost = params.prepost;
1344 let p_query_dp = params.dp;
1345
1346 let uri_str = format!("{}/eod", configuration.base_path);
1347 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1348
1349 if let Some(ref param_value) = p_query_symbol {
1350 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1351 }
1352 if let Some(ref param_value) = p_query_figi {
1353 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1354 }
1355 if let Some(ref param_value) = p_query_isin {
1356 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1357 }
1358 if let Some(ref param_value) = p_query_cusip {
1359 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1360 }
1361 if let Some(ref param_value) = p_query_exchange {
1362 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1363 }
1364 if let Some(ref param_value) = p_query_mic_code {
1365 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1366 }
1367 if let Some(ref param_value) = p_query_country {
1368 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1369 }
1370 if let Some(ref param_value) = p_query_type {
1371 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1372 }
1373 if let Some(ref param_value) = p_query_date {
1374 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1375 }
1376 if let Some(ref param_value) = p_query_prepost {
1377 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1378 }
1379 if let Some(ref param_value) = p_query_dp {
1380 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1381 }
1382 if let Some(ref user_agent) = configuration.user_agent {
1383 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1384 }
1385 if let Some(ref apikey) = configuration.api_key {
1386 let key = apikey.key.clone();
1387 let value = match apikey.prefix {
1388 Some(ref prefix) => format!("{} {}", prefix, key),
1389 None => key,
1390 };
1391 req_builder = req_builder.header("Authorization", value);
1392 };
1393
1394 let req = req_builder.build()?;
1395 let resp = configuration.client.execute(req).await?;
1396
1397 let status = resp.status();
1398 let content_type = resp
1399 .headers()
1400 .get("content-type")
1401 .and_then(|v| v.to_str().ok())
1402 .unwrap_or("application/octet-stream");
1403 let content_type = super::ContentType::from(content_type);
1404
1405 if !status.is_client_error() && !status.is_server_error() {
1406 let content = resp.text().await?;
1407 match content_type {
1408 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1409 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEod200Response`"))),
1410 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::GetEod200Response`")))),
1411 }
1412 } else {
1413 let content = resp.text().await?;
1414 let entity: Option<GetEodError> = serde_json::from_str(&content).ok();
1415 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1416 }
1417}
1418
1419pub async fn get_exchange_rate(configuration: &configuration::Configuration, params: GetExchangeRateParams) -> Result<models::GetExchangeRate200Response, Error<GetExchangeRateError>> {
1421 let p_query_symbol = params.symbol;
1423 let p_query_date = params.date;
1424 let p_query_format = params.format;
1425 let p_query_delimiter = params.delimiter;
1426 let p_query_dp = params.dp;
1427 let p_query_timezone = params.timezone;
1428
1429 let uri_str = format!("{}/exchange_rate", configuration.base_path);
1430 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1431
1432 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
1433 if let Some(ref param_value) = p_query_date {
1434 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1435 }
1436 if let Some(ref param_value) = p_query_format {
1437 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1438 }
1439 if let Some(ref param_value) = p_query_delimiter {
1440 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1441 }
1442 if let Some(ref param_value) = p_query_dp {
1443 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1444 }
1445 if let Some(ref param_value) = p_query_timezone {
1446 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1447 }
1448 if let Some(ref user_agent) = configuration.user_agent {
1449 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1450 }
1451 if let Some(ref apikey) = configuration.api_key {
1452 let key = apikey.key.clone();
1453 let value = match apikey.prefix {
1454 Some(ref prefix) => format!("{} {}", prefix, key),
1455 None => key,
1456 };
1457 req_builder = req_builder.header("Authorization", value);
1458 };
1459
1460 let req = req_builder.build()?;
1461 let resp = configuration.client.execute(req).await?;
1462
1463 let status = resp.status();
1464 let content_type = resp
1465 .headers()
1466 .get("content-type")
1467 .and_then(|v| v.to_str().ok())
1468 .unwrap_or("application/octet-stream");
1469 let content_type = super::ContentType::from(content_type);
1470
1471 if !status.is_client_error() && !status.is_server_error() {
1472 let content = resp.text().await?;
1473 match content_type {
1474 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1475 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchangeRate200Response`"))),
1476 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::GetExchangeRate200Response`")))),
1477 }
1478 } else {
1479 let content = resp.text().await?;
1480 let entity: Option<GetExchangeRateError> = serde_json::from_str(&content).ok();
1481 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1482 }
1483}
1484
1485pub async fn get_market_movers(configuration: &configuration::Configuration, params: GetMarketMoversParams) -> Result<models::MarketMoversResponseBody, Error<GetMarketMoversError>> {
1487 let p_path_market = params.market;
1489 let p_query_direction = params.direction;
1490 let p_query_outputsize = params.outputsize;
1491 let p_query_country = params.country;
1492 let p_query_price_greater_than = params.price_greater_than;
1493 let p_query_dp = params.dp;
1494
1495 let uri_str = format!("{}/market_movers/{market}", configuration.base_path, market=crate::apis::urlencode(p_path_market));
1496 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1497
1498 if let Some(ref param_value) = p_query_direction {
1499 req_builder = req_builder.query(&[("direction", &serde_json::to_string(param_value)?)]);
1500 }
1501 if let Some(ref param_value) = p_query_outputsize {
1502 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1503 }
1504 if let Some(ref param_value) = p_query_country {
1505 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1506 }
1507 if let Some(ref param_value) = p_query_price_greater_than {
1508 req_builder = req_builder.query(&[("price_greater_than", ¶m_value.to_string())]);
1509 }
1510 if let Some(ref param_value) = p_query_dp {
1511 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1512 }
1513 if let Some(ref user_agent) = configuration.user_agent {
1514 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1515 }
1516 if let Some(ref apikey) = configuration.api_key {
1517 let key = apikey.key.clone();
1518 let value = match apikey.prefix {
1519 Some(ref prefix) => format!("{} {}", prefix, key),
1520 None => key,
1521 };
1522 req_builder = req_builder.header("Authorization", value);
1523 };
1524
1525 let req = req_builder.build()?;
1526 let resp = configuration.client.execute(req).await?;
1527
1528 let status = resp.status();
1529 let content_type = resp
1530 .headers()
1531 .get("content-type")
1532 .and_then(|v| v.to_str().ok())
1533 .unwrap_or("application/octet-stream");
1534 let content_type = super::ContentType::from(content_type);
1535
1536 if !status.is_client_error() && !status.is_server_error() {
1537 let content = resp.text().await?;
1538 match content_type {
1539 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1540 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MarketMoversResponseBody`"))),
1541 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::MarketMoversResponseBody`")))),
1542 }
1543 } else {
1544 let content = resp.text().await?;
1545 let entity: Option<GetMarketMoversError> = serde_json::from_str(&content).ok();
1546 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1547 }
1548}
1549
1550pub async fn get_price(configuration: &configuration::Configuration, params: GetPriceParams) -> Result<models::GetPrice200Response, Error<GetPriceError>> {
1552 let p_query_symbol = params.symbol;
1554 let p_query_figi = params.figi;
1555 let p_query_isin = params.isin;
1556 let p_query_cusip = params.cusip;
1557 let p_query_exchange = params.exchange;
1558 let p_query_mic_code = params.mic_code;
1559 let p_query_country = params.country;
1560 let p_query_type = params.r#type;
1561 let p_query_format = params.format;
1562 let p_query_delimiter = params.delimiter;
1563 let p_query_prepost = params.prepost;
1564 let p_query_dp = params.dp;
1565
1566 let uri_str = format!("{}/price", configuration.base_path);
1567 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1568
1569 if let Some(ref param_value) = p_query_symbol {
1570 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1571 }
1572 if let Some(ref param_value) = p_query_figi {
1573 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1574 }
1575 if let Some(ref param_value) = p_query_isin {
1576 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1577 }
1578 if let Some(ref param_value) = p_query_cusip {
1579 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1580 }
1581 if let Some(ref param_value) = p_query_exchange {
1582 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1583 }
1584 if let Some(ref param_value) = p_query_mic_code {
1585 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1586 }
1587 if let Some(ref param_value) = p_query_country {
1588 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1589 }
1590 if let Some(ref param_value) = p_query_type {
1591 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1592 }
1593 if let Some(ref param_value) = p_query_format {
1594 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1595 }
1596 if let Some(ref param_value) = p_query_delimiter {
1597 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1598 }
1599 if let Some(ref param_value) = p_query_prepost {
1600 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1601 }
1602 if let Some(ref param_value) = p_query_dp {
1603 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1604 }
1605 if let Some(ref user_agent) = configuration.user_agent {
1606 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1607 }
1608 if let Some(ref apikey) = configuration.api_key {
1609 let key = apikey.key.clone();
1610 let value = match apikey.prefix {
1611 Some(ref prefix) => format!("{} {}", prefix, key),
1612 None => key,
1613 };
1614 req_builder = req_builder.header("Authorization", value);
1615 };
1616
1617 let req = req_builder.build()?;
1618 let resp = configuration.client.execute(req).await?;
1619
1620 let status = resp.status();
1621 let content_type = resp
1622 .headers()
1623 .get("content-type")
1624 .and_then(|v| v.to_str().ok())
1625 .unwrap_or("application/octet-stream");
1626 let content_type = super::ContentType::from(content_type);
1627
1628 if !status.is_client_error() && !status.is_server_error() {
1629 let content = resp.text().await?;
1630 match content_type {
1631 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1632 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPrice200Response`"))),
1633 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::GetPrice200Response`")))),
1634 }
1635 } else {
1636 let content = resp.text().await?;
1637 let entity: Option<GetPriceError> = serde_json::from_str(&content).ok();
1638 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1639 }
1640}
1641
1642pub async fn get_quote(configuration: &configuration::Configuration, params: GetQuoteParams) -> Result<models::GetQuote200Response, Error<GetQuoteError>> {
1644 let p_query_symbol = params.symbol;
1646 let p_query_figi = params.figi;
1647 let p_query_isin = params.isin;
1648 let p_query_cusip = params.cusip;
1649 let p_query_interval = params.interval;
1650 let p_query_exchange = params.exchange;
1651 let p_query_mic_code = params.mic_code;
1652 let p_query_country = params.country;
1653 let p_query_volume_time_period = params.volume_time_period;
1654 let p_query_type = params.r#type;
1655 let p_query_format = params.format;
1656 let p_query_delimiter = params.delimiter;
1657 let p_query_prepost = params.prepost;
1658 let p_query_eod = params.eod;
1659 let p_query_rolling_period = params.rolling_period;
1660 let p_query_dp = params.dp;
1661 let p_query_timezone = params.timezone;
1662
1663 let uri_str = format!("{}/quote", configuration.base_path);
1664 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1665
1666 if let Some(ref param_value) = p_query_symbol {
1667 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1668 }
1669 if let Some(ref param_value) = p_query_figi {
1670 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1671 }
1672 if let Some(ref param_value) = p_query_isin {
1673 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1674 }
1675 if let Some(ref param_value) = p_query_cusip {
1676 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1677 }
1678 if let Some(ref param_value) = p_query_interval {
1679 req_builder = req_builder.query(&[("interval", &serde_json::to_string(param_value)?)]);
1680 }
1681 if let Some(ref param_value) = p_query_exchange {
1682 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1683 }
1684 if let Some(ref param_value) = p_query_mic_code {
1685 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1686 }
1687 if let Some(ref param_value) = p_query_country {
1688 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1689 }
1690 if let Some(ref param_value) = p_query_volume_time_period {
1691 req_builder = req_builder.query(&[("volume_time_period", ¶m_value.to_string())]);
1692 }
1693 if let Some(ref param_value) = p_query_type {
1694 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1695 }
1696 if let Some(ref param_value) = p_query_format {
1697 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1698 }
1699 if let Some(ref param_value) = p_query_delimiter {
1700 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1701 }
1702 if let Some(ref param_value) = p_query_prepost {
1703 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1704 }
1705 if let Some(ref param_value) = p_query_eod {
1706 req_builder = req_builder.query(&[("eod", ¶m_value.to_string())]);
1707 }
1708 if let Some(ref param_value) = p_query_rolling_period {
1709 req_builder = req_builder.query(&[("rolling_period", ¶m_value.to_string())]);
1710 }
1711 if let Some(ref param_value) = p_query_dp {
1712 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1713 }
1714 if let Some(ref param_value) = p_query_timezone {
1715 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1716 }
1717 if let Some(ref user_agent) = configuration.user_agent {
1718 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1719 }
1720 if let Some(ref apikey) = configuration.api_key {
1721 let key = apikey.key.clone();
1722 let value = match apikey.prefix {
1723 Some(ref prefix) => format!("{} {}", prefix, key),
1724 None => key,
1725 };
1726 req_builder = req_builder.header("Authorization", value);
1727 };
1728
1729 let req = req_builder.build()?;
1730 let resp = configuration.client.execute(req).await?;
1731
1732 let status = resp.status();
1733 let content_type = resp
1734 .headers()
1735 .get("content-type")
1736 .and_then(|v| v.to_str().ok())
1737 .unwrap_or("application/octet-stream");
1738 let content_type = super::ContentType::from(content_type);
1739
1740 if !status.is_client_error() && !status.is_server_error() {
1741 let content = resp.text().await?;
1742 match content_type {
1743 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1744 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuote200Response`"))),
1745 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::GetQuote200Response`")))),
1746 }
1747 } else {
1748 let content = resp.text().await?;
1749 let entity: Option<GetQuoteError> = serde_json::from_str(&content).ok();
1750 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1751 }
1752}
1753
1754pub async fn get_time_series(configuration: &configuration::Configuration, params: GetTimeSeriesParams) -> Result<models::GetTimeSeries200Response, Error<GetTimeSeriesError>> {
1756 let p_query_interval = params.interval;
1758 let p_query_symbol = params.symbol;
1759 let p_query_isin = params.isin;
1760 let p_query_figi = params.figi;
1761 let p_query_cusip = params.cusip;
1762 let p_query_outputsize = params.outputsize;
1763 let p_query_exchange = params.exchange;
1764 let p_query_mic_code = params.mic_code;
1765 let p_query_country = params.country;
1766 let p_query_type = params.r#type;
1767 let p_query_timezone = params.timezone;
1768 let p_query_start_date = params.start_date;
1769 let p_query_end_date = params.end_date;
1770 let p_query_date = params.date;
1771 let p_query_order = params.order;
1772 let p_query_prepost = params.prepost;
1773 let p_query_format = params.format;
1774 let p_query_delimiter = params.delimiter;
1775 let p_query_dp = params.dp;
1776 let p_query_previous_close = params.previous_close;
1777 let p_query_adjust = params.adjust;
1778
1779 let uri_str = format!("{}/time_series", configuration.base_path);
1780 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1781
1782 if let Some(ref param_value) = p_query_symbol {
1783 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1784 }
1785 if let Some(ref param_value) = p_query_isin {
1786 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1787 }
1788 if let Some(ref param_value) = p_query_figi {
1789 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1790 }
1791 if let Some(ref param_value) = p_query_cusip {
1792 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1793 }
1794 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
1795 if let Some(ref param_value) = p_query_outputsize {
1796 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1797 }
1798 if let Some(ref param_value) = p_query_exchange {
1799 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1800 }
1801 if let Some(ref param_value) = p_query_mic_code {
1802 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1803 }
1804 if let Some(ref param_value) = p_query_country {
1805 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1806 }
1807 if let Some(ref param_value) = p_query_type {
1808 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1809 }
1810 if let Some(ref param_value) = p_query_timezone {
1811 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1812 }
1813 if let Some(ref param_value) = p_query_start_date {
1814 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
1815 }
1816 if let Some(ref param_value) = p_query_end_date {
1817 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
1818 }
1819 if let Some(ref param_value) = p_query_date {
1820 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1821 }
1822 if let Some(ref param_value) = p_query_order {
1823 req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1824 }
1825 if let Some(ref param_value) = p_query_prepost {
1826 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1827 }
1828 if let Some(ref param_value) = p_query_format {
1829 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1830 }
1831 if let Some(ref param_value) = p_query_delimiter {
1832 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1833 }
1834 if let Some(ref param_value) = p_query_dp {
1835 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1836 }
1837 if let Some(ref param_value) = p_query_previous_close {
1838 req_builder = req_builder.query(&[("previous_close", ¶m_value.to_string())]);
1839 }
1840 if let Some(ref param_value) = p_query_adjust {
1841 req_builder = req_builder.query(&[("adjust", &serde_json::to_string(param_value)?)]);
1842 }
1843 if let Some(ref user_agent) = configuration.user_agent {
1844 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1845 }
1846 if let Some(ref apikey) = configuration.api_key {
1847 let key = apikey.key.clone();
1848 let value = match apikey.prefix {
1849 Some(ref prefix) => format!("{} {}", prefix, key),
1850 None => key,
1851 };
1852 req_builder = req_builder.header("Authorization", value);
1853 };
1854
1855 let req = req_builder.build()?;
1856 let resp = configuration.client.execute(req).await?;
1857
1858 let status = resp.status();
1859 let content_type = resp
1860 .headers()
1861 .get("content-type")
1862 .and_then(|v| v.to_str().ok())
1863 .unwrap_or("application/octet-stream");
1864 let content_type = super::ContentType::from(content_type);
1865
1866 if !status.is_client_error() && !status.is_server_error() {
1867 let content = resp.text().await?;
1868 match content_type {
1869 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1870 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTimeSeries200Response`"))),
1871 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::GetTimeSeries200Response`")))),
1872 }
1873 } else {
1874 let content = resp.text().await?;
1875 let entity: Option<GetTimeSeriesError> = serde_json::from_str(&content).ok();
1876 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1877 }
1878}
1879
1880pub async fn get_time_series_cross(configuration: &configuration::Configuration, params: GetTimeSeriesCrossParams) -> Result<models::GetTimeSeriesCross200Response, Error<GetTimeSeriesCrossError>> {
1882 let p_query_base = params.base;
1884 let p_query_quote = params.quote;
1885 let p_query_interval = params.interval;
1886 let p_query_base_type = params.base_type;
1887 let p_query_base_exchange = params.base_exchange;
1888 let p_query_base_mic_code = params.base_mic_code;
1889 let p_query_quote_type = params.quote_type;
1890 let p_query_quote_exchange = params.quote_exchange;
1891 let p_query_quote_mic_code = params.quote_mic_code;
1892 let p_query_outputsize = params.outputsize;
1893 let p_query_format = params.format;
1894 let p_query_delimiter = params.delimiter;
1895 let p_query_prepost = params.prepost;
1896 let p_query_start_date = params.start_date;
1897 let p_query_end_date = params.end_date;
1898 let p_query_adjust = params.adjust;
1899 let p_query_dp = params.dp;
1900 let p_query_timezone = params.timezone;
1901
1902 let uri_str = format!("{}/time_series/cross", configuration.base_path);
1903 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1904
1905 req_builder = req_builder.query(&[("base", &p_query_base.to_string())]);
1906 if let Some(ref param_value) = p_query_base_type {
1907 req_builder = req_builder.query(&[("base_type", ¶m_value.to_string())]);
1908 }
1909 if let Some(ref param_value) = p_query_base_exchange {
1910 req_builder = req_builder.query(&[("base_exchange", ¶m_value.to_string())]);
1911 }
1912 if let Some(ref param_value) = p_query_base_mic_code {
1913 req_builder = req_builder.query(&[("base_mic_code", ¶m_value.to_string())]);
1914 }
1915 req_builder = req_builder.query(&[("quote", &p_query_quote.to_string())]);
1916 if let Some(ref param_value) = p_query_quote_type {
1917 req_builder = req_builder.query(&[("quote_type", ¶m_value.to_string())]);
1918 }
1919 if let Some(ref param_value) = p_query_quote_exchange {
1920 req_builder = req_builder.query(&[("quote_exchange", ¶m_value.to_string())]);
1921 }
1922 if let Some(ref param_value) = p_query_quote_mic_code {
1923 req_builder = req_builder.query(&[("quote_mic_code", ¶m_value.to_string())]);
1924 }
1925 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
1926 if let Some(ref param_value) = p_query_outputsize {
1927 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1928 }
1929 if let Some(ref param_value) = p_query_format {
1930 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1931 }
1932 if let Some(ref param_value) = p_query_delimiter {
1933 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1934 }
1935 if let Some(ref param_value) = p_query_prepost {
1936 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1937 }
1938 if let Some(ref param_value) = p_query_start_date {
1939 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
1940 }
1941 if let Some(ref param_value) = p_query_end_date {
1942 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
1943 }
1944 if let Some(ref param_value) = p_query_adjust {
1945 req_builder = req_builder.query(&[("adjust", ¶m_value.to_string())]);
1946 }
1947 if let Some(ref param_value) = p_query_dp {
1948 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1949 }
1950 if let Some(ref param_value) = p_query_timezone {
1951 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1952 }
1953 if let Some(ref user_agent) = configuration.user_agent {
1954 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1955 }
1956 if let Some(ref apikey) = configuration.api_key {
1957 let key = apikey.key.clone();
1958 let value = match apikey.prefix {
1959 Some(ref prefix) => format!("{} {}", prefix, key),
1960 None => key,
1961 };
1962 req_builder = req_builder.header("Authorization", value);
1963 };
1964
1965 let req = req_builder.build()?;
1966 let resp = configuration.client.execute(req).await?;
1967
1968 let status = resp.status();
1969 let content_type = resp
1970 .headers()
1971 .get("content-type")
1972 .and_then(|v| v.to_str().ok())
1973 .unwrap_or("application/octet-stream");
1974 let content_type = super::ContentType::from(content_type);
1975
1976 if !status.is_client_error() && !status.is_server_error() {
1977 let content = resp.text().await?;
1978 match content_type {
1979 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1980 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTimeSeriesCross200Response`"))),
1981 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::GetTimeSeriesCross200Response`")))),
1982 }
1983 } else {
1984 let content = resp.text().await?;
1985 let entity: Option<GetTimeSeriesCrossError> = serde_json::from_str(&content).ok();
1986 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1987 }
1988}
1989