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)]
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
67 self
68 }
69 pub fn amount(mut self, amount: f64) -> Self {
71
72 self.amount = amount;
73
74 self
75 }
76 pub fn date(mut self, date: impl Into<String>) -> Self {
78 self.date = Some(date.into());
79
80 self
81 }
82 pub fn format(mut self, format: impl Into<String>) -> Self {
84 self.format = Some(format.into());
85
86 self
87 }
88 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
90 self.delimiter = Some(delimiter.into());
91
92 self
93 }
94 pub fn dp(mut self, dp: i64) -> Self {
96
97 self.dp = Some(dp);
98
99 self
100 }
101 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
103 self.timezone = Some(timezone.into());
104
105 self
106 }
107
108 pub fn build(self) -> GetCurrencyConversionParams {
110 GetCurrencyConversionParams {
111 symbol: self.symbol,
112 amount: self.amount,
113 date: self.date,
114 format: self.format,
115 delimiter: self.delimiter,
116 dp: self.dp,
117 timezone: self.timezone
118 }
119 }
120}
121
122#[derive(Clone, Debug, Default)]
124pub struct GetEodParams {
125 pub symbol: Option<String>,
127 pub figi: Option<String>,
129 pub isin: Option<String>,
131 pub cusip: Option<String>,
133 pub exchange: Option<String>,
135 pub mic_code: Option<String>,
137 pub country: Option<String>,
139 pub r#type: Option<String>,
141 pub date: Option<String>,
143 pub prepost: Option<bool>,
145 pub dp: Option<i64>
147}
148
149impl GetEodParams {
150 pub fn builder() -> GetEodParamsBuilder {
152 GetEodParamsBuilder::default()
153 }
154}
155
156#[derive(Clone, Debug, Default)]
158pub struct GetEodParamsBuilder {
159 symbol: Option<String>,
161 figi: Option<String>,
163 isin: Option<String>,
165 cusip: Option<String>,
167 exchange: Option<String>,
169 mic_code: Option<String>,
171 country: Option<String>,
173 r#type: Option<String>,
175 date: Option<String>,
177 prepost: Option<bool>,
179 dp: Option<i64>
181}
182
183impl GetEodParamsBuilder {
184 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
186 self.symbol = Some(symbol.into());
187
188 self
189 }
190 pub fn figi(mut self, figi: impl Into<String>) -> Self {
192 self.figi = Some(figi.into());
193
194 self
195 }
196 pub fn isin(mut self, isin: impl Into<String>) -> Self {
198 self.isin = Some(isin.into());
199
200 self
201 }
202 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
204 self.cusip = Some(cusip.into());
205
206 self
207 }
208 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
210 self.exchange = Some(exchange.into());
211
212 self
213 }
214 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
216 self.mic_code = Some(mic_code.into());
217
218 self
219 }
220 pub fn country(mut self, country: impl Into<String>) -> Self {
222 self.country = Some(country.into());
223
224 self
225 }
226 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
228 self.r#type = Some(r#type.into());
229
230 self
231 }
232 pub fn date(mut self, date: impl Into<String>) -> Self {
234 self.date = Some(date.into());
235
236 self
237 }
238 pub fn prepost(mut self, prepost: bool) -> Self {
240
241 self.prepost = Some(prepost);
242
243 self
244 }
245 pub fn dp(mut self, dp: i64) -> Self {
247
248 self.dp = Some(dp);
249
250 self
251 }
252
253 pub fn build(self) -> GetEodParams {
255 GetEodParams {
256 symbol: self.symbol,
257 figi: self.figi,
258 isin: self.isin,
259 cusip: self.cusip,
260 exchange: self.exchange,
261 mic_code: self.mic_code,
262 country: self.country,
263 r#type: self.r#type,
264 date: self.date,
265 prepost: self.prepost,
266 dp: self.dp
267 }
268 }
269}
270
271#[derive(Clone, Debug, Default)]
273pub struct GetExchangeRateParams {
274 pub symbol: String,
276 pub date: Option<String>,
278 pub format: Option<String>,
280 pub delimiter: Option<String>,
282 pub dp: Option<i64>,
284 pub timezone: Option<String>
286}
287
288impl GetExchangeRateParams {
289 pub fn builder() -> GetExchangeRateParamsBuilder {
291 GetExchangeRateParamsBuilder::default()
292 }
293}
294
295#[derive(Clone, Debug, Default)]
297pub struct GetExchangeRateParamsBuilder {
298 symbol: String,
300 date: Option<String>,
302 format: Option<String>,
304 delimiter: Option<String>,
306 dp: Option<i64>,
308 timezone: Option<String>
310}
311
312impl GetExchangeRateParamsBuilder {
313 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
315 self.symbol = symbol.into();
316
317 self
318 }
319 pub fn date(mut self, date: impl Into<String>) -> Self {
321 self.date = Some(date.into());
322
323 self
324 }
325 pub fn format(mut self, format: impl Into<String>) -> Self {
327 self.format = Some(format.into());
328
329 self
330 }
331 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
333 self.delimiter = Some(delimiter.into());
334
335 self
336 }
337 pub fn dp(mut self, dp: i64) -> Self {
339
340 self.dp = Some(dp);
341
342 self
343 }
344 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
346 self.timezone = Some(timezone.into());
347
348 self
349 }
350
351 pub fn build(self) -> GetExchangeRateParams {
353 GetExchangeRateParams {
354 symbol: self.symbol,
355 date: self.date,
356 format: self.format,
357 delimiter: self.delimiter,
358 dp: self.dp,
359 timezone: self.timezone
360 }
361 }
362}
363
364#[derive(Clone, Debug, Default)]
366pub struct GetMarketMoversParams {
367 pub market: String,
369 pub direction: Option<String>,
371 pub outputsize: Option<i64>,
373 pub country: Option<String>,
375 pub price_greater_than: Option<String>,
377 pub dp: Option<String>
379}
380
381impl GetMarketMoversParams {
382 pub fn builder() -> GetMarketMoversParamsBuilder {
384 GetMarketMoversParamsBuilder::default()
385 }
386}
387
388#[derive(Clone, Debug, Default)]
390pub struct GetMarketMoversParamsBuilder {
391 market: String,
393 direction: Option<String>,
395 outputsize: Option<i64>,
397 country: Option<String>,
399 price_greater_than: Option<String>,
401 dp: Option<String>
403}
404
405impl GetMarketMoversParamsBuilder {
406 pub fn market(mut self, market: impl Into<String>) -> Self {
408 self.market = market.into();
409
410 self
411 }
412 pub fn direction(mut self, direction: impl Into<String>) -> Self {
414 self.direction = Some(direction.into());
415
416 self
417 }
418 pub fn outputsize(mut self, outputsize: i64) -> Self {
420
421 self.outputsize = Some(outputsize);
422
423 self
424 }
425 pub fn country(mut self, country: impl Into<String>) -> Self {
427 self.country = Some(country.into());
428
429 self
430 }
431 pub fn price_greater_than(mut self, price_greater_than: impl Into<String>) -> Self {
433 self.price_greater_than = Some(price_greater_than.into());
434
435 self
436 }
437 pub fn dp(mut self, dp: impl Into<String>) -> Self {
439 self.dp = Some(dp.into());
440
441 self
442 }
443
444 pub fn build(self) -> GetMarketMoversParams {
446 GetMarketMoversParams {
447 market: self.market,
448 direction: self.direction,
449 outputsize: self.outputsize,
450 country: self.country,
451 price_greater_than: self.price_greater_than,
452 dp: self.dp
453 }
454 }
455}
456
457#[derive(Clone, Debug, Default)]
459pub struct GetPriceParams {
460 pub symbol: Option<String>,
462 pub figi: Option<String>,
464 pub isin: Option<String>,
466 pub cusip: Option<String>,
468 pub exchange: Option<String>,
470 pub mic_code: Option<String>,
472 pub country: Option<String>,
474 pub r#type: Option<String>,
476 pub format: Option<String>,
478 pub delimiter: Option<String>,
480 pub prepost: Option<bool>,
482 pub dp: Option<i64>
484}
485
486impl GetPriceParams {
487 pub fn builder() -> GetPriceParamsBuilder {
489 GetPriceParamsBuilder::default()
490 }
491}
492
493#[derive(Clone, Debug, Default)]
495pub struct GetPriceParamsBuilder {
496 symbol: Option<String>,
498 figi: Option<String>,
500 isin: Option<String>,
502 cusip: Option<String>,
504 exchange: Option<String>,
506 mic_code: Option<String>,
508 country: Option<String>,
510 r#type: Option<String>,
512 format: Option<String>,
514 delimiter: Option<String>,
516 prepost: Option<bool>,
518 dp: Option<i64>
520}
521
522impl GetPriceParamsBuilder {
523 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
525 self.symbol = Some(symbol.into());
526
527 self
528 }
529 pub fn figi(mut self, figi: impl Into<String>) -> Self {
531 self.figi = Some(figi.into());
532
533 self
534 }
535 pub fn isin(mut self, isin: impl Into<String>) -> Self {
537 self.isin = Some(isin.into());
538
539 self
540 }
541 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
543 self.cusip = Some(cusip.into());
544
545 self
546 }
547 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
549 self.exchange = Some(exchange.into());
550
551 self
552 }
553 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
555 self.mic_code = Some(mic_code.into());
556
557 self
558 }
559 pub fn country(mut self, country: impl Into<String>) -> Self {
561 self.country = Some(country.into());
562
563 self
564 }
565 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
567 self.r#type = Some(r#type.into());
568
569 self
570 }
571 pub fn format(mut self, format: impl Into<String>) -> Self {
573 self.format = Some(format.into());
574
575 self
576 }
577 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
579 self.delimiter = Some(delimiter.into());
580
581 self
582 }
583 pub fn prepost(mut self, prepost: bool) -> Self {
585
586 self.prepost = Some(prepost);
587
588 self
589 }
590 pub fn dp(mut self, dp: i64) -> Self {
592
593 self.dp = Some(dp);
594
595 self
596 }
597
598 pub fn build(self) -> GetPriceParams {
600 GetPriceParams {
601 symbol: self.symbol,
602 figi: self.figi,
603 isin: self.isin,
604 cusip: self.cusip,
605 exchange: self.exchange,
606 mic_code: self.mic_code,
607 country: self.country,
608 r#type: self.r#type,
609 format: self.format,
610 delimiter: self.delimiter,
611 prepost: self.prepost,
612 dp: self.dp
613 }
614 }
615}
616
617#[derive(Clone, Debug, Default)]
619pub struct GetQuoteParams {
620 pub symbol: Option<String>,
622 pub figi: Option<String>,
624 pub isin: Option<String>,
626 pub cusip: Option<String>,
628 pub interval: Option<String>,
630 pub exchange: Option<String>,
632 pub mic_code: Option<String>,
634 pub country: Option<String>,
636 pub volume_time_period: Option<i64>,
638 pub r#type: Option<String>,
640 pub format: Option<String>,
642 pub delimiter: Option<String>,
644 pub prepost: Option<bool>,
646 pub eod: Option<bool>,
648 pub rolling_period: Option<i64>,
650 pub dp: Option<i64>,
652 pub timezone: Option<String>
654}
655
656impl GetQuoteParams {
657 pub fn builder() -> GetQuoteParamsBuilder {
659 GetQuoteParamsBuilder::default()
660 }
661}
662
663#[derive(Clone, Debug, Default)]
665pub struct GetQuoteParamsBuilder {
666 symbol: Option<String>,
668 figi: Option<String>,
670 isin: Option<String>,
672 cusip: Option<String>,
674 interval: Option<String>,
676 exchange: Option<String>,
678 mic_code: Option<String>,
680 country: Option<String>,
682 volume_time_period: Option<i64>,
684 r#type: Option<String>,
686 format: Option<String>,
688 delimiter: Option<String>,
690 prepost: Option<bool>,
692 eod: Option<bool>,
694 rolling_period: Option<i64>,
696 dp: Option<i64>,
698 timezone: Option<String>
700}
701
702impl GetQuoteParamsBuilder {
703 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
705 self.symbol = Some(symbol.into());
706
707 self
708 }
709 pub fn figi(mut self, figi: impl Into<String>) -> Self {
711 self.figi = Some(figi.into());
712
713 self
714 }
715 pub fn isin(mut self, isin: impl Into<String>) -> Self {
717 self.isin = Some(isin.into());
718
719 self
720 }
721 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
723 self.cusip = Some(cusip.into());
724
725 self
726 }
727 pub fn interval(mut self, interval: impl Into<String>) -> Self {
729 self.interval = Some(interval.into());
730
731 self
732 }
733 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
735 self.exchange = Some(exchange.into());
736
737 self
738 }
739 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
741 self.mic_code = Some(mic_code.into());
742
743 self
744 }
745 pub fn country(mut self, country: impl Into<String>) -> Self {
747 self.country = Some(country.into());
748
749 self
750 }
751 pub fn volume_time_period(mut self, volume_time_period: i64) -> Self {
753
754 self.volume_time_period = Some(volume_time_period);
755
756 self
757 }
758 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
760 self.r#type = Some(r#type.into());
761
762 self
763 }
764 pub fn format(mut self, format: impl Into<String>) -> Self {
766 self.format = Some(format.into());
767
768 self
769 }
770 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
772 self.delimiter = Some(delimiter.into());
773
774 self
775 }
776 pub fn prepost(mut self, prepost: bool) -> Self {
778
779 self.prepost = Some(prepost);
780
781 self
782 }
783 pub fn eod(mut self, eod: bool) -> Self {
785
786 self.eod = Some(eod);
787
788 self
789 }
790 pub fn rolling_period(mut self, rolling_period: i64) -> Self {
792
793 self.rolling_period = Some(rolling_period);
794
795 self
796 }
797 pub fn dp(mut self, dp: i64) -> Self {
799
800 self.dp = Some(dp);
801
802 self
803 }
804 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
806 self.timezone = Some(timezone.into());
807
808 self
809 }
810
811 pub fn build(self) -> GetQuoteParams {
813 GetQuoteParams {
814 symbol: self.symbol,
815 figi: self.figi,
816 isin: self.isin,
817 cusip: self.cusip,
818 interval: self.interval,
819 exchange: self.exchange,
820 mic_code: self.mic_code,
821 country: self.country,
822 volume_time_period: self.volume_time_period,
823 r#type: self.r#type,
824 format: self.format,
825 delimiter: self.delimiter,
826 prepost: self.prepost,
827 eod: self.eod,
828 rolling_period: self.rolling_period,
829 dp: self.dp,
830 timezone: self.timezone
831 }
832 }
833}
834
835#[derive(Clone, Debug, Default)]
837pub struct GetTimeSeriesParams {
838 pub interval: String,
840 pub symbol: Option<String>,
842 pub isin: Option<String>,
844 pub figi: Option<String>,
846 pub cusip: Option<String>,
848 pub outputsize: Option<i64>,
850 pub exchange: Option<String>,
852 pub mic_code: Option<String>,
854 pub country: Option<String>,
856 pub r#type: Option<String>,
858 pub timezone: Option<String>,
860 pub start_date: Option<String>,
862 pub end_date: Option<String>,
864 pub date: Option<String>,
866 pub order: Option<String>,
868 pub prepost: Option<bool>,
870 pub format: Option<String>,
872 pub delimiter: Option<String>,
874 pub dp: Option<i64>,
876 pub previous_close: Option<bool>,
878 pub adjust: Option<String>
880}
881
882impl GetTimeSeriesParams {
883 pub fn builder() -> GetTimeSeriesParamsBuilder {
885 GetTimeSeriesParamsBuilder::default()
886 }
887}
888
889#[derive(Clone, Debug, Default)]
891pub struct GetTimeSeriesParamsBuilder {
892 interval: String,
894 symbol: Option<String>,
896 isin: Option<String>,
898 figi: Option<String>,
900 cusip: Option<String>,
902 outputsize: Option<i64>,
904 exchange: Option<String>,
906 mic_code: Option<String>,
908 country: Option<String>,
910 r#type: Option<String>,
912 timezone: Option<String>,
914 start_date: Option<String>,
916 end_date: Option<String>,
918 date: Option<String>,
920 order: Option<String>,
922 prepost: Option<bool>,
924 format: Option<String>,
926 delimiter: Option<String>,
928 dp: Option<i64>,
930 previous_close: Option<bool>,
932 adjust: Option<String>
934}
935
936impl GetTimeSeriesParamsBuilder {
937 pub fn interval(mut self, interval: impl Into<String>) -> Self {
939 self.interval = interval.into();
940
941 self
942 }
943 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
945 self.symbol = Some(symbol.into());
946
947 self
948 }
949 pub fn isin(mut self, isin: impl Into<String>) -> Self {
951 self.isin = Some(isin.into());
952
953 self
954 }
955 pub fn figi(mut self, figi: impl Into<String>) -> Self {
957 self.figi = Some(figi.into());
958
959 self
960 }
961 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
963 self.cusip = Some(cusip.into());
964
965 self
966 }
967 pub fn outputsize(mut self, outputsize: i64) -> Self {
969
970 self.outputsize = Some(outputsize);
971
972 self
973 }
974 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
976 self.exchange = Some(exchange.into());
977
978 self
979 }
980 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
982 self.mic_code = Some(mic_code.into());
983
984 self
985 }
986 pub fn country(mut self, country: impl Into<String>) -> Self {
988 self.country = Some(country.into());
989
990 self
991 }
992 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
994 self.r#type = Some(r#type.into());
995
996 self
997 }
998 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
1000 self.timezone = Some(timezone.into());
1001
1002 self
1003 }
1004 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1006 self.start_date = Some(start_date.into());
1007
1008 self
1009 }
1010 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1012 self.end_date = Some(end_date.into());
1013
1014 self
1015 }
1016 pub fn date(mut self, date: impl Into<String>) -> Self {
1018 self.date = Some(date.into());
1019
1020 self
1021 }
1022 pub fn order(mut self, order: impl Into<String>) -> Self {
1024 self.order = Some(order.into());
1025
1026 self
1027 }
1028 pub fn prepost(mut self, prepost: bool) -> Self {
1030
1031 self.prepost = Some(prepost);
1032
1033 self
1034 }
1035 pub fn format(mut self, format: impl Into<String>) -> Self {
1037 self.format = Some(format.into());
1038
1039 self
1040 }
1041 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1043 self.delimiter = Some(delimiter.into());
1044
1045 self
1046 }
1047 pub fn dp(mut self, dp: i64) -> Self {
1049
1050 self.dp = Some(dp);
1051
1052 self
1053 }
1054 pub fn previous_close(mut self, previous_close: bool) -> Self {
1056
1057 self.previous_close = Some(previous_close);
1058
1059 self
1060 }
1061 pub fn adjust(mut self, adjust: impl Into<String>) -> Self {
1063 self.adjust = Some(adjust.into());
1064
1065 self
1066 }
1067
1068 pub fn build(self) -> GetTimeSeriesParams {
1070 GetTimeSeriesParams {
1071 interval: self.interval,
1072 symbol: self.symbol,
1073 isin: self.isin,
1074 figi: self.figi,
1075 cusip: self.cusip,
1076 outputsize: self.outputsize,
1077 exchange: self.exchange,
1078 mic_code: self.mic_code,
1079 country: self.country,
1080 r#type: self.r#type,
1081 timezone: self.timezone,
1082 start_date: self.start_date,
1083 end_date: self.end_date,
1084 date: self.date,
1085 order: self.order,
1086 prepost: self.prepost,
1087 format: self.format,
1088 delimiter: self.delimiter,
1089 dp: self.dp,
1090 previous_close: self.previous_close,
1091 adjust: self.adjust
1092 }
1093 }
1094}
1095
1096#[derive(Clone, Debug, Default)]
1098pub struct GetTimeSeriesCrossParams {
1099 pub base: String,
1101 pub quote: String,
1103 pub interval: String,
1105 pub base_type: Option<String>,
1107 pub base_exchange: Option<String>,
1109 pub base_mic_code: Option<String>,
1111 pub quote_type: Option<String>,
1113 pub quote_exchange: Option<String>,
1115 pub quote_mic_code: Option<String>,
1117 pub outputsize: Option<i64>,
1119 pub format: Option<String>,
1121 pub delimiter: Option<String>,
1123 pub prepost: Option<bool>,
1125 pub start_date: Option<String>,
1127 pub end_date: Option<String>,
1129 pub adjust: Option<bool>,
1131 pub dp: Option<i64>,
1133 pub timezone: Option<String>
1135}
1136
1137impl GetTimeSeriesCrossParams {
1138 pub fn builder() -> GetTimeSeriesCrossParamsBuilder {
1140 GetTimeSeriesCrossParamsBuilder::default()
1141 }
1142}
1143
1144#[derive(Clone, Debug, Default)]
1146pub struct GetTimeSeriesCrossParamsBuilder {
1147 base: String,
1149 quote: String,
1151 interval: String,
1153 base_type: Option<String>,
1155 base_exchange: Option<String>,
1157 base_mic_code: Option<String>,
1159 quote_type: Option<String>,
1161 quote_exchange: Option<String>,
1163 quote_mic_code: Option<String>,
1165 outputsize: Option<i64>,
1167 format: Option<String>,
1169 delimiter: Option<String>,
1171 prepost: Option<bool>,
1173 start_date: Option<String>,
1175 end_date: Option<String>,
1177 adjust: Option<bool>,
1179 dp: Option<i64>,
1181 timezone: Option<String>
1183}
1184
1185impl GetTimeSeriesCrossParamsBuilder {
1186 pub fn base(mut self, base: impl Into<String>) -> Self {
1188 self.base = base.into();
1189
1190 self
1191 }
1192 pub fn quote(mut self, quote: impl Into<String>) -> Self {
1194 self.quote = quote.into();
1195
1196 self
1197 }
1198 pub fn interval(mut self, interval: impl Into<String>) -> Self {
1200 self.interval = interval.into();
1201
1202 self
1203 }
1204 pub fn base_type(mut self, base_type: impl Into<String>) -> Self {
1206 self.base_type = Some(base_type.into());
1207
1208 self
1209 }
1210 pub fn base_exchange(mut self, base_exchange: impl Into<String>) -> Self {
1212 self.base_exchange = Some(base_exchange.into());
1213
1214 self
1215 }
1216 pub fn base_mic_code(mut self, base_mic_code: impl Into<String>) -> Self {
1218 self.base_mic_code = Some(base_mic_code.into());
1219
1220 self
1221 }
1222 pub fn quote_type(mut self, quote_type: impl Into<String>) -> Self {
1224 self.quote_type = Some(quote_type.into());
1225
1226 self
1227 }
1228 pub fn quote_exchange(mut self, quote_exchange: impl Into<String>) -> Self {
1230 self.quote_exchange = Some(quote_exchange.into());
1231
1232 self
1233 }
1234 pub fn quote_mic_code(mut self, quote_mic_code: impl Into<String>) -> Self {
1236 self.quote_mic_code = Some(quote_mic_code.into());
1237
1238 self
1239 }
1240 pub fn outputsize(mut self, outputsize: i64) -> Self {
1242
1243 self.outputsize = Some(outputsize);
1244
1245 self
1246 }
1247 pub fn format(mut self, format: impl Into<String>) -> Self {
1249 self.format = Some(format.into());
1250
1251 self
1252 }
1253 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1255 self.delimiter = Some(delimiter.into());
1256
1257 self
1258 }
1259 pub fn prepost(mut self, prepost: bool) -> Self {
1261
1262 self.prepost = Some(prepost);
1263
1264 self
1265 }
1266 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1268 self.start_date = Some(start_date.into());
1269
1270 self
1271 }
1272 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1274 self.end_date = Some(end_date.into());
1275
1276 self
1277 }
1278 pub fn adjust(mut self, adjust: bool) -> Self {
1280
1281 self.adjust = Some(adjust);
1282
1283 self
1284 }
1285 pub fn dp(mut self, dp: i64) -> Self {
1287
1288 self.dp = Some(dp);
1289
1290 self
1291 }
1292 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
1294 self.timezone = Some(timezone.into());
1295
1296 self
1297 }
1298
1299 pub fn build(self) -> GetTimeSeriesCrossParams {
1301 GetTimeSeriesCrossParams {
1302 base: self.base,
1303 quote: self.quote,
1304 interval: self.interval,
1305 base_type: self.base_type,
1306 base_exchange: self.base_exchange,
1307 base_mic_code: self.base_mic_code,
1308 quote_type: self.quote_type,
1309 quote_exchange: self.quote_exchange,
1310 quote_mic_code: self.quote_mic_code,
1311 outputsize: self.outputsize,
1312 format: self.format,
1313 delimiter: self.delimiter,
1314 prepost: self.prepost,
1315 start_date: self.start_date,
1316 end_date: self.end_date,
1317 adjust: self.adjust,
1318 dp: self.dp,
1319 timezone: self.timezone
1320 }
1321 }
1322}
1323
1324
1325#[derive(Debug, Clone, Serialize, Deserialize)]
1327#[serde(untagged)]
1328pub enum GetCurrencyConversionError {
1329 UnknownValue(serde_json::Value),
1330}
1331
1332#[derive(Debug, Clone, Serialize, Deserialize)]
1334#[serde(untagged)]
1335pub enum GetEodError {
1336 UnknownValue(serde_json::Value),
1337}
1338
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1341#[serde(untagged)]
1342pub enum GetExchangeRateError {
1343 UnknownValue(serde_json::Value),
1344}
1345
1346#[derive(Debug, Clone, Serialize, Deserialize)]
1348#[serde(untagged)]
1349pub enum GetMarketMoversError {
1350 UnknownValue(serde_json::Value),
1351}
1352
1353#[derive(Debug, Clone, Serialize, Deserialize)]
1355#[serde(untagged)]
1356pub enum GetPriceError {
1357 UnknownValue(serde_json::Value),
1358}
1359
1360#[derive(Debug, Clone, Serialize, Deserialize)]
1362#[serde(untagged)]
1363pub enum GetQuoteError {
1364 UnknownValue(serde_json::Value),
1365}
1366
1367#[derive(Debug, Clone, Serialize, Deserialize)]
1369#[serde(untagged)]
1370pub enum GetTimeSeriesError {
1371 UnknownValue(serde_json::Value),
1372}
1373
1374#[derive(Debug, Clone, Serialize, Deserialize)]
1376#[serde(untagged)]
1377pub enum GetTimeSeriesCrossError {
1378 UnknownValue(serde_json::Value),
1379}
1380
1381
1382pub async fn get_currency_conversion(configuration: &configuration::Configuration, params: GetCurrencyConversionParams) -> Result<models::GetCurrencyConversion200Response, Error<GetCurrencyConversionError>> {
1384 let p_query_symbol = params.symbol;
1386 let p_query_amount = params.amount;
1387 let p_query_date = params.date;
1388 let p_query_format = params.format;
1389 let p_query_delimiter = params.delimiter;
1390 let p_query_dp = params.dp;
1391 let p_query_timezone = params.timezone;
1392
1393 let uri_str = format!("{}/currency_conversion", configuration.base_path);
1394 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1395
1396 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
1397 req_builder = req_builder.query(&[("amount", &p_query_amount.to_string())]);
1398 if let Some(ref param_value) = p_query_date {
1399 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1400 }
1401 if let Some(ref param_value) = p_query_format {
1402 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1403 }
1404 if let Some(ref param_value) = p_query_delimiter {
1405 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1406 }
1407 if let Some(ref param_value) = p_query_dp {
1408 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1409 }
1410 if let Some(ref param_value) = p_query_timezone {
1411 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1412 }
1413 if let Some(ref user_agent) = configuration.user_agent {
1414 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1415 }
1416 if let Some(ref apikey) = configuration.api_key {
1417 let key = apikey.key.clone();
1418 let value = match apikey.prefix {
1419 Some(ref prefix) => format!("{} {}", prefix, key),
1420 None => key,
1421 };
1422 req_builder = req_builder.header("Authorization", value);
1423 };
1424
1425 let req = req_builder.build()?;
1426 let resp = configuration.client.execute(req).await?;
1427
1428 let status = resp.status();
1429 let content_type = resp
1430 .headers()
1431 .get("content-type")
1432 .and_then(|v| v.to_str().ok())
1433 .unwrap_or("application/octet-stream");
1434 let content_type = super::ContentType::from(content_type);
1435
1436 if !status.is_client_error() && !status.is_server_error() {
1437 let content = resp.text().await?;
1438 match content_type {
1439 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1440 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCurrencyConversion200Response`"))),
1441 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`")))),
1442 }
1443 } else {
1444 let content = resp.text().await?;
1445 let entity: Option<GetCurrencyConversionError> = serde_json::from_str(&content).ok();
1446 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1447 }
1448}
1449
1450pub async fn get_eod(configuration: &configuration::Configuration, params: GetEodParams) -> Result<models::GetEod200Response, Error<GetEodError>> {
1452 let p_query_symbol = params.symbol;
1454 let p_query_figi = params.figi;
1455 let p_query_isin = params.isin;
1456 let p_query_cusip = params.cusip;
1457 let p_query_exchange = params.exchange;
1458 let p_query_mic_code = params.mic_code;
1459 let p_query_country = params.country;
1460 let p_query_type = params.r#type;
1461 let p_query_date = params.date;
1462 let p_query_prepost = params.prepost;
1463 let p_query_dp = params.dp;
1464
1465 let uri_str = format!("{}/eod", configuration.base_path);
1466 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1467
1468 if let Some(ref param_value) = p_query_symbol {
1469 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1470 }
1471 if let Some(ref param_value) = p_query_figi {
1472 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1473 }
1474 if let Some(ref param_value) = p_query_isin {
1475 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1476 }
1477 if let Some(ref param_value) = p_query_cusip {
1478 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1479 }
1480 if let Some(ref param_value) = p_query_exchange {
1481 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1482 }
1483 if let Some(ref param_value) = p_query_mic_code {
1484 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1485 }
1486 if let Some(ref param_value) = p_query_country {
1487 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1488 }
1489 if let Some(ref param_value) = p_query_type {
1490 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1491 }
1492 if let Some(ref param_value) = p_query_date {
1493 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1494 }
1495 if let Some(ref param_value) = p_query_prepost {
1496 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1497 }
1498 if let Some(ref param_value) = p_query_dp {
1499 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1500 }
1501 if let Some(ref user_agent) = configuration.user_agent {
1502 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1503 }
1504 if let Some(ref apikey) = configuration.api_key {
1505 let key = apikey.key.clone();
1506 let value = match apikey.prefix {
1507 Some(ref prefix) => format!("{} {}", prefix, key),
1508 None => key,
1509 };
1510 req_builder = req_builder.header("Authorization", value);
1511 };
1512
1513 let req = req_builder.build()?;
1514 let resp = configuration.client.execute(req).await?;
1515
1516 let status = resp.status();
1517 let content_type = resp
1518 .headers()
1519 .get("content-type")
1520 .and_then(|v| v.to_str().ok())
1521 .unwrap_or("application/octet-stream");
1522 let content_type = super::ContentType::from(content_type);
1523
1524 if !status.is_client_error() && !status.is_server_error() {
1525 let content = resp.text().await?;
1526 match content_type {
1527 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1528 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEod200Response`"))),
1529 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`")))),
1530 }
1531 } else {
1532 let content = resp.text().await?;
1533 let entity: Option<GetEodError> = serde_json::from_str(&content).ok();
1534 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1535 }
1536}
1537
1538pub async fn get_exchange_rate(configuration: &configuration::Configuration, params: GetExchangeRateParams) -> Result<models::GetExchangeRate200Response, Error<GetExchangeRateError>> {
1540 let p_query_symbol = params.symbol;
1542 let p_query_date = params.date;
1543 let p_query_format = params.format;
1544 let p_query_delimiter = params.delimiter;
1545 let p_query_dp = params.dp;
1546 let p_query_timezone = params.timezone;
1547
1548 let uri_str = format!("{}/exchange_rate", configuration.base_path);
1549 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1550
1551 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
1552 if let Some(ref param_value) = p_query_date {
1553 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1554 }
1555 if let Some(ref param_value) = p_query_format {
1556 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1557 }
1558 if let Some(ref param_value) = p_query_delimiter {
1559 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1560 }
1561 if let Some(ref param_value) = p_query_dp {
1562 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1563 }
1564 if let Some(ref param_value) = p_query_timezone {
1565 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1566 }
1567 if let Some(ref user_agent) = configuration.user_agent {
1568 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1569 }
1570 if let Some(ref apikey) = configuration.api_key {
1571 let key = apikey.key.clone();
1572 let value = match apikey.prefix {
1573 Some(ref prefix) => format!("{} {}", prefix, key),
1574 None => key,
1575 };
1576 req_builder = req_builder.header("Authorization", value);
1577 };
1578
1579 let req = req_builder.build()?;
1580 let resp = configuration.client.execute(req).await?;
1581
1582 let status = resp.status();
1583 let content_type = resp
1584 .headers()
1585 .get("content-type")
1586 .and_then(|v| v.to_str().ok())
1587 .unwrap_or("application/octet-stream");
1588 let content_type = super::ContentType::from(content_type);
1589
1590 if !status.is_client_error() && !status.is_server_error() {
1591 let content = resp.text().await?;
1592 match content_type {
1593 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1594 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchangeRate200Response`"))),
1595 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`")))),
1596 }
1597 } else {
1598 let content = resp.text().await?;
1599 let entity: Option<GetExchangeRateError> = serde_json::from_str(&content).ok();
1600 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1601 }
1602}
1603
1604pub async fn get_market_movers(configuration: &configuration::Configuration, params: GetMarketMoversParams) -> Result<models::MarketMoversResponseBody, Error<GetMarketMoversError>> {
1606 let p_path_market = params.market;
1608 let p_query_direction = params.direction;
1609 let p_query_outputsize = params.outputsize;
1610 let p_query_country = params.country;
1611 let p_query_price_greater_than = params.price_greater_than;
1612 let p_query_dp = params.dp;
1613
1614 let uri_str = format!("{}/market_movers/{market}", configuration.base_path, market=crate::apis::urlencode(p_path_market));
1615 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1616
1617 if let Some(ref param_value) = p_query_direction {
1618 req_builder = req_builder.query(&[("direction", &serde_json::to_string(param_value)?)]);
1619 }
1620 if let Some(ref param_value) = p_query_outputsize {
1621 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1622 }
1623 if let Some(ref param_value) = p_query_country {
1624 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1625 }
1626 if let Some(ref param_value) = p_query_price_greater_than {
1627 req_builder = req_builder.query(&[("price_greater_than", ¶m_value.to_string())]);
1628 }
1629 if let Some(ref param_value) = p_query_dp {
1630 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1631 }
1632 if let Some(ref user_agent) = configuration.user_agent {
1633 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1634 }
1635 if let Some(ref apikey) = configuration.api_key {
1636 let key = apikey.key.clone();
1637 let value = match apikey.prefix {
1638 Some(ref prefix) => format!("{} {}", prefix, key),
1639 None => key,
1640 };
1641 req_builder = req_builder.header("Authorization", value);
1642 };
1643
1644 let req = req_builder.build()?;
1645 let resp = configuration.client.execute(req).await?;
1646
1647 let status = resp.status();
1648 let content_type = resp
1649 .headers()
1650 .get("content-type")
1651 .and_then(|v| v.to_str().ok())
1652 .unwrap_or("application/octet-stream");
1653 let content_type = super::ContentType::from(content_type);
1654
1655 if !status.is_client_error() && !status.is_server_error() {
1656 let content = resp.text().await?;
1657 match content_type {
1658 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1659 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MarketMoversResponseBody`"))),
1660 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`")))),
1661 }
1662 } else {
1663 let content = resp.text().await?;
1664 let entity: Option<GetMarketMoversError> = serde_json::from_str(&content).ok();
1665 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1666 }
1667}
1668
1669pub async fn get_price(configuration: &configuration::Configuration, params: GetPriceParams) -> Result<models::GetPrice200Response, Error<GetPriceError>> {
1671 let p_query_symbol = params.symbol;
1673 let p_query_figi = params.figi;
1674 let p_query_isin = params.isin;
1675 let p_query_cusip = params.cusip;
1676 let p_query_exchange = params.exchange;
1677 let p_query_mic_code = params.mic_code;
1678 let p_query_country = params.country;
1679 let p_query_type = params.r#type;
1680 let p_query_format = params.format;
1681 let p_query_delimiter = params.delimiter;
1682 let p_query_prepost = params.prepost;
1683 let p_query_dp = params.dp;
1684
1685 let uri_str = format!("{}/price", configuration.base_path);
1686 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1687
1688 if let Some(ref param_value) = p_query_symbol {
1689 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1690 }
1691 if let Some(ref param_value) = p_query_figi {
1692 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1693 }
1694 if let Some(ref param_value) = p_query_isin {
1695 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1696 }
1697 if let Some(ref param_value) = p_query_cusip {
1698 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1699 }
1700 if let Some(ref param_value) = p_query_exchange {
1701 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1702 }
1703 if let Some(ref param_value) = p_query_mic_code {
1704 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1705 }
1706 if let Some(ref param_value) = p_query_country {
1707 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1708 }
1709 if let Some(ref param_value) = p_query_type {
1710 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1711 }
1712 if let Some(ref param_value) = p_query_format {
1713 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1714 }
1715 if let Some(ref param_value) = p_query_delimiter {
1716 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1717 }
1718 if let Some(ref param_value) = p_query_prepost {
1719 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1720 }
1721 if let Some(ref param_value) = p_query_dp {
1722 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1723 }
1724 if let Some(ref user_agent) = configuration.user_agent {
1725 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1726 }
1727 if let Some(ref apikey) = configuration.api_key {
1728 let key = apikey.key.clone();
1729 let value = match apikey.prefix {
1730 Some(ref prefix) => format!("{} {}", prefix, key),
1731 None => key,
1732 };
1733 req_builder = req_builder.header("Authorization", value);
1734 };
1735
1736 let req = req_builder.build()?;
1737 let resp = configuration.client.execute(req).await?;
1738
1739 let status = resp.status();
1740 let content_type = resp
1741 .headers()
1742 .get("content-type")
1743 .and_then(|v| v.to_str().ok())
1744 .unwrap_or("application/octet-stream");
1745 let content_type = super::ContentType::from(content_type);
1746
1747 if !status.is_client_error() && !status.is_server_error() {
1748 let content = resp.text().await?;
1749 match content_type {
1750 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1751 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPrice200Response`"))),
1752 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`")))),
1753 }
1754 } else {
1755 let content = resp.text().await?;
1756 let entity: Option<GetPriceError> = serde_json::from_str(&content).ok();
1757 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1758 }
1759}
1760
1761pub async fn get_quote(configuration: &configuration::Configuration, params: GetQuoteParams) -> Result<models::GetQuote200Response, Error<GetQuoteError>> {
1763 let p_query_symbol = params.symbol;
1765 let p_query_figi = params.figi;
1766 let p_query_isin = params.isin;
1767 let p_query_cusip = params.cusip;
1768 let p_query_interval = params.interval;
1769 let p_query_exchange = params.exchange;
1770 let p_query_mic_code = params.mic_code;
1771 let p_query_country = params.country;
1772 let p_query_volume_time_period = params.volume_time_period;
1773 let p_query_type = params.r#type;
1774 let p_query_format = params.format;
1775 let p_query_delimiter = params.delimiter;
1776 let p_query_prepost = params.prepost;
1777 let p_query_eod = params.eod;
1778 let p_query_rolling_period = params.rolling_period;
1779 let p_query_dp = params.dp;
1780 let p_query_timezone = params.timezone;
1781
1782 let uri_str = format!("{}/quote", configuration.base_path);
1783 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1784
1785 if let Some(ref param_value) = p_query_symbol {
1786 req_builder = req_builder.query(&[("symbol", ¶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_isin {
1792 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1793 }
1794 if let Some(ref param_value) = p_query_cusip {
1795 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1796 }
1797 if let Some(ref param_value) = p_query_interval {
1798 req_builder = req_builder.query(&[("interval", &serde_json::to_string(param_value)?)]);
1799 }
1800 if let Some(ref param_value) = p_query_exchange {
1801 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1802 }
1803 if let Some(ref param_value) = p_query_mic_code {
1804 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1805 }
1806 if let Some(ref param_value) = p_query_country {
1807 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1808 }
1809 if let Some(ref param_value) = p_query_volume_time_period {
1810 req_builder = req_builder.query(&[("volume_time_period", ¶m_value.to_string())]);
1811 }
1812 if let Some(ref param_value) = p_query_type {
1813 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1814 }
1815 if let Some(ref param_value) = p_query_format {
1816 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1817 }
1818 if let Some(ref param_value) = p_query_delimiter {
1819 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1820 }
1821 if let Some(ref param_value) = p_query_prepost {
1822 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1823 }
1824 if let Some(ref param_value) = p_query_eod {
1825 req_builder = req_builder.query(&[("eod", ¶m_value.to_string())]);
1826 }
1827 if let Some(ref param_value) = p_query_rolling_period {
1828 req_builder = req_builder.query(&[("rolling_period", ¶m_value.to_string())]);
1829 }
1830 if let Some(ref param_value) = p_query_dp {
1831 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1832 }
1833 if let Some(ref param_value) = p_query_timezone {
1834 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1835 }
1836 if let Some(ref user_agent) = configuration.user_agent {
1837 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1838 }
1839 if let Some(ref apikey) = configuration.api_key {
1840 let key = apikey.key.clone();
1841 let value = match apikey.prefix {
1842 Some(ref prefix) => format!("{} {}", prefix, key),
1843 None => key,
1844 };
1845 req_builder = req_builder.header("Authorization", value);
1846 };
1847
1848 let req = req_builder.build()?;
1849 let resp = configuration.client.execute(req).await?;
1850
1851 let status = resp.status();
1852 let content_type = resp
1853 .headers()
1854 .get("content-type")
1855 .and_then(|v| v.to_str().ok())
1856 .unwrap_or("application/octet-stream");
1857 let content_type = super::ContentType::from(content_type);
1858
1859 if !status.is_client_error() && !status.is_server_error() {
1860 let content = resp.text().await?;
1861 match content_type {
1862 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1863 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuote200Response`"))),
1864 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`")))),
1865 }
1866 } else {
1867 let content = resp.text().await?;
1868 let entity: Option<GetQuoteError> = serde_json::from_str(&content).ok();
1869 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1870 }
1871}
1872
1873pub async fn get_time_series(configuration: &configuration::Configuration, params: GetTimeSeriesParams) -> Result<models::GetTimeSeries200Response, Error<GetTimeSeriesError>> {
1875 let p_query_interval = params.interval;
1877 let p_query_symbol = params.symbol;
1878 let p_query_isin = params.isin;
1879 let p_query_figi = params.figi;
1880 let p_query_cusip = params.cusip;
1881 let p_query_outputsize = params.outputsize;
1882 let p_query_exchange = params.exchange;
1883 let p_query_mic_code = params.mic_code;
1884 let p_query_country = params.country;
1885 let p_query_type = params.r#type;
1886 let p_query_timezone = params.timezone;
1887 let p_query_start_date = params.start_date;
1888 let p_query_end_date = params.end_date;
1889 let p_query_date = params.date;
1890 let p_query_order = params.order;
1891 let p_query_prepost = params.prepost;
1892 let p_query_format = params.format;
1893 let p_query_delimiter = params.delimiter;
1894 let p_query_dp = params.dp;
1895 let p_query_previous_close = params.previous_close;
1896 let p_query_adjust = params.adjust;
1897
1898 let uri_str = format!("{}/time_series", configuration.base_path);
1899 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1900
1901 if let Some(ref param_value) = p_query_symbol {
1902 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1903 }
1904 if let Some(ref param_value) = p_query_isin {
1905 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1906 }
1907 if let Some(ref param_value) = p_query_figi {
1908 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1909 }
1910 if let Some(ref param_value) = p_query_cusip {
1911 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1912 }
1913 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
1914 if let Some(ref param_value) = p_query_outputsize {
1915 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1916 }
1917 if let Some(ref param_value) = p_query_exchange {
1918 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1919 }
1920 if let Some(ref param_value) = p_query_mic_code {
1921 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1922 }
1923 if let Some(ref param_value) = p_query_country {
1924 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1925 }
1926 if let Some(ref param_value) = p_query_type {
1927 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
1928 }
1929 if let Some(ref param_value) = p_query_timezone {
1930 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1931 }
1932 if let Some(ref param_value) = p_query_start_date {
1933 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
1934 }
1935 if let Some(ref param_value) = p_query_end_date {
1936 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
1937 }
1938 if let Some(ref param_value) = p_query_date {
1939 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1940 }
1941 if let Some(ref param_value) = p_query_order {
1942 req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1943 }
1944 if let Some(ref param_value) = p_query_prepost {
1945 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1946 }
1947 if let Some(ref param_value) = p_query_format {
1948 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1949 }
1950 if let Some(ref param_value) = p_query_delimiter {
1951 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1952 }
1953 if let Some(ref param_value) = p_query_dp {
1954 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1955 }
1956 if let Some(ref param_value) = p_query_previous_close {
1957 req_builder = req_builder.query(&[("previous_close", ¶m_value.to_string())]);
1958 }
1959 if let Some(ref param_value) = p_query_adjust {
1960 req_builder = req_builder.query(&[("adjust", &serde_json::to_string(param_value)?)]);
1961 }
1962 if let Some(ref user_agent) = configuration.user_agent {
1963 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1964 }
1965 if let Some(ref apikey) = configuration.api_key {
1966 let key = apikey.key.clone();
1967 let value = match apikey.prefix {
1968 Some(ref prefix) => format!("{} {}", prefix, key),
1969 None => key,
1970 };
1971 req_builder = req_builder.header("Authorization", value);
1972 };
1973
1974 let req = req_builder.build()?;
1975 let resp = configuration.client.execute(req).await?;
1976
1977 let status = resp.status();
1978 let content_type = resp
1979 .headers()
1980 .get("content-type")
1981 .and_then(|v| v.to_str().ok())
1982 .unwrap_or("application/octet-stream");
1983 let content_type = super::ContentType::from(content_type);
1984
1985 if !status.is_client_error() && !status.is_server_error() {
1986 let content = resp.text().await?;
1987 match content_type {
1988 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1989 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTimeSeries200Response`"))),
1990 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`")))),
1991 }
1992 } else {
1993 let content = resp.text().await?;
1994 let entity: Option<GetTimeSeriesError> = serde_json::from_str(&content).ok();
1995 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1996 }
1997}
1998
1999pub async fn get_time_series_cross(configuration: &configuration::Configuration, params: GetTimeSeriesCrossParams) -> Result<models::GetTimeSeriesCross200Response, Error<GetTimeSeriesCrossError>> {
2001 let p_query_base = params.base;
2003 let p_query_quote = params.quote;
2004 let p_query_interval = params.interval;
2005 let p_query_base_type = params.base_type;
2006 let p_query_base_exchange = params.base_exchange;
2007 let p_query_base_mic_code = params.base_mic_code;
2008 let p_query_quote_type = params.quote_type;
2009 let p_query_quote_exchange = params.quote_exchange;
2010 let p_query_quote_mic_code = params.quote_mic_code;
2011 let p_query_outputsize = params.outputsize;
2012 let p_query_format = params.format;
2013 let p_query_delimiter = params.delimiter;
2014 let p_query_prepost = params.prepost;
2015 let p_query_start_date = params.start_date;
2016 let p_query_end_date = params.end_date;
2017 let p_query_adjust = params.adjust;
2018 let p_query_dp = params.dp;
2019 let p_query_timezone = params.timezone;
2020
2021 let uri_str = format!("{}/time_series/cross", configuration.base_path);
2022 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2023
2024 req_builder = req_builder.query(&[("base", &p_query_base.to_string())]);
2025 if let Some(ref param_value) = p_query_base_type {
2026 req_builder = req_builder.query(&[("base_type", ¶m_value.to_string())]);
2027 }
2028 if let Some(ref param_value) = p_query_base_exchange {
2029 req_builder = req_builder.query(&[("base_exchange", ¶m_value.to_string())]);
2030 }
2031 if let Some(ref param_value) = p_query_base_mic_code {
2032 req_builder = req_builder.query(&[("base_mic_code", ¶m_value.to_string())]);
2033 }
2034 req_builder = req_builder.query(&[("quote", &p_query_quote.to_string())]);
2035 if let Some(ref param_value) = p_query_quote_type {
2036 req_builder = req_builder.query(&[("quote_type", ¶m_value.to_string())]);
2037 }
2038 if let Some(ref param_value) = p_query_quote_exchange {
2039 req_builder = req_builder.query(&[("quote_exchange", ¶m_value.to_string())]);
2040 }
2041 if let Some(ref param_value) = p_query_quote_mic_code {
2042 req_builder = req_builder.query(&[("quote_mic_code", ¶m_value.to_string())]);
2043 }
2044 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
2045 if let Some(ref param_value) = p_query_outputsize {
2046 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2047 }
2048 if let Some(ref param_value) = p_query_format {
2049 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2050 }
2051 if let Some(ref param_value) = p_query_delimiter {
2052 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2053 }
2054 if let Some(ref param_value) = p_query_prepost {
2055 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
2056 }
2057 if let Some(ref param_value) = p_query_start_date {
2058 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
2059 }
2060 if let Some(ref param_value) = p_query_end_date {
2061 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
2062 }
2063 if let Some(ref param_value) = p_query_adjust {
2064 req_builder = req_builder.query(&[("adjust", ¶m_value.to_string())]);
2065 }
2066 if let Some(ref param_value) = p_query_dp {
2067 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
2068 }
2069 if let Some(ref param_value) = p_query_timezone {
2070 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
2071 }
2072 if let Some(ref user_agent) = configuration.user_agent {
2073 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2074 }
2075 if let Some(ref apikey) = configuration.api_key {
2076 let key = apikey.key.clone();
2077 let value = match apikey.prefix {
2078 Some(ref prefix) => format!("{} {}", prefix, key),
2079 None => key,
2080 };
2081 req_builder = req_builder.header("Authorization", value);
2082 };
2083
2084 let req = req_builder.build()?;
2085 let resp = configuration.client.execute(req).await?;
2086
2087 let status = resp.status();
2088 let content_type = resp
2089 .headers()
2090 .get("content-type")
2091 .and_then(|v| v.to_str().ok())
2092 .unwrap_or("application/octet-stream");
2093 let content_type = super::ContentType::from(content_type);
2094
2095 if !status.is_client_error() && !status.is_server_error() {
2096 let content = resp.text().await?;
2097 match content_type {
2098 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2099 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTimeSeriesCross200Response`"))),
2100 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`")))),
2101 }
2102 } else {
2103 let content = resp.text().await?;
2104 let entity: Option<GetTimeSeriesCrossError> = serde_json::from_str(&content).ok();
2105 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2106 }
2107}
2108