1use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16#[derive(Clone, Debug, Default, Serialize, Deserialize)]
18pub struct GetCurrencyConversionParams {
19 pub symbol: String,
21 pub amount: f64,
23 pub date: Option<String>,
25 pub format: Option<String>,
27 pub delimiter: Option<String>,
29 pub dp: Option<i64>,
31 pub timezone: Option<String>,
33}
34
35impl GetCurrencyConversionParams {
36 pub fn builder() -> GetCurrencyConversionParamsBuilder {
38 GetCurrencyConversionParamsBuilder::default()
39 }
40}
41
42#[derive(Clone, Debug, Default)]
44pub struct GetCurrencyConversionParamsBuilder {
45 symbol: String,
47 amount: f64,
49 date: Option<String>,
51 format: Option<String>,
53 delimiter: Option<String>,
55 dp: Option<i64>,
57 timezone: Option<String>,
59}
60
61impl GetCurrencyConversionParamsBuilder {
62 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
64 self.symbol = symbol.into();
65 self
66 }
67 pub fn amount(mut self, amount: f64) -> Self {
69 self.amount = amount;
70 self
71 }
72 pub fn date(mut self, date: impl Into<String>) -> Self {
74 self.date = Some(date.into());
75 self
76 }
77 pub fn format(mut self, format: impl Into<String>) -> Self {
79 self.format = Some(format.into());
80 self
81 }
82 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
84 self.delimiter = Some(delimiter.into());
85 self
86 }
87 pub fn dp(mut self, dp: i64) -> Self {
89 self.dp = Some(dp);
90 self
91 }
92 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
94 self.timezone = Some(timezone.into());
95 self
96 }
97
98 pub fn build(self) -> GetCurrencyConversionParams {
100 GetCurrencyConversionParams {
101 symbol: self.symbol,
102 amount: self.amount,
103 date: self.date,
104 format: self.format,
105 delimiter: self.delimiter,
106 dp: self.dp,
107 timezone: self.timezone,
108 }
109 }
110}
111
112#[derive(Clone, Debug, Default, Serialize, Deserialize)]
114pub struct GetEodParams {
115 pub symbol: Option<String>,
117 pub figi: Option<String>,
119 pub isin: Option<String>,
121 pub cusip: Option<String>,
123 pub exchange: Option<String>,
125 pub mic_code: Option<String>,
127 pub country: Option<String>,
129 pub r#type: Option<String>,
131 pub date: Option<String>,
133 pub prepost: Option<bool>,
135 pub dp: Option<i64>,
137}
138
139impl GetEodParams {
140 pub fn builder() -> GetEodParamsBuilder {
142 GetEodParamsBuilder::default()
143 }
144}
145
146#[derive(Clone, Debug, Default)]
148pub struct GetEodParamsBuilder {
149 symbol: Option<String>,
151 figi: Option<String>,
153 isin: Option<String>,
155 cusip: Option<String>,
157 exchange: Option<String>,
159 mic_code: Option<String>,
161 country: Option<String>,
163 r#type: Option<String>,
165 date: Option<String>,
167 prepost: Option<bool>,
169 dp: Option<i64>,
171}
172
173impl GetEodParamsBuilder {
174 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
176 self.symbol = Some(symbol.into());
177 self
178 }
179 pub fn figi(mut self, figi: impl Into<String>) -> Self {
181 self.figi = Some(figi.into());
182 self
183 }
184 pub fn isin(mut self, isin: impl Into<String>) -> Self {
186 self.isin = Some(isin.into());
187 self
188 }
189 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
191 self.cusip = Some(cusip.into());
192 self
193 }
194 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
196 self.exchange = Some(exchange.into());
197 self
198 }
199 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
201 self.mic_code = Some(mic_code.into());
202 self
203 }
204 pub fn country(mut self, country: impl Into<String>) -> Self {
206 self.country = Some(country.into());
207 self
208 }
209 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
211 self.r#type = Some(r#type.into());
212 self
213 }
214 pub fn date(mut self, date: impl Into<String>) -> Self {
216 self.date = Some(date.into());
217 self
218 }
219 pub fn prepost(mut self, prepost: bool) -> Self {
221 self.prepost = Some(prepost);
222 self
223 }
224 pub fn dp(mut self, dp: i64) -> Self {
226 self.dp = Some(dp);
227 self
228 }
229
230 pub fn build(self) -> GetEodParams {
232 GetEodParams {
233 symbol: self.symbol,
234 figi: self.figi,
235 isin: self.isin,
236 cusip: self.cusip,
237 exchange: self.exchange,
238 mic_code: self.mic_code,
239 country: self.country,
240 r#type: self.r#type,
241 date: self.date,
242 prepost: self.prepost,
243 dp: self.dp,
244 }
245 }
246}
247
248#[derive(Clone, Debug, Default, Serialize, Deserialize)]
250pub struct GetExchangeRateParams {
251 pub symbol: String,
253 pub date: Option<String>,
255 pub format: Option<String>,
257 pub delimiter: Option<String>,
259 pub dp: Option<i64>,
261 pub timezone: Option<String>,
263}
264
265impl GetExchangeRateParams {
266 pub fn builder() -> GetExchangeRateParamsBuilder {
268 GetExchangeRateParamsBuilder::default()
269 }
270}
271
272#[derive(Clone, Debug, Default)]
274pub struct GetExchangeRateParamsBuilder {
275 symbol: String,
277 date: Option<String>,
279 format: Option<String>,
281 delimiter: Option<String>,
283 dp: Option<i64>,
285 timezone: Option<String>,
287}
288
289impl GetExchangeRateParamsBuilder {
290 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
292 self.symbol = symbol.into();
293 self
294 }
295 pub fn date(mut self, date: impl Into<String>) -> Self {
297 self.date = Some(date.into());
298 self
299 }
300 pub fn format(mut self, format: impl Into<String>) -> Self {
302 self.format = Some(format.into());
303 self
304 }
305 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
307 self.delimiter = Some(delimiter.into());
308 self
309 }
310 pub fn dp(mut self, dp: i64) -> Self {
312 self.dp = Some(dp);
313 self
314 }
315 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
317 self.timezone = Some(timezone.into());
318 self
319 }
320
321 pub fn build(self) -> GetExchangeRateParams {
323 GetExchangeRateParams {
324 symbol: self.symbol,
325 date: self.date,
326 format: self.format,
327 delimiter: self.delimiter,
328 dp: self.dp,
329 timezone: self.timezone,
330 }
331 }
332}
333
334#[derive(Clone, Debug, Default, Serialize, Deserialize)]
336pub struct GetMarketMoversParams {
337 pub market: String,
339 pub direction: Option<String>,
341 pub outputsize: Option<i64>,
343 pub country: Option<String>,
345 pub price_greater_than: Option<String>,
347 pub dp: Option<String>,
349}
350
351impl GetMarketMoversParams {
352 pub fn builder() -> GetMarketMoversParamsBuilder {
354 GetMarketMoversParamsBuilder::default()
355 }
356}
357
358#[derive(Clone, Debug, Default)]
360pub struct GetMarketMoversParamsBuilder {
361 market: String,
363 direction: Option<String>,
365 outputsize: Option<i64>,
367 country: Option<String>,
369 price_greater_than: Option<String>,
371 dp: Option<String>,
373}
374
375impl GetMarketMoversParamsBuilder {
376 pub fn market(mut self, market: impl Into<String>) -> Self {
378 self.market = market.into();
379 self
380 }
381 pub fn direction(mut self, direction: impl Into<String>) -> Self {
383 self.direction = Some(direction.into());
384 self
385 }
386 pub fn outputsize(mut self, outputsize: i64) -> Self {
388 self.outputsize = Some(outputsize);
389 self
390 }
391 pub fn country(mut self, country: impl Into<String>) -> Self {
393 self.country = Some(country.into());
394 self
395 }
396 pub fn price_greater_than(mut self, price_greater_than: impl Into<String>) -> Self {
398 self.price_greater_than = Some(price_greater_than.into());
399 self
400 }
401 pub fn dp(mut self, dp: impl Into<String>) -> Self {
403 self.dp = Some(dp.into());
404 self
405 }
406
407 pub fn build(self) -> GetMarketMoversParams {
409 GetMarketMoversParams {
410 market: self.market,
411 direction: self.direction,
412 outputsize: self.outputsize,
413 country: self.country,
414 price_greater_than: self.price_greater_than,
415 dp: self.dp,
416 }
417 }
418}
419
420#[derive(Clone, Debug, Default, Serialize, Deserialize)]
422pub struct GetPriceParams {
423 pub symbol: Option<String>,
425 pub figi: Option<String>,
427 pub isin: Option<String>,
429 pub cusip: Option<String>,
431 pub exchange: Option<String>,
433 pub mic_code: Option<String>,
435 pub country: Option<String>,
437 pub r#type: Option<String>,
439 pub format: Option<String>,
441 pub delimiter: Option<String>,
443 pub prepost: Option<bool>,
445 pub dp: Option<i64>,
447}
448
449impl GetPriceParams {
450 pub fn builder() -> GetPriceParamsBuilder {
452 GetPriceParamsBuilder::default()
453 }
454}
455
456#[derive(Clone, Debug, Default)]
458pub struct GetPriceParamsBuilder {
459 symbol: Option<String>,
461 figi: Option<String>,
463 isin: Option<String>,
465 cusip: Option<String>,
467 exchange: Option<String>,
469 mic_code: Option<String>,
471 country: Option<String>,
473 r#type: Option<String>,
475 format: Option<String>,
477 delimiter: Option<String>,
479 prepost: Option<bool>,
481 dp: Option<i64>,
483}
484
485impl GetPriceParamsBuilder {
486 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
488 self.symbol = Some(symbol.into());
489 self
490 }
491 pub fn figi(mut self, figi: impl Into<String>) -> Self {
493 self.figi = Some(figi.into());
494 self
495 }
496 pub fn isin(mut self, isin: impl Into<String>) -> Self {
498 self.isin = Some(isin.into());
499 self
500 }
501 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
503 self.cusip = Some(cusip.into());
504 self
505 }
506 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
508 self.exchange = Some(exchange.into());
509 self
510 }
511 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
513 self.mic_code = Some(mic_code.into());
514 self
515 }
516 pub fn country(mut self, country: impl Into<String>) -> Self {
518 self.country = Some(country.into());
519 self
520 }
521 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
523 self.r#type = Some(r#type.into());
524 self
525 }
526 pub fn format(mut self, format: impl Into<String>) -> Self {
528 self.format = Some(format.into());
529 self
530 }
531 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
533 self.delimiter = Some(delimiter.into());
534 self
535 }
536 pub fn prepost(mut self, prepost: bool) -> Self {
538 self.prepost = Some(prepost);
539 self
540 }
541 pub fn dp(mut self, dp: i64) -> Self {
543 self.dp = Some(dp);
544 self
545 }
546
547 pub fn build(self) -> GetPriceParams {
549 GetPriceParams {
550 symbol: self.symbol,
551 figi: self.figi,
552 isin: self.isin,
553 cusip: self.cusip,
554 exchange: self.exchange,
555 mic_code: self.mic_code,
556 country: self.country,
557 r#type: self.r#type,
558 format: self.format,
559 delimiter: self.delimiter,
560 prepost: self.prepost,
561 dp: self.dp,
562 }
563 }
564}
565
566#[derive(Clone, Debug, Default, Serialize, Deserialize)]
568pub struct GetQuoteParams {
569 pub symbol: Option<String>,
571 pub figi: Option<String>,
573 pub isin: Option<String>,
575 pub cusip: Option<String>,
577 pub interval: Option<String>,
579 pub exchange: Option<String>,
581 pub mic_code: Option<String>,
583 pub country: Option<String>,
585 pub volume_time_period: Option<i64>,
587 pub r#type: Option<String>,
589 pub format: Option<String>,
591 pub delimiter: Option<String>,
593 pub prepost: Option<bool>,
595 pub eod: Option<bool>,
597 pub rolling_period: Option<i64>,
599 pub dp: Option<i64>,
601 pub timezone: Option<String>,
603}
604
605impl GetQuoteParams {
606 pub fn builder() -> GetQuoteParamsBuilder {
608 GetQuoteParamsBuilder::default()
609 }
610}
611
612#[derive(Clone, Debug, Default)]
614pub struct GetQuoteParamsBuilder {
615 symbol: Option<String>,
617 figi: Option<String>,
619 isin: Option<String>,
621 cusip: Option<String>,
623 interval: Option<String>,
625 exchange: Option<String>,
627 mic_code: Option<String>,
629 country: Option<String>,
631 volume_time_period: Option<i64>,
633 r#type: Option<String>,
635 format: Option<String>,
637 delimiter: Option<String>,
639 prepost: Option<bool>,
641 eod: Option<bool>,
643 rolling_period: Option<i64>,
645 dp: Option<i64>,
647 timezone: Option<String>,
649}
650
651impl GetQuoteParamsBuilder {
652 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
654 self.symbol = Some(symbol.into());
655 self
656 }
657 pub fn figi(mut self, figi: impl Into<String>) -> Self {
659 self.figi = Some(figi.into());
660 self
661 }
662 pub fn isin(mut self, isin: impl Into<String>) -> Self {
664 self.isin = Some(isin.into());
665 self
666 }
667 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
669 self.cusip = Some(cusip.into());
670 self
671 }
672 pub fn interval(mut self, interval: impl Into<String>) -> Self {
674 self.interval = Some(interval.into());
675 self
676 }
677 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
679 self.exchange = Some(exchange.into());
680 self
681 }
682 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
684 self.mic_code = Some(mic_code.into());
685 self
686 }
687 pub fn country(mut self, country: impl Into<String>) -> Self {
689 self.country = Some(country.into());
690 self
691 }
692 pub fn volume_time_period(mut self, volume_time_period: i64) -> Self {
694 self.volume_time_period = Some(volume_time_period);
695 self
696 }
697 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
699 self.r#type = Some(r#type.into());
700 self
701 }
702 pub fn format(mut self, format: impl Into<String>) -> Self {
704 self.format = Some(format.into());
705 self
706 }
707 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
709 self.delimiter = Some(delimiter.into());
710 self
711 }
712 pub fn prepost(mut self, prepost: bool) -> Self {
714 self.prepost = Some(prepost);
715 self
716 }
717 pub fn eod(mut self, eod: bool) -> Self {
719 self.eod = Some(eod);
720 self
721 }
722 pub fn rolling_period(mut self, rolling_period: i64) -> Self {
724 self.rolling_period = Some(rolling_period);
725 self
726 }
727 pub fn dp(mut self, dp: i64) -> Self {
729 self.dp = Some(dp);
730 self
731 }
732 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
734 self.timezone = Some(timezone.into());
735 self
736 }
737
738 pub fn build(self) -> GetQuoteParams {
740 GetQuoteParams {
741 symbol: self.symbol,
742 figi: self.figi,
743 isin: self.isin,
744 cusip: self.cusip,
745 interval: self.interval,
746 exchange: self.exchange,
747 mic_code: self.mic_code,
748 country: self.country,
749 volume_time_period: self.volume_time_period,
750 r#type: self.r#type,
751 format: self.format,
752 delimiter: self.delimiter,
753 prepost: self.prepost,
754 eod: self.eod,
755 rolling_period: self.rolling_period,
756 dp: self.dp,
757 timezone: self.timezone,
758 }
759 }
760}
761
762#[derive(Clone, Debug, Default, Serialize, Deserialize)]
764pub struct GetTimeSeriesParams {
765 pub interval: String,
767 pub symbol: Option<String>,
769 pub isin: Option<String>,
771 pub figi: Option<String>,
773 pub cusip: Option<String>,
775 pub outputsize: Option<i64>,
777 pub exchange: Option<String>,
779 pub mic_code: Option<String>,
781 pub country: Option<String>,
783 pub r#type: Option<String>,
785 pub timezone: Option<String>,
787 pub start_date: Option<String>,
789 pub end_date: Option<String>,
791 pub date: Option<String>,
793 pub order: Option<String>,
795 pub prepost: Option<bool>,
797 pub format: Option<String>,
799 pub delimiter: Option<String>,
801 pub dp: Option<i64>,
803 pub previous_close: Option<bool>,
805 pub adjust: Option<String>,
807}
808
809impl GetTimeSeriesParams {
810 pub fn builder() -> GetTimeSeriesParamsBuilder {
812 GetTimeSeriesParamsBuilder::default()
813 }
814}
815
816#[derive(Clone, Debug, Default)]
818pub struct GetTimeSeriesParamsBuilder {
819 interval: String,
821 symbol: Option<String>,
823 isin: Option<String>,
825 figi: Option<String>,
827 cusip: Option<String>,
829 outputsize: Option<i64>,
831 exchange: Option<String>,
833 mic_code: Option<String>,
835 country: Option<String>,
837 r#type: Option<String>,
839 timezone: Option<String>,
841 start_date: Option<String>,
843 end_date: Option<String>,
845 date: Option<String>,
847 order: Option<String>,
849 prepost: Option<bool>,
851 format: Option<String>,
853 delimiter: Option<String>,
855 dp: Option<i64>,
857 previous_close: Option<bool>,
859 adjust: Option<String>,
861}
862
863impl GetTimeSeriesParamsBuilder {
864 pub fn interval(mut self, interval: impl Into<String>) -> Self {
866 self.interval = interval.into();
867 self
868 }
869 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
871 self.symbol = Some(symbol.into());
872 self
873 }
874 pub fn isin(mut self, isin: impl Into<String>) -> Self {
876 self.isin = Some(isin.into());
877 self
878 }
879 pub fn figi(mut self, figi: impl Into<String>) -> Self {
881 self.figi = Some(figi.into());
882 self
883 }
884 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
886 self.cusip = Some(cusip.into());
887 self
888 }
889 pub fn outputsize(mut self, outputsize: i64) -> Self {
891 self.outputsize = Some(outputsize);
892 self
893 }
894 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
896 self.exchange = Some(exchange.into());
897 self
898 }
899 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
901 self.mic_code = Some(mic_code.into());
902 self
903 }
904 pub fn country(mut self, country: impl Into<String>) -> Self {
906 self.country = Some(country.into());
907 self
908 }
909 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
911 self.r#type = Some(r#type.into());
912 self
913 }
914 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
916 self.timezone = Some(timezone.into());
917 self
918 }
919 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
921 self.start_date = Some(start_date.into());
922 self
923 }
924 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
926 self.end_date = Some(end_date.into());
927 self
928 }
929 pub fn date(mut self, date: impl Into<String>) -> Self {
931 self.date = Some(date.into());
932 self
933 }
934 pub fn order(mut self, order: impl Into<String>) -> Self {
936 self.order = Some(order.into());
937 self
938 }
939 pub fn prepost(mut self, prepost: bool) -> Self {
941 self.prepost = Some(prepost);
942 self
943 }
944 pub fn format(mut self, format: impl Into<String>) -> Self {
946 self.format = Some(format.into());
947 self
948 }
949 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
951 self.delimiter = Some(delimiter.into());
952 self
953 }
954 pub fn dp(mut self, dp: i64) -> Self {
956 self.dp = Some(dp);
957 self
958 }
959 pub fn previous_close(mut self, previous_close: bool) -> Self {
961 self.previous_close = Some(previous_close);
962 self
963 }
964 pub fn adjust(mut self, adjust: impl Into<String>) -> Self {
966 self.adjust = Some(adjust.into());
967 self
968 }
969
970 pub fn build(self) -> GetTimeSeriesParams {
972 GetTimeSeriesParams {
973 interval: self.interval,
974 symbol: self.symbol,
975 isin: self.isin,
976 figi: self.figi,
977 cusip: self.cusip,
978 outputsize: self.outputsize,
979 exchange: self.exchange,
980 mic_code: self.mic_code,
981 country: self.country,
982 r#type: self.r#type,
983 timezone: self.timezone,
984 start_date: self.start_date,
985 end_date: self.end_date,
986 date: self.date,
987 order: self.order,
988 prepost: self.prepost,
989 format: self.format,
990 delimiter: self.delimiter,
991 dp: self.dp,
992 previous_close: self.previous_close,
993 adjust: self.adjust,
994 }
995 }
996}
997
998#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1000pub struct GetTimeSeriesCrossParams {
1001 pub base: String,
1003 pub quote: String,
1005 pub interval: String,
1007 pub base_type: Option<String>,
1009 pub base_exchange: Option<String>,
1011 pub base_mic_code: Option<String>,
1013 pub quote_type: Option<String>,
1015 pub quote_exchange: Option<String>,
1017 pub quote_mic_code: Option<String>,
1019 pub outputsize: Option<i64>,
1021 pub format: Option<String>,
1023 pub delimiter: Option<String>,
1025 pub prepost: Option<bool>,
1027 pub start_date: Option<String>,
1029 pub end_date: Option<String>,
1031 pub adjust: Option<bool>,
1033 pub dp: Option<i64>,
1035 pub timezone: Option<String>,
1037}
1038
1039impl GetTimeSeriesCrossParams {
1040 pub fn builder() -> GetTimeSeriesCrossParamsBuilder {
1042 GetTimeSeriesCrossParamsBuilder::default()
1043 }
1044}
1045
1046#[derive(Clone, Debug, Default)]
1048pub struct GetTimeSeriesCrossParamsBuilder {
1049 base: String,
1051 quote: String,
1053 interval: String,
1055 base_type: Option<String>,
1057 base_exchange: Option<String>,
1059 base_mic_code: Option<String>,
1061 quote_type: Option<String>,
1063 quote_exchange: Option<String>,
1065 quote_mic_code: Option<String>,
1067 outputsize: Option<i64>,
1069 format: Option<String>,
1071 delimiter: Option<String>,
1073 prepost: Option<bool>,
1075 start_date: Option<String>,
1077 end_date: Option<String>,
1079 adjust: Option<bool>,
1081 dp: Option<i64>,
1083 timezone: Option<String>,
1085}
1086
1087impl GetTimeSeriesCrossParamsBuilder {
1088 pub fn base(mut self, base: impl Into<String>) -> Self {
1090 self.base = base.into();
1091 self
1092 }
1093 pub fn quote(mut self, quote: impl Into<String>) -> Self {
1095 self.quote = quote.into();
1096 self
1097 }
1098 pub fn interval(mut self, interval: impl Into<String>) -> Self {
1100 self.interval = interval.into();
1101 self
1102 }
1103 pub fn base_type(mut self, base_type: impl Into<String>) -> Self {
1105 self.base_type = Some(base_type.into());
1106 self
1107 }
1108 pub fn base_exchange(mut self, base_exchange: impl Into<String>) -> Self {
1110 self.base_exchange = Some(base_exchange.into());
1111 self
1112 }
1113 pub fn base_mic_code(mut self, base_mic_code: impl Into<String>) -> Self {
1115 self.base_mic_code = Some(base_mic_code.into());
1116 self
1117 }
1118 pub fn quote_type(mut self, quote_type: impl Into<String>) -> Self {
1120 self.quote_type = Some(quote_type.into());
1121 self
1122 }
1123 pub fn quote_exchange(mut self, quote_exchange: impl Into<String>) -> Self {
1125 self.quote_exchange = Some(quote_exchange.into());
1126 self
1127 }
1128 pub fn quote_mic_code(mut self, quote_mic_code: impl Into<String>) -> Self {
1130 self.quote_mic_code = Some(quote_mic_code.into());
1131 self
1132 }
1133 pub fn outputsize(mut self, outputsize: i64) -> Self {
1135 self.outputsize = Some(outputsize);
1136 self
1137 }
1138 pub fn format(mut self, format: impl Into<String>) -> Self {
1140 self.format = Some(format.into());
1141 self
1142 }
1143 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1145 self.delimiter = Some(delimiter.into());
1146 self
1147 }
1148 pub fn prepost(mut self, prepost: bool) -> Self {
1150 self.prepost = Some(prepost);
1151 self
1152 }
1153 pub fn start_date(mut self, start_date: impl Into<String>) -> Self {
1155 self.start_date = Some(start_date.into());
1156 self
1157 }
1158 pub fn end_date(mut self, end_date: impl Into<String>) -> Self {
1160 self.end_date = Some(end_date.into());
1161 self
1162 }
1163 pub fn adjust(mut self, adjust: bool) -> Self {
1165 self.adjust = Some(adjust);
1166 self
1167 }
1168 pub fn dp(mut self, dp: i64) -> Self {
1170 self.dp = Some(dp);
1171 self
1172 }
1173 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
1175 self.timezone = Some(timezone.into());
1176 self
1177 }
1178
1179 pub fn build(self) -> GetTimeSeriesCrossParams {
1181 GetTimeSeriesCrossParams {
1182 base: self.base,
1183 quote: self.quote,
1184 interval: self.interval,
1185 base_type: self.base_type,
1186 base_exchange: self.base_exchange,
1187 base_mic_code: self.base_mic_code,
1188 quote_type: self.quote_type,
1189 quote_exchange: self.quote_exchange,
1190 quote_mic_code: self.quote_mic_code,
1191 outputsize: self.outputsize,
1192 format: self.format,
1193 delimiter: self.delimiter,
1194 prepost: self.prepost,
1195 start_date: self.start_date,
1196 end_date: self.end_date,
1197 adjust: self.adjust,
1198 dp: self.dp,
1199 timezone: self.timezone,
1200 }
1201 }
1202}
1203
1204#[derive(Debug, Clone, Serialize, Deserialize)]
1206#[serde(untagged)]
1207pub enum GetCurrencyConversionError {
1208 UnknownValue(serde_json::Value),
1209}
1210
1211#[derive(Debug, Clone, Serialize, Deserialize)]
1213#[serde(untagged)]
1214pub enum GetEodError {
1215 UnknownValue(serde_json::Value),
1216}
1217
1218#[derive(Debug, Clone, Serialize, Deserialize)]
1220#[serde(untagged)]
1221pub enum GetExchangeRateError {
1222 UnknownValue(serde_json::Value),
1223}
1224
1225#[derive(Debug, Clone, Serialize, Deserialize)]
1227#[serde(untagged)]
1228pub enum GetMarketMoversError {
1229 UnknownValue(serde_json::Value),
1230}
1231
1232#[derive(Debug, Clone, Serialize, Deserialize)]
1234#[serde(untagged)]
1235pub enum GetPriceError {
1236 UnknownValue(serde_json::Value),
1237}
1238
1239#[derive(Debug, Clone, Serialize, Deserialize)]
1241#[serde(untagged)]
1242pub enum GetQuoteError {
1243 UnknownValue(serde_json::Value),
1244}
1245
1246#[derive(Debug, Clone, Serialize, Deserialize)]
1248#[serde(untagged)]
1249pub enum GetTimeSeriesError {
1250 UnknownValue(serde_json::Value),
1251}
1252
1253#[derive(Debug, Clone, Serialize, Deserialize)]
1255#[serde(untagged)]
1256pub enum GetTimeSeriesCrossError {
1257 UnknownValue(serde_json::Value),
1258}
1259
1260pub async fn get_currency_conversion(
1262 configuration: &configuration::Configuration,
1263 params: GetCurrencyConversionParams,
1264) -> Result<models::GetCurrencyConversion200ResponseEnum, 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", ¶m_value.to_string())]);
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 Ok(models::GetCurrencyConversion200ResponseEnum::Text(content)),
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::GetCurrencyConversion200ResponseEnum`")))),
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 {
1328 status,
1329 content,
1330 entity,
1331 }))
1332 }
1333}
1334
1335pub async fn get_eod(
1337 configuration: &configuration::Configuration,
1338 params: GetEodParams,
1339) -> Result<models::GetEod200ResponseEnum, Error<GetEodError>> {
1340 let p_query_symbol = params.symbol;
1342 let p_query_figi = params.figi;
1343 let p_query_isin = params.isin;
1344 let p_query_cusip = params.cusip;
1345 let p_query_exchange = params.exchange;
1346 let p_query_mic_code = params.mic_code;
1347 let p_query_country = params.country;
1348 let p_query_type = params.r#type;
1349 let p_query_date = params.date;
1350 let p_query_prepost = params.prepost;
1351 let p_query_dp = params.dp;
1352
1353 let uri_str = format!("{}/eod", configuration.base_path);
1354 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1355
1356 if let Some(ref param_value) = p_query_symbol {
1357 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1358 }
1359 if let Some(ref param_value) = p_query_figi {
1360 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1361 }
1362 if let Some(ref param_value) = p_query_isin {
1363 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1364 }
1365 if let Some(ref param_value) = p_query_cusip {
1366 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1367 }
1368 if let Some(ref param_value) = p_query_exchange {
1369 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1370 }
1371 if let Some(ref param_value) = p_query_mic_code {
1372 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1373 }
1374 if let Some(ref param_value) = p_query_country {
1375 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1376 }
1377 if let Some(ref param_value) = p_query_type {
1378 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
1379 }
1380 if let Some(ref param_value) = p_query_date {
1381 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1382 }
1383 if let Some(ref param_value) = p_query_prepost {
1384 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1385 }
1386 if let Some(ref param_value) = p_query_dp {
1387 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1388 }
1389 if let Some(ref user_agent) = configuration.user_agent {
1390 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1391 }
1392 if let Some(ref apikey) = configuration.api_key {
1393 let key = apikey.key.clone();
1394 let value = match apikey.prefix {
1395 Some(ref prefix) => format!("{} {}", prefix, key),
1396 None => key,
1397 };
1398 req_builder = req_builder.header("Authorization", value);
1399 };
1400
1401 let req = req_builder.build()?;
1402 let resp = configuration.client.execute(req).await?;
1403
1404 let status = resp.status();
1405 let content_type = resp
1406 .headers()
1407 .get("content-type")
1408 .and_then(|v| v.to_str().ok())
1409 .unwrap_or("application/octet-stream");
1410 let content_type = super::ContentType::from(content_type);
1411
1412 if !status.is_client_error() && !status.is_server_error() {
1413 let content = resp.text().await?;
1414 match content_type {
1415 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1416 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEod200ResponseEnum`"))),
1417 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::GetEod200ResponseEnum`")))),
1418 }
1419 } else {
1420 let content = resp.text().await?;
1421 let entity: Option<GetEodError> = serde_json::from_str(&content).ok();
1422 Err(Error::ResponseError(ResponseContent {
1423 status,
1424 content,
1425 entity,
1426 }))
1427 }
1428}
1429
1430pub async fn get_exchange_rate(
1432 configuration: &configuration::Configuration,
1433 params: GetExchangeRateParams,
1434) -> Result<models::GetExchangeRate200ResponseEnum, Error<GetExchangeRateError>> {
1435 let p_query_symbol = params.symbol;
1437 let p_query_date = params.date;
1438 let p_query_format = params.format;
1439 let p_query_delimiter = params.delimiter;
1440 let p_query_dp = params.dp;
1441 let p_query_timezone = params.timezone;
1442
1443 let uri_str = format!("{}/exchange_rate", configuration.base_path);
1444 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1445
1446 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
1447 if let Some(ref param_value) = p_query_date {
1448 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1449 }
1450 if let Some(ref param_value) = p_query_format {
1451 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1452 }
1453 if let Some(ref param_value) = p_query_delimiter {
1454 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1455 }
1456 if let Some(ref param_value) = p_query_dp {
1457 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1458 }
1459 if let Some(ref param_value) = p_query_timezone {
1460 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1461 }
1462 if let Some(ref user_agent) = configuration.user_agent {
1463 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1464 }
1465 if let Some(ref apikey) = configuration.api_key {
1466 let key = apikey.key.clone();
1467 let value = match apikey.prefix {
1468 Some(ref prefix) => format!("{} {}", prefix, key),
1469 None => key,
1470 };
1471 req_builder = req_builder.header("Authorization", value);
1472 };
1473
1474 let req = req_builder.build()?;
1475 let resp = configuration.client.execute(req).await?;
1476
1477 let status = resp.status();
1478 let content_type = resp
1479 .headers()
1480 .get("content-type")
1481 .and_then(|v| v.to_str().ok())
1482 .unwrap_or("application/octet-stream");
1483 let content_type = super::ContentType::from(content_type);
1484
1485 if !status.is_client_error() && !status.is_server_error() {
1486 let content = resp.text().await?;
1487 match content_type {
1488 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1489 ContentType::Text => return Ok(models::GetExchangeRate200ResponseEnum::Text(content)),
1490 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::GetExchangeRate200ResponseEnum`")))),
1491 }
1492 } else {
1493 let content = resp.text().await?;
1494 let entity: Option<GetExchangeRateError> = serde_json::from_str(&content).ok();
1495 Err(Error::ResponseError(ResponseContent {
1496 status,
1497 content,
1498 entity,
1499 }))
1500 }
1501}
1502
1503pub async fn get_market_movers(
1505 configuration: &configuration::Configuration,
1506 params: GetMarketMoversParams,
1507) -> Result<models::GetMarketMovers200Response, Error<GetMarketMoversError>> {
1508 let p_path_market = params.market;
1510 let p_query_direction = params.direction;
1511 let p_query_outputsize = params.outputsize;
1512 let p_query_country = params.country;
1513 let p_query_price_greater_than = params.price_greater_than;
1514 let p_query_dp = params.dp;
1515
1516 let uri_str = format!(
1517 "{}/market_movers/{market}",
1518 configuration.base_path,
1519 market = crate::apis::urlencode(p_path_market)
1520 );
1521 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1522
1523 if let Some(ref param_value) = p_query_direction {
1524 req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
1525 }
1526 if let Some(ref param_value) = p_query_outputsize {
1527 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1528 }
1529 if let Some(ref param_value) = p_query_country {
1530 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1531 }
1532 if let Some(ref param_value) = p_query_price_greater_than {
1533 req_builder = req_builder.query(&[("price_greater_than", ¶m_value.to_string())]);
1534 }
1535 if let Some(ref param_value) = p_query_dp {
1536 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1537 }
1538 if let Some(ref user_agent) = configuration.user_agent {
1539 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1540 }
1541 if let Some(ref apikey) = configuration.api_key {
1542 let key = apikey.key.clone();
1543 let value = match apikey.prefix {
1544 Some(ref prefix) => format!("{} {}", prefix, key),
1545 None => key,
1546 };
1547 req_builder = req_builder.header("Authorization", value);
1548 };
1549
1550 let req = req_builder.build()?;
1551 let resp = configuration.client.execute(req).await?;
1552
1553 let status = resp.status();
1554 let content_type = resp
1555 .headers()
1556 .get("content-type")
1557 .and_then(|v| v.to_str().ok())
1558 .unwrap_or("application/octet-stream");
1559 let content_type = super::ContentType::from(content_type);
1560
1561 if !status.is_client_error() && !status.is_server_error() {
1562 let content = resp.text().await?;
1563 match content_type {
1564 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1565 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMarketMovers200Response`"))),
1566 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::GetMarketMovers200Response`")))),
1567 }
1568 } else {
1569 let content = resp.text().await?;
1570 let entity: Option<GetMarketMoversError> = serde_json::from_str(&content).ok();
1571 Err(Error::ResponseError(ResponseContent {
1572 status,
1573 content,
1574 entity,
1575 }))
1576 }
1577}
1578
1579pub async fn get_price(
1581 configuration: &configuration::Configuration,
1582 params: GetPriceParams,
1583) -> Result<models::GetPrice200ResponseEnum, Error<GetPriceError>> {
1584 let p_query_symbol = params.symbol;
1586 let p_query_figi = params.figi;
1587 let p_query_isin = params.isin;
1588 let p_query_cusip = params.cusip;
1589 let p_query_exchange = params.exchange;
1590 let p_query_mic_code = params.mic_code;
1591 let p_query_country = params.country;
1592 let p_query_type = params.r#type;
1593 let p_query_format = params.format;
1594 let p_query_delimiter = params.delimiter;
1595 let p_query_prepost = params.prepost;
1596 let p_query_dp = params.dp;
1597
1598 let uri_str = format!("{}/price", configuration.base_path);
1599 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1600
1601 if let Some(ref param_value) = p_query_symbol {
1602 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1603 }
1604 if let Some(ref param_value) = p_query_figi {
1605 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1606 }
1607 if let Some(ref param_value) = p_query_isin {
1608 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1609 }
1610 if let Some(ref param_value) = p_query_cusip {
1611 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1612 }
1613 if let Some(ref param_value) = p_query_exchange {
1614 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1615 }
1616 if let Some(ref param_value) = p_query_mic_code {
1617 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1618 }
1619 if let Some(ref param_value) = p_query_country {
1620 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1621 }
1622 if let Some(ref param_value) = p_query_type {
1623 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
1624 }
1625 if let Some(ref param_value) = p_query_format {
1626 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1627 }
1628 if let Some(ref param_value) = p_query_delimiter {
1629 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1630 }
1631 if let Some(ref param_value) = p_query_prepost {
1632 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1633 }
1634 if let Some(ref param_value) = p_query_dp {
1635 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1636 }
1637 if let Some(ref user_agent) = configuration.user_agent {
1638 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1639 }
1640 if let Some(ref apikey) = configuration.api_key {
1641 let key = apikey.key.clone();
1642 let value = match apikey.prefix {
1643 Some(ref prefix) => format!("{} {}", prefix, key),
1644 None => key,
1645 };
1646 req_builder = req_builder.header("Authorization", value);
1647 };
1648
1649 let req = req_builder.build()?;
1650 let resp = configuration.client.execute(req).await?;
1651
1652 let status = resp.status();
1653 let content_type = resp
1654 .headers()
1655 .get("content-type")
1656 .and_then(|v| v.to_str().ok())
1657 .unwrap_or("application/octet-stream");
1658 let content_type = super::ContentType::from(content_type);
1659
1660 if !status.is_client_error() && !status.is_server_error() {
1661 let content = resp.text().await?;
1662 match content_type {
1663 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1664 ContentType::Text => return Ok(models::GetPrice200ResponseEnum::Text(content)),
1665 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::GetPrice200ResponseEnum`")))),
1666 }
1667 } else {
1668 let content = resp.text().await?;
1669 let entity: Option<GetPriceError> = serde_json::from_str(&content).ok();
1670 Err(Error::ResponseError(ResponseContent {
1671 status,
1672 content,
1673 entity,
1674 }))
1675 }
1676}
1677
1678pub async fn get_quote(
1680 configuration: &configuration::Configuration,
1681 params: GetQuoteParams,
1682) -> Result<models::GetQuote200ResponseEnum, Error<GetQuoteError>> {
1683 let p_query_symbol = params.symbol;
1685 let p_query_figi = params.figi;
1686 let p_query_isin = params.isin;
1687 let p_query_cusip = params.cusip;
1688 let p_query_interval = params.interval;
1689 let p_query_exchange = params.exchange;
1690 let p_query_mic_code = params.mic_code;
1691 let p_query_country = params.country;
1692 let p_query_volume_time_period = params.volume_time_period;
1693 let p_query_type = params.r#type;
1694 let p_query_format = params.format;
1695 let p_query_delimiter = params.delimiter;
1696 let p_query_prepost = params.prepost;
1697 let p_query_eod = params.eod;
1698 let p_query_rolling_period = params.rolling_period;
1699 let p_query_dp = params.dp;
1700 let p_query_timezone = params.timezone;
1701
1702 let uri_str = format!("{}/quote", configuration.base_path);
1703 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1704
1705 if let Some(ref param_value) = p_query_symbol {
1706 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1707 }
1708 if let Some(ref param_value) = p_query_figi {
1709 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1710 }
1711 if let Some(ref param_value) = p_query_isin {
1712 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1713 }
1714 if let Some(ref param_value) = p_query_cusip {
1715 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1716 }
1717 if let Some(ref param_value) = p_query_interval {
1718 req_builder = req_builder.query(&[("interval", ¶m_value.to_string())]);
1719 }
1720 if let Some(ref param_value) = p_query_exchange {
1721 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1722 }
1723 if let Some(ref param_value) = p_query_mic_code {
1724 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1725 }
1726 if let Some(ref param_value) = p_query_country {
1727 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1728 }
1729 if let Some(ref param_value) = p_query_volume_time_period {
1730 req_builder = req_builder.query(&[("volume_time_period", ¶m_value.to_string())]);
1731 }
1732 if let Some(ref param_value) = p_query_type {
1733 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
1734 }
1735 if let Some(ref param_value) = p_query_format {
1736 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1737 }
1738 if let Some(ref param_value) = p_query_delimiter {
1739 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1740 }
1741 if let Some(ref param_value) = p_query_prepost {
1742 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1743 }
1744 if let Some(ref param_value) = p_query_eod {
1745 req_builder = req_builder.query(&[("eod", ¶m_value.to_string())]);
1746 }
1747 if let Some(ref param_value) = p_query_rolling_period {
1748 req_builder = req_builder.query(&[("rolling_period", ¶m_value.to_string())]);
1749 }
1750 if let Some(ref param_value) = p_query_dp {
1751 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1752 }
1753 if let Some(ref param_value) = p_query_timezone {
1754 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1755 }
1756 if let Some(ref user_agent) = configuration.user_agent {
1757 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1758 }
1759 if let Some(ref apikey) = configuration.api_key {
1760 let key = apikey.key.clone();
1761 let value = match apikey.prefix {
1762 Some(ref prefix) => format!("{} {}", prefix, key),
1763 None => key,
1764 };
1765 req_builder = req_builder.header("Authorization", value);
1766 };
1767
1768 let req = req_builder.build()?;
1769 let resp = configuration.client.execute(req).await?;
1770
1771 let status = resp.status();
1772 let content_type = resp
1773 .headers()
1774 .get("content-type")
1775 .and_then(|v| v.to_str().ok())
1776 .unwrap_or("application/octet-stream");
1777 let content_type = super::ContentType::from(content_type);
1778
1779 if !status.is_client_error() && !status.is_server_error() {
1780 let content = resp.text().await?;
1781 match content_type {
1782 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1783 ContentType::Text => return Ok(models::GetQuote200ResponseEnum::Text(content)),
1784 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::GetQuote200ResponseEnum`")))),
1785 }
1786 } else {
1787 let content = resp.text().await?;
1788 let entity: Option<GetQuoteError> = serde_json::from_str(&content).ok();
1789 Err(Error::ResponseError(ResponseContent {
1790 status,
1791 content,
1792 entity,
1793 }))
1794 }
1795}
1796
1797pub async fn get_time_series(
1799 configuration: &configuration::Configuration,
1800 params: GetTimeSeriesParams,
1801) -> Result<models::GetTimeSeries200ResponseEnum, Error<GetTimeSeriesError>> {
1802 let p_query_interval = params.interval;
1804 let p_query_symbol = params.symbol;
1805 let p_query_isin = params.isin;
1806 let p_query_figi = params.figi;
1807 let p_query_cusip = params.cusip;
1808 let p_query_outputsize = params.outputsize;
1809 let p_query_exchange = params.exchange;
1810 let p_query_mic_code = params.mic_code;
1811 let p_query_country = params.country;
1812 let p_query_type = params.r#type;
1813 let p_query_timezone = params.timezone;
1814 let p_query_start_date = params.start_date;
1815 let p_query_end_date = params.end_date;
1816 let p_query_date = params.date;
1817 let p_query_order = params.order;
1818 let p_query_prepost = params.prepost;
1819 let p_query_format = params.format;
1820 let p_query_delimiter = params.delimiter;
1821 let p_query_dp = params.dp;
1822 let p_query_previous_close = params.previous_close;
1823 let p_query_adjust = params.adjust;
1824
1825 let uri_str = format!("{}/time_series", configuration.base_path);
1826 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1827
1828 if let Some(ref param_value) = p_query_symbol {
1829 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1830 }
1831 if let Some(ref param_value) = p_query_isin {
1832 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1833 }
1834 if let Some(ref param_value) = p_query_figi {
1835 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1836 }
1837 if let Some(ref param_value) = p_query_cusip {
1838 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1839 }
1840 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
1841 if let Some(ref param_value) = p_query_outputsize {
1842 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1843 }
1844 if let Some(ref param_value) = p_query_exchange {
1845 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1846 }
1847 if let Some(ref param_value) = p_query_mic_code {
1848 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1849 }
1850 if let Some(ref param_value) = p_query_country {
1851 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1852 }
1853 if let Some(ref param_value) = p_query_type {
1854 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
1855 }
1856 if let Some(ref param_value) = p_query_timezone {
1857 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
1858 }
1859 if let Some(ref param_value) = p_query_start_date {
1860 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
1861 }
1862 if let Some(ref param_value) = p_query_end_date {
1863 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
1864 }
1865 if let Some(ref param_value) = p_query_date {
1866 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
1867 }
1868 if let Some(ref param_value) = p_query_order {
1869 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
1870 }
1871 if let Some(ref param_value) = p_query_prepost {
1872 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1873 }
1874 if let Some(ref param_value) = p_query_format {
1875 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1876 }
1877 if let Some(ref param_value) = p_query_delimiter {
1878 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1879 }
1880 if let Some(ref param_value) = p_query_dp {
1881 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1882 }
1883 if let Some(ref param_value) = p_query_previous_close {
1884 req_builder = req_builder.query(&[("previous_close", ¶m_value.to_string())]);
1885 }
1886 if let Some(ref param_value) = p_query_adjust {
1887 req_builder = req_builder.query(&[("adjust", ¶m_value.to_string())]);
1888 }
1889 if let Some(ref user_agent) = configuration.user_agent {
1890 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1891 }
1892 if let Some(ref apikey) = configuration.api_key {
1893 let key = apikey.key.clone();
1894 let value = match apikey.prefix {
1895 Some(ref prefix) => format!("{} {}", prefix, key),
1896 None => key,
1897 };
1898 req_builder = req_builder.header("Authorization", value);
1899 };
1900
1901 let req = req_builder.build()?;
1902 let resp = configuration.client.execute(req).await?;
1903
1904 let status = resp.status();
1905 let content_type = resp
1906 .headers()
1907 .get("content-type")
1908 .and_then(|v| v.to_str().ok())
1909 .unwrap_or("application/octet-stream");
1910 let content_type = super::ContentType::from(content_type);
1911
1912 if !status.is_client_error() && !status.is_server_error() {
1913 let content = resp.text().await?;
1914 match content_type {
1915 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1916 ContentType::Text => return Ok(models::GetTimeSeries200ResponseEnum::Text(content)),
1917 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::GetTimeSeries200ResponseEnum`")))),
1918 }
1919 } else {
1920 let content = resp.text().await?;
1921 let entity: Option<GetTimeSeriesError> = serde_json::from_str(&content).ok();
1922 Err(Error::ResponseError(ResponseContent {
1923 status,
1924 content,
1925 entity,
1926 }))
1927 }
1928}
1929
1930pub async fn get_time_series_cross(
1932 configuration: &configuration::Configuration,
1933 params: GetTimeSeriesCrossParams,
1934) -> Result<models::GetTimeSeriesCross200ResponseEnum, Error<GetTimeSeriesCrossError>> {
1935 let p_query_base = params.base;
1937 let p_query_quote = params.quote;
1938 let p_query_interval = params.interval;
1939 let p_query_base_type = params.base_type;
1940 let p_query_base_exchange = params.base_exchange;
1941 let p_query_base_mic_code = params.base_mic_code;
1942 let p_query_quote_type = params.quote_type;
1943 let p_query_quote_exchange = params.quote_exchange;
1944 let p_query_quote_mic_code = params.quote_mic_code;
1945 let p_query_outputsize = params.outputsize;
1946 let p_query_format = params.format;
1947 let p_query_delimiter = params.delimiter;
1948 let p_query_prepost = params.prepost;
1949 let p_query_start_date = params.start_date;
1950 let p_query_end_date = params.end_date;
1951 let p_query_adjust = params.adjust;
1952 let p_query_dp = params.dp;
1953 let p_query_timezone = params.timezone;
1954
1955 let uri_str = format!("{}/time_series/cross", configuration.base_path);
1956 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1957
1958 req_builder = req_builder.query(&[("base", &p_query_base.to_string())]);
1959 if let Some(ref param_value) = p_query_base_type {
1960 req_builder = req_builder.query(&[("base_type", ¶m_value.to_string())]);
1961 }
1962 if let Some(ref param_value) = p_query_base_exchange {
1963 req_builder = req_builder.query(&[("base_exchange", ¶m_value.to_string())]);
1964 }
1965 if let Some(ref param_value) = p_query_base_mic_code {
1966 req_builder = req_builder.query(&[("base_mic_code", ¶m_value.to_string())]);
1967 }
1968 req_builder = req_builder.query(&[("quote", &p_query_quote.to_string())]);
1969 if let Some(ref param_value) = p_query_quote_type {
1970 req_builder = req_builder.query(&[("quote_type", ¶m_value.to_string())]);
1971 }
1972 if let Some(ref param_value) = p_query_quote_exchange {
1973 req_builder = req_builder.query(&[("quote_exchange", ¶m_value.to_string())]);
1974 }
1975 if let Some(ref param_value) = p_query_quote_mic_code {
1976 req_builder = req_builder.query(&[("quote_mic_code", ¶m_value.to_string())]);
1977 }
1978 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
1979 if let Some(ref param_value) = p_query_outputsize {
1980 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1981 }
1982 if let Some(ref param_value) = p_query_format {
1983 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1984 }
1985 if let Some(ref param_value) = p_query_delimiter {
1986 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1987 }
1988 if let Some(ref param_value) = p_query_prepost {
1989 req_builder = req_builder.query(&[("prepost", ¶m_value.to_string())]);
1990 }
1991 if let Some(ref param_value) = p_query_start_date {
1992 req_builder = req_builder.query(&[("start_date", ¶m_value.to_string())]);
1993 }
1994 if let Some(ref param_value) = p_query_end_date {
1995 req_builder = req_builder.query(&[("end_date", ¶m_value.to_string())]);
1996 }
1997 if let Some(ref param_value) = p_query_adjust {
1998 req_builder = req_builder.query(&[("adjust", ¶m_value.to_string())]);
1999 }
2000 if let Some(ref param_value) = p_query_dp {
2001 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
2002 }
2003 if let Some(ref param_value) = p_query_timezone {
2004 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
2005 }
2006 if let Some(ref user_agent) = configuration.user_agent {
2007 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2008 }
2009 if let Some(ref apikey) = configuration.api_key {
2010 let key = apikey.key.clone();
2011 let value = match apikey.prefix {
2012 Some(ref prefix) => format!("{} {}", prefix, key),
2013 None => key,
2014 };
2015 req_builder = req_builder.header("Authorization", value);
2016 };
2017
2018 let req = req_builder.build()?;
2019 let resp = configuration.client.execute(req).await?;
2020
2021 let status = resp.status();
2022 let content_type = resp
2023 .headers()
2024 .get("content-type")
2025 .and_then(|v| v.to_str().ok())
2026 .unwrap_or("application/octet-stream");
2027 let content_type = super::ContentType::from(content_type);
2028
2029 if !status.is_client_error() && !status.is_server_error() {
2030 let content = resp.text().await?;
2031 match content_type {
2032 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2033 ContentType::Text => return Ok(models::GetTimeSeriesCross200ResponseEnum::Text(content)),
2034 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::GetTimeSeriesCross200ResponseEnum`")))),
2035 }
2036 } else {
2037 let content = resp.text().await?;
2038 let entity: Option<GetTimeSeriesCrossError> = serde_json::from_str(&content).ok();
2039 Err(Error::ResponseError(ResponseContent {
2040 status,
2041 content,
2042 entity,
2043 }))
2044 }
2045}