1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17#[derive(Clone, Debug, Default, Serialize, Deserialize)]
19pub struct GetBondsParams {
20 pub symbol: Option<String>,
22 pub exchange: Option<String>,
24 pub country: Option<String>,
26 pub format: Option<String>,
28 pub delimiter: Option<String>,
30 pub show_plan: Option<bool>,
32 pub page: Option<i64>,
34 pub outputsize: Option<i64>
36}
37
38impl GetBondsParams {
39 pub fn builder() -> GetBondsParamsBuilder {
41 GetBondsParamsBuilder::default()
42 }
43}
44
45#[derive(Clone, Debug, Default)]
47pub struct GetBondsParamsBuilder {
48 symbol: Option<String>,
50 exchange: Option<String>,
52 country: Option<String>,
54 format: Option<String>,
56 delimiter: Option<String>,
58 show_plan: Option<bool>,
60 page: Option<i64>,
62 outputsize: Option<i64>
64}
65
66impl GetBondsParamsBuilder {
67 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
69 self.symbol = Some(symbol.into());
70 self
71 }
72 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
74 self.exchange = Some(exchange.into());
75 self
76 }
77 pub fn country(mut self, country: impl Into<String>) -> Self {
79 self.country = Some(country.into());
80 self
81 }
82 pub fn format(mut self, format: impl Into<String>) -> Self {
84 self.format = Some(format.into());
85 self
86 }
87 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
89 self.delimiter = Some(delimiter.into());
90 self
91 }
92 pub fn show_plan(mut self, show_plan: bool) -> Self {
94 self.show_plan = Some(show_plan);
95 self
96 }
97 pub fn page(mut self, page: i64) -> Self {
99 self.page = Some(page);
100 self
101 }
102 pub fn outputsize(mut self, outputsize: i64) -> Self {
104 self.outputsize = Some(outputsize);
105 self
106 }
107
108 pub fn build(self) -> GetBondsParams {
110 GetBondsParams {
111 symbol: self.symbol,
112 exchange: self.exchange,
113 country: self.country,
114 format: self.format,
115 delimiter: self.delimiter,
116 show_plan: self.show_plan,
117 page: self.page,
118 outputsize: self.outputsize
119 }
120 }
121}
122
123#[derive(Clone, Debug, Default, Serialize, Deserialize)]
125pub struct GetCommoditiesParams {
126 pub symbol: Option<String>,
128 pub category: Option<String>,
130 pub format: Option<String>,
132 pub delimiter: Option<String>
134}
135
136impl GetCommoditiesParams {
137 pub fn builder() -> GetCommoditiesParamsBuilder {
139 GetCommoditiesParamsBuilder::default()
140 }
141}
142
143#[derive(Clone, Debug, Default)]
145pub struct GetCommoditiesParamsBuilder {
146 symbol: Option<String>,
148 category: Option<String>,
150 format: Option<String>,
152 delimiter: Option<String>
154}
155
156impl GetCommoditiesParamsBuilder {
157 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
159 self.symbol = Some(symbol.into());
160 self
161 }
162 pub fn category(mut self, category: impl Into<String>) -> Self {
164 self.category = Some(category.into());
165 self
166 }
167 pub fn format(mut self, format: impl Into<String>) -> Self {
169 self.format = Some(format.into());
170 self
171 }
172 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
174 self.delimiter = Some(delimiter.into());
175 self
176 }
177
178 pub fn build(self) -> GetCommoditiesParams {
180 GetCommoditiesParams {
181 symbol: self.symbol,
182 category: self.category,
183 format: self.format,
184 delimiter: self.delimiter
185 }
186 }
187}
188
189#[derive(Clone, Debug, Default, Serialize, Deserialize)]
191pub struct GetCrossListingsParams {
192 pub symbol: String,
194 pub exchange: Option<String>,
196 pub mic_code: Option<String>,
198 pub country: Option<String>
200}
201
202impl GetCrossListingsParams {
203 pub fn builder() -> GetCrossListingsParamsBuilder {
205 GetCrossListingsParamsBuilder::default()
206 }
207}
208
209#[derive(Clone, Debug, Default)]
211pub struct GetCrossListingsParamsBuilder {
212 symbol: String,
214 exchange: Option<String>,
216 mic_code: Option<String>,
218 country: Option<String>
220}
221
222impl GetCrossListingsParamsBuilder {
223 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
225 self.symbol = symbol.into();
226 self
227 }
228 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
230 self.exchange = Some(exchange.into());
231 self
232 }
233 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
235 self.mic_code = Some(mic_code.into());
236 self
237 }
238 pub fn country(mut self, country: impl Into<String>) -> Self {
240 self.country = Some(country.into());
241 self
242 }
243
244 pub fn build(self) -> GetCrossListingsParams {
246 GetCrossListingsParams {
247 symbol: self.symbol,
248 exchange: self.exchange,
249 mic_code: self.mic_code,
250 country: self.country
251 }
252 }
253}
254
255#[derive(Clone, Debug, Default, Serialize, Deserialize)]
257pub struct GetCryptocurrenciesParams {
258 pub symbol: Option<String>,
260 pub exchange: Option<String>,
262 pub currency_base: Option<String>,
264 pub currency_quote: Option<String>,
266 pub format: Option<String>,
268 pub delimiter: Option<String>
270}
271
272impl GetCryptocurrenciesParams {
273 pub fn builder() -> GetCryptocurrenciesParamsBuilder {
275 GetCryptocurrenciesParamsBuilder::default()
276 }
277}
278
279#[derive(Clone, Debug, Default)]
281pub struct GetCryptocurrenciesParamsBuilder {
282 symbol: Option<String>,
284 exchange: Option<String>,
286 currency_base: Option<String>,
288 currency_quote: Option<String>,
290 format: Option<String>,
292 delimiter: Option<String>
294}
295
296impl GetCryptocurrenciesParamsBuilder {
297 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
299 self.symbol = Some(symbol.into());
300 self
301 }
302 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
304 self.exchange = Some(exchange.into());
305 self
306 }
307 pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
309 self.currency_base = Some(currency_base.into());
310 self
311 }
312 pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
314 self.currency_quote = Some(currency_quote.into());
315 self
316 }
317 pub fn format(mut self, format: impl Into<String>) -> Self {
319 self.format = Some(format.into());
320 self
321 }
322 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
324 self.delimiter = Some(delimiter.into());
325 self
326 }
327
328 pub fn build(self) -> GetCryptocurrenciesParams {
330 GetCryptocurrenciesParams {
331 symbol: self.symbol,
332 exchange: self.exchange,
333 currency_base: self.currency_base,
334 currency_quote: self.currency_quote,
335 format: self.format,
336 delimiter: self.delimiter
337 }
338 }
339}
340
341#[derive(Clone, Debug, Default, Serialize, Deserialize)]
343pub struct GetCryptocurrencyExchangesParams {
344 pub format: Option<String>,
346 pub delimiter: Option<String>
348}
349
350impl GetCryptocurrencyExchangesParams {
351 pub fn builder() -> GetCryptocurrencyExchangesParamsBuilder {
353 GetCryptocurrencyExchangesParamsBuilder::default()
354 }
355}
356
357#[derive(Clone, Debug, Default)]
359pub struct GetCryptocurrencyExchangesParamsBuilder {
360 format: Option<String>,
362 delimiter: Option<String>
364}
365
366impl GetCryptocurrencyExchangesParamsBuilder {
367 pub fn format(mut self, format: impl Into<String>) -> Self {
369 self.format = Some(format.into());
370 self
371 }
372 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
374 self.delimiter = Some(delimiter.into());
375 self
376 }
377
378 pub fn build(self) -> GetCryptocurrencyExchangesParams {
380 GetCryptocurrencyExchangesParams {
381 format: self.format,
382 delimiter: self.delimiter
383 }
384 }
385}
386
387#[derive(Clone, Debug, Default, Serialize, Deserialize)]
389pub struct GetEarliestTimestampParams {
390 pub interval: String,
392 pub symbol: Option<String>,
394 pub figi: Option<String>,
396 pub isin: Option<String>,
398 pub cusip: Option<String>,
400 pub exchange: Option<String>,
402 pub mic_code: Option<String>,
404 pub timezone: Option<String>
406}
407
408impl GetEarliestTimestampParams {
409 pub fn builder() -> GetEarliestTimestampParamsBuilder {
411 GetEarliestTimestampParamsBuilder::default()
412 }
413}
414
415#[derive(Clone, Debug, Default)]
417pub struct GetEarliestTimestampParamsBuilder {
418 interval: String,
420 symbol: Option<String>,
422 figi: Option<String>,
424 isin: Option<String>,
426 cusip: Option<String>,
428 exchange: Option<String>,
430 mic_code: Option<String>,
432 timezone: Option<String>
434}
435
436impl GetEarliestTimestampParamsBuilder {
437 pub fn interval(mut self, interval: impl Into<String>) -> Self {
439 self.interval = interval.into();
440 self
441 }
442 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
444 self.symbol = Some(symbol.into());
445 self
446 }
447 pub fn figi(mut self, figi: impl Into<String>) -> Self {
449 self.figi = Some(figi.into());
450 self
451 }
452 pub fn isin(mut self, isin: impl Into<String>) -> Self {
454 self.isin = Some(isin.into());
455 self
456 }
457 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
459 self.cusip = Some(cusip.into());
460 self
461 }
462 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
464 self.exchange = Some(exchange.into());
465 self
466 }
467 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
469 self.mic_code = Some(mic_code.into());
470 self
471 }
472 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
474 self.timezone = Some(timezone.into());
475 self
476 }
477
478 pub fn build(self) -> GetEarliestTimestampParams {
480 GetEarliestTimestampParams {
481 interval: self.interval,
482 symbol: self.symbol,
483 figi: self.figi,
484 isin: self.isin,
485 cusip: self.cusip,
486 exchange: self.exchange,
487 mic_code: self.mic_code,
488 timezone: self.timezone
489 }
490 }
491}
492
493#[derive(Clone, Debug, Default, Serialize, Deserialize)]
495pub struct GetEtfParams {
496 pub symbol: Option<String>,
498 pub figi: Option<String>,
500 pub isin: Option<String>,
502 pub cusip: Option<String>,
504 pub cik: Option<String>,
506 pub exchange: Option<String>,
508 pub mic_code: Option<String>,
510 pub country: Option<String>,
512 pub format: Option<String>,
514 pub delimiter: Option<String>,
516 pub show_plan: Option<bool>,
518 pub include_delisted: Option<bool>
520}
521
522impl GetEtfParams {
523 pub fn builder() -> GetEtfParamsBuilder {
525 GetEtfParamsBuilder::default()
526 }
527}
528
529#[derive(Clone, Debug, Default)]
531pub struct GetEtfParamsBuilder {
532 symbol: Option<String>,
534 figi: Option<String>,
536 isin: Option<String>,
538 cusip: Option<String>,
540 cik: Option<String>,
542 exchange: Option<String>,
544 mic_code: Option<String>,
546 country: Option<String>,
548 format: Option<String>,
550 delimiter: Option<String>,
552 show_plan: Option<bool>,
554 include_delisted: Option<bool>
556}
557
558impl GetEtfParamsBuilder {
559 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
561 self.symbol = Some(symbol.into());
562 self
563 }
564 pub fn figi(mut self, figi: impl Into<String>) -> Self {
566 self.figi = Some(figi.into());
567 self
568 }
569 pub fn isin(mut self, isin: impl Into<String>) -> Self {
571 self.isin = Some(isin.into());
572 self
573 }
574 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
576 self.cusip = Some(cusip.into());
577 self
578 }
579 pub fn cik(mut self, cik: impl Into<String>) -> Self {
581 self.cik = Some(cik.into());
582 self
583 }
584 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
586 self.exchange = Some(exchange.into());
587 self
588 }
589 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
591 self.mic_code = Some(mic_code.into());
592 self
593 }
594 pub fn country(mut self, country: impl Into<String>) -> Self {
596 self.country = Some(country.into());
597 self
598 }
599 pub fn format(mut self, format: impl Into<String>) -> Self {
601 self.format = Some(format.into());
602 self
603 }
604 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
606 self.delimiter = Some(delimiter.into());
607 self
608 }
609 pub fn show_plan(mut self, show_plan: bool) -> Self {
611 self.show_plan = Some(show_plan);
612 self
613 }
614 pub fn include_delisted(mut self, include_delisted: bool) -> Self {
616 self.include_delisted = Some(include_delisted);
617 self
618 }
619
620 pub fn build(self) -> GetEtfParams {
622 GetEtfParams {
623 symbol: self.symbol,
624 figi: self.figi,
625 isin: self.isin,
626 cusip: self.cusip,
627 cik: self.cik,
628 exchange: self.exchange,
629 mic_code: self.mic_code,
630 country: self.country,
631 format: self.format,
632 delimiter: self.delimiter,
633 show_plan: self.show_plan,
634 include_delisted: self.include_delisted
635 }
636 }
637}
638
639#[derive(Clone, Debug, Default, Serialize, Deserialize)]
641pub struct GetEtfsFamilyParams {
642 pub country: Option<String>,
644 pub fund_family: Option<String>
646}
647
648impl GetEtfsFamilyParams {
649 pub fn builder() -> GetEtfsFamilyParamsBuilder {
651 GetEtfsFamilyParamsBuilder::default()
652 }
653}
654
655#[derive(Clone, Debug, Default)]
657pub struct GetEtfsFamilyParamsBuilder {
658 country: Option<String>,
660 fund_family: Option<String>
662}
663
664impl GetEtfsFamilyParamsBuilder {
665 pub fn country(mut self, country: impl Into<String>) -> Self {
667 self.country = Some(country.into());
668 self
669 }
670 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
672 self.fund_family = Some(fund_family.into());
673 self
674 }
675
676 pub fn build(self) -> GetEtfsFamilyParams {
678 GetEtfsFamilyParams {
679 country: self.country,
680 fund_family: self.fund_family
681 }
682 }
683}
684
685#[derive(Clone, Debug, Default, Serialize, Deserialize)]
687pub struct GetEtfsListParams {
688 pub symbol: Option<String>,
690 pub figi: Option<String>,
692 pub isin: Option<String>,
694 pub cusip: Option<String>,
696 pub cik: Option<String>,
698 pub country: Option<String>,
700 pub fund_family: Option<String>,
702 pub fund_type: Option<String>,
704 pub page: Option<i64>,
706 pub outputsize: Option<i64>
708}
709
710impl GetEtfsListParams {
711 pub fn builder() -> GetEtfsListParamsBuilder {
713 GetEtfsListParamsBuilder::default()
714 }
715}
716
717#[derive(Clone, Debug, Default)]
719pub struct GetEtfsListParamsBuilder {
720 symbol: Option<String>,
722 figi: Option<String>,
724 isin: Option<String>,
726 cusip: Option<String>,
728 cik: Option<String>,
730 country: Option<String>,
732 fund_family: Option<String>,
734 fund_type: Option<String>,
736 page: Option<i64>,
738 outputsize: Option<i64>
740}
741
742impl GetEtfsListParamsBuilder {
743 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
745 self.symbol = Some(symbol.into());
746 self
747 }
748 pub fn figi(mut self, figi: impl Into<String>) -> Self {
750 self.figi = Some(figi.into());
751 self
752 }
753 pub fn isin(mut self, isin: impl Into<String>) -> Self {
755 self.isin = Some(isin.into());
756 self
757 }
758 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
760 self.cusip = Some(cusip.into());
761 self
762 }
763 pub fn cik(mut self, cik: impl Into<String>) -> Self {
765 self.cik = Some(cik.into());
766 self
767 }
768 pub fn country(mut self, country: impl Into<String>) -> Self {
770 self.country = Some(country.into());
771 self
772 }
773 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
775 self.fund_family = Some(fund_family.into());
776 self
777 }
778 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
780 self.fund_type = Some(fund_type.into());
781 self
782 }
783 pub fn page(mut self, page: i64) -> Self {
785 self.page = Some(page);
786 self
787 }
788 pub fn outputsize(mut self, outputsize: i64) -> Self {
790 self.outputsize = Some(outputsize);
791 self
792 }
793
794 pub fn build(self) -> GetEtfsListParams {
796 GetEtfsListParams {
797 symbol: self.symbol,
798 figi: self.figi,
799 isin: self.isin,
800 cusip: self.cusip,
801 cik: self.cik,
802 country: self.country,
803 fund_family: self.fund_family,
804 fund_type: self.fund_type,
805 page: self.page,
806 outputsize: self.outputsize
807 }
808 }
809}
810
811#[derive(Clone, Debug, Default, Serialize, Deserialize)]
813pub struct GetEtfsTypeParams {
814 pub country: Option<String>,
816 pub fund_type: Option<String>
818}
819
820impl GetEtfsTypeParams {
821 pub fn builder() -> GetEtfsTypeParamsBuilder {
823 GetEtfsTypeParamsBuilder::default()
824 }
825}
826
827#[derive(Clone, Debug, Default)]
829pub struct GetEtfsTypeParamsBuilder {
830 country: Option<String>,
832 fund_type: Option<String>
834}
835
836impl GetEtfsTypeParamsBuilder {
837 pub fn country(mut self, country: impl Into<String>) -> Self {
839 self.country = Some(country.into());
840 self
841 }
842 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
844 self.fund_type = Some(fund_type.into());
845 self
846 }
847
848 pub fn build(self) -> GetEtfsTypeParams {
850 GetEtfsTypeParams {
851 country: self.country,
852 fund_type: self.fund_type
853 }
854 }
855}
856
857#[derive(Clone, Debug, Default, Serialize, Deserialize)]
859pub struct GetExchangeScheduleParams {
860 pub mic_name: Option<String>,
862 pub mic_code: Option<String>,
864 pub country: Option<String>,
866 pub date: Option<String>
868}
869
870impl GetExchangeScheduleParams {
871 pub fn builder() -> GetExchangeScheduleParamsBuilder {
873 GetExchangeScheduleParamsBuilder::default()
874 }
875}
876
877#[derive(Clone, Debug, Default)]
879pub struct GetExchangeScheduleParamsBuilder {
880 mic_name: Option<String>,
882 mic_code: Option<String>,
884 country: Option<String>,
886 date: Option<String>
888}
889
890impl GetExchangeScheduleParamsBuilder {
891 pub fn mic_name(mut self, mic_name: impl Into<String>) -> Self {
893 self.mic_name = Some(mic_name.into());
894 self
895 }
896 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
898 self.mic_code = Some(mic_code.into());
899 self
900 }
901 pub fn country(mut self, country: impl Into<String>) -> Self {
903 self.country = Some(country.into());
904 self
905 }
906 pub fn date(mut self, date: impl Into<String>) -> Self {
908 self.date = Some(date.into());
909 self
910 }
911
912 pub fn build(self) -> GetExchangeScheduleParams {
914 GetExchangeScheduleParams {
915 mic_name: self.mic_name,
916 mic_code: self.mic_code,
917 country: self.country,
918 date: self.date
919 }
920 }
921}
922
923#[derive(Clone, Debug, Default, Serialize, Deserialize)]
925pub struct GetExchangesParams {
926 pub r#type: Option<String>,
928 pub name: Option<String>,
930 pub code: Option<String>,
932 pub country: Option<String>,
934 pub format: Option<String>,
936 pub delimiter: Option<String>,
938 pub show_plan: Option<bool>
940}
941
942impl GetExchangesParams {
943 pub fn builder() -> GetExchangesParamsBuilder {
945 GetExchangesParamsBuilder::default()
946 }
947}
948
949#[derive(Clone, Debug, Default)]
951pub struct GetExchangesParamsBuilder {
952 r#type: Option<String>,
954 name: Option<String>,
956 code: Option<String>,
958 country: Option<String>,
960 format: Option<String>,
962 delimiter: Option<String>,
964 show_plan: Option<bool>
966}
967
968impl GetExchangesParamsBuilder {
969 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
971 self.r#type = Some(r#type.into());
972 self
973 }
974 pub fn name(mut self, name: impl Into<String>) -> Self {
976 self.name = Some(name.into());
977 self
978 }
979 pub fn code(mut self, code: impl Into<String>) -> Self {
981 self.code = Some(code.into());
982 self
983 }
984 pub fn country(mut self, country: impl Into<String>) -> Self {
986 self.country = Some(country.into());
987 self
988 }
989 pub fn format(mut self, format: impl Into<String>) -> Self {
991 self.format = Some(format.into());
992 self
993 }
994 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
996 self.delimiter = Some(delimiter.into());
997 self
998 }
999 pub fn show_plan(mut self, show_plan: bool) -> Self {
1001 self.show_plan = Some(show_plan);
1002 self
1003 }
1004
1005 pub fn build(self) -> GetExchangesParams {
1007 GetExchangesParams {
1008 r#type: self.r#type,
1009 name: self.name,
1010 code: self.code,
1011 country: self.country,
1012 format: self.format,
1013 delimiter: self.delimiter,
1014 show_plan: self.show_plan
1015 }
1016 }
1017}
1018
1019#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1021pub struct GetForexPairsParams {
1022 pub symbol: Option<String>,
1024 pub currency_base: Option<String>,
1026 pub currency_quote: Option<String>,
1028 pub format: Option<String>,
1030 pub delimiter: Option<String>
1032}
1033
1034impl GetForexPairsParams {
1035 pub fn builder() -> GetForexPairsParamsBuilder {
1037 GetForexPairsParamsBuilder::default()
1038 }
1039}
1040
1041#[derive(Clone, Debug, Default)]
1043pub struct GetForexPairsParamsBuilder {
1044 symbol: Option<String>,
1046 currency_base: Option<String>,
1048 currency_quote: Option<String>,
1050 format: Option<String>,
1052 delimiter: Option<String>
1054}
1055
1056impl GetForexPairsParamsBuilder {
1057 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1059 self.symbol = Some(symbol.into());
1060 self
1061 }
1062 pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
1064 self.currency_base = Some(currency_base.into());
1065 self
1066 }
1067 pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
1069 self.currency_quote = Some(currency_quote.into());
1070 self
1071 }
1072 pub fn format(mut self, format: impl Into<String>) -> Self {
1074 self.format = Some(format.into());
1075 self
1076 }
1077 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1079 self.delimiter = Some(delimiter.into());
1080 self
1081 }
1082
1083 pub fn build(self) -> GetForexPairsParams {
1085 GetForexPairsParams {
1086 symbol: self.symbol,
1087 currency_base: self.currency_base,
1088 currency_quote: self.currency_quote,
1089 format: self.format,
1090 delimiter: self.delimiter
1091 }
1092 }
1093}
1094
1095#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1097pub struct GetFundsParams {
1098 pub symbol: Option<String>,
1100 pub figi: Option<String>,
1102 pub isin: Option<String>,
1104 pub cusip: Option<String>,
1106 pub cik: Option<String>,
1108 pub exchange: Option<String>,
1110 pub country: Option<String>,
1112 pub format: Option<String>,
1114 pub delimiter: Option<String>,
1116 pub show_plan: Option<bool>,
1118 pub page: Option<i64>,
1120 pub outputsize: Option<i64>
1122}
1123
1124impl GetFundsParams {
1125 pub fn builder() -> GetFundsParamsBuilder {
1127 GetFundsParamsBuilder::default()
1128 }
1129}
1130
1131#[derive(Clone, Debug, Default)]
1133pub struct GetFundsParamsBuilder {
1134 symbol: Option<String>,
1136 figi: Option<String>,
1138 isin: Option<String>,
1140 cusip: Option<String>,
1142 cik: Option<String>,
1144 exchange: Option<String>,
1146 country: Option<String>,
1148 format: Option<String>,
1150 delimiter: Option<String>,
1152 show_plan: Option<bool>,
1154 page: Option<i64>,
1156 outputsize: Option<i64>
1158}
1159
1160impl GetFundsParamsBuilder {
1161 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1163 self.symbol = Some(symbol.into());
1164 self
1165 }
1166 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1168 self.figi = Some(figi.into());
1169 self
1170 }
1171 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1173 self.isin = Some(isin.into());
1174 self
1175 }
1176 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1178 self.cusip = Some(cusip.into());
1179 self
1180 }
1181 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1183 self.cik = Some(cik.into());
1184 self
1185 }
1186 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1188 self.exchange = Some(exchange.into());
1189 self
1190 }
1191 pub fn country(mut self, country: impl Into<String>) -> Self {
1193 self.country = Some(country.into());
1194 self
1195 }
1196 pub fn format(mut self, format: impl Into<String>) -> Self {
1198 self.format = Some(format.into());
1199 self
1200 }
1201 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1203 self.delimiter = Some(delimiter.into());
1204 self
1205 }
1206 pub fn show_plan(mut self, show_plan: bool) -> Self {
1208 self.show_plan = Some(show_plan);
1209 self
1210 }
1211 pub fn page(mut self, page: i64) -> Self {
1213 self.page = Some(page);
1214 self
1215 }
1216 pub fn outputsize(mut self, outputsize: i64) -> Self {
1218 self.outputsize = Some(outputsize);
1219 self
1220 }
1221
1222 pub fn build(self) -> GetFundsParams {
1224 GetFundsParams {
1225 symbol: self.symbol,
1226 figi: self.figi,
1227 isin: self.isin,
1228 cusip: self.cusip,
1229 cik: self.cik,
1230 exchange: self.exchange,
1231 country: self.country,
1232 format: self.format,
1233 delimiter: self.delimiter,
1234 show_plan: self.show_plan,
1235 page: self.page,
1236 outputsize: self.outputsize
1237 }
1238 }
1239}
1240
1241#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1243pub struct GetMarketStateParams {
1244 pub exchange: Option<String>,
1246 pub code: Option<String>,
1248 pub country: Option<String>
1250}
1251
1252impl GetMarketStateParams {
1253 pub fn builder() -> GetMarketStateParamsBuilder {
1255 GetMarketStateParamsBuilder::default()
1256 }
1257}
1258
1259#[derive(Clone, Debug, Default)]
1261pub struct GetMarketStateParamsBuilder {
1262 exchange: Option<String>,
1264 code: Option<String>,
1266 country: Option<String>
1268}
1269
1270impl GetMarketStateParamsBuilder {
1271 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1273 self.exchange = Some(exchange.into());
1274 self
1275 }
1276 pub fn code(mut self, code: impl Into<String>) -> Self {
1278 self.code = Some(code.into());
1279 self
1280 }
1281 pub fn country(mut self, country: impl Into<String>) -> Self {
1283 self.country = Some(country.into());
1284 self
1285 }
1286
1287 pub fn build(self) -> GetMarketStateParams {
1289 GetMarketStateParams {
1290 exchange: self.exchange,
1291 code: self.code,
1292 country: self.country
1293 }
1294 }
1295}
1296
1297#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1299pub struct GetMutualFundsFamilyParams {
1300 pub fund_family: Option<String>,
1302 pub country: Option<String>
1304}
1305
1306impl GetMutualFundsFamilyParams {
1307 pub fn builder() -> GetMutualFundsFamilyParamsBuilder {
1309 GetMutualFundsFamilyParamsBuilder::default()
1310 }
1311}
1312
1313#[derive(Clone, Debug, Default)]
1315pub struct GetMutualFundsFamilyParamsBuilder {
1316 fund_family: Option<String>,
1318 country: Option<String>
1320}
1321
1322impl GetMutualFundsFamilyParamsBuilder {
1323 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1325 self.fund_family = Some(fund_family.into());
1326 self
1327 }
1328 pub fn country(mut self, country: impl Into<String>) -> Self {
1330 self.country = Some(country.into());
1331 self
1332 }
1333
1334 pub fn build(self) -> GetMutualFundsFamilyParams {
1336 GetMutualFundsFamilyParams {
1337 fund_family: self.fund_family,
1338 country: self.country
1339 }
1340 }
1341}
1342
1343#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1345pub struct GetMutualFundsListParams {
1346 pub symbol: Option<String>,
1348 pub figi: Option<String>,
1350 pub isin: Option<String>,
1352 pub cusip: Option<String>,
1354 pub cik: Option<String>,
1356 pub country: Option<String>,
1358 pub fund_family: Option<String>,
1360 pub fund_type: Option<String>,
1362 pub performance_rating: Option<i64>,
1364 pub risk_rating: Option<i64>,
1366 pub page: Option<i64>,
1368 pub outputsize: Option<i64>
1370}
1371
1372impl GetMutualFundsListParams {
1373 pub fn builder() -> GetMutualFundsListParamsBuilder {
1375 GetMutualFundsListParamsBuilder::default()
1376 }
1377}
1378
1379#[derive(Clone, Debug, Default)]
1381pub struct GetMutualFundsListParamsBuilder {
1382 symbol: Option<String>,
1384 figi: Option<String>,
1386 isin: Option<String>,
1388 cusip: Option<String>,
1390 cik: Option<String>,
1392 country: Option<String>,
1394 fund_family: Option<String>,
1396 fund_type: Option<String>,
1398 performance_rating: Option<i64>,
1400 risk_rating: Option<i64>,
1402 page: Option<i64>,
1404 outputsize: Option<i64>
1406}
1407
1408impl GetMutualFundsListParamsBuilder {
1409 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1411 self.symbol = Some(symbol.into());
1412 self
1413 }
1414 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1416 self.figi = Some(figi.into());
1417 self
1418 }
1419 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1421 self.isin = Some(isin.into());
1422 self
1423 }
1424 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1426 self.cusip = Some(cusip.into());
1427 self
1428 }
1429 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1431 self.cik = Some(cik.into());
1432 self
1433 }
1434 pub fn country(mut self, country: impl Into<String>) -> Self {
1436 self.country = Some(country.into());
1437 self
1438 }
1439 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1441 self.fund_family = Some(fund_family.into());
1442 self
1443 }
1444 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1446 self.fund_type = Some(fund_type.into());
1447 self
1448 }
1449 pub fn performance_rating(mut self, performance_rating: i64) -> Self {
1451 self.performance_rating = Some(performance_rating);
1452 self
1453 }
1454 pub fn risk_rating(mut self, risk_rating: i64) -> Self {
1456 self.risk_rating = Some(risk_rating);
1457 self
1458 }
1459 pub fn page(mut self, page: i64) -> Self {
1461 self.page = Some(page);
1462 self
1463 }
1464 pub fn outputsize(mut self, outputsize: i64) -> Self {
1466 self.outputsize = Some(outputsize);
1467 self
1468 }
1469
1470 pub fn build(self) -> GetMutualFundsListParams {
1472 GetMutualFundsListParams {
1473 symbol: self.symbol,
1474 figi: self.figi,
1475 isin: self.isin,
1476 cusip: self.cusip,
1477 cik: self.cik,
1478 country: self.country,
1479 fund_family: self.fund_family,
1480 fund_type: self.fund_type,
1481 performance_rating: self.performance_rating,
1482 risk_rating: self.risk_rating,
1483 page: self.page,
1484 outputsize: self.outputsize
1485 }
1486 }
1487}
1488
1489#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1491pub struct GetMutualFundsTypeParams {
1492 pub fund_type: Option<String>,
1494 pub country: Option<String>
1496}
1497
1498impl GetMutualFundsTypeParams {
1499 pub fn builder() -> GetMutualFundsTypeParamsBuilder {
1501 GetMutualFundsTypeParamsBuilder::default()
1502 }
1503}
1504
1505#[derive(Clone, Debug, Default)]
1507pub struct GetMutualFundsTypeParamsBuilder {
1508 fund_type: Option<String>,
1510 country: Option<String>
1512}
1513
1514impl GetMutualFundsTypeParamsBuilder {
1515 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1517 self.fund_type = Some(fund_type.into());
1518 self
1519 }
1520 pub fn country(mut self, country: impl Into<String>) -> Self {
1522 self.country = Some(country.into());
1523 self
1524 }
1525
1526 pub fn build(self) -> GetMutualFundsTypeParams {
1528 GetMutualFundsTypeParams {
1529 fund_type: self.fund_type,
1530 country: self.country
1531 }
1532 }
1533}
1534
1535#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1537pub struct GetStocksParams {
1538 pub symbol: Option<String>,
1540 pub figi: Option<String>,
1542 pub isin: Option<String>,
1544 pub cusip: Option<String>,
1546 pub cik: Option<String>,
1548 pub exchange: Option<String>,
1550 pub mic_code: Option<String>,
1552 pub country: Option<String>,
1554 pub r#type: Option<String>,
1556 pub format: Option<String>,
1558 pub delimiter: Option<String>,
1560 pub show_plan: Option<bool>,
1562 pub include_delisted: Option<bool>
1564}
1565
1566impl GetStocksParams {
1567 pub fn builder() -> GetStocksParamsBuilder {
1569 GetStocksParamsBuilder::default()
1570 }
1571}
1572
1573#[derive(Clone, Debug, Default)]
1575pub struct GetStocksParamsBuilder {
1576 symbol: Option<String>,
1578 figi: Option<String>,
1580 isin: Option<String>,
1582 cusip: Option<String>,
1584 cik: Option<String>,
1586 exchange: Option<String>,
1588 mic_code: Option<String>,
1590 country: Option<String>,
1592 r#type: Option<String>,
1594 format: Option<String>,
1596 delimiter: Option<String>,
1598 show_plan: Option<bool>,
1600 include_delisted: Option<bool>
1602}
1603
1604impl GetStocksParamsBuilder {
1605 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1607 self.symbol = Some(symbol.into());
1608 self
1609 }
1610 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1612 self.figi = Some(figi.into());
1613 self
1614 }
1615 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1617 self.isin = Some(isin.into());
1618 self
1619 }
1620 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1622 self.cusip = Some(cusip.into());
1623 self
1624 }
1625 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1627 self.cik = Some(cik.into());
1628 self
1629 }
1630 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1632 self.exchange = Some(exchange.into());
1633 self
1634 }
1635 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1637 self.mic_code = Some(mic_code.into());
1638 self
1639 }
1640 pub fn country(mut self, country: impl Into<String>) -> Self {
1642 self.country = Some(country.into());
1643 self
1644 }
1645 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
1647 self.r#type = Some(r#type.into());
1648 self
1649 }
1650 pub fn format(mut self, format: impl Into<String>) -> Self {
1652 self.format = Some(format.into());
1653 self
1654 }
1655 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1657 self.delimiter = Some(delimiter.into());
1658 self
1659 }
1660 pub fn show_plan(mut self, show_plan: bool) -> Self {
1662 self.show_plan = Some(show_plan);
1663 self
1664 }
1665 pub fn include_delisted(mut self, include_delisted: bool) -> Self {
1667 self.include_delisted = Some(include_delisted);
1668 self
1669 }
1670
1671 pub fn build(self) -> GetStocksParams {
1673 GetStocksParams {
1674 symbol: self.symbol,
1675 figi: self.figi,
1676 isin: self.isin,
1677 cusip: self.cusip,
1678 cik: self.cik,
1679 exchange: self.exchange,
1680 mic_code: self.mic_code,
1681 country: self.country,
1682 r#type: self.r#type,
1683 format: self.format,
1684 delimiter: self.delimiter,
1685 show_plan: self.show_plan,
1686 include_delisted: self.include_delisted
1687 }
1688 }
1689}
1690
1691#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1693pub struct GetSymbolSearchParams {
1694 pub symbol: String,
1696 pub outputsize: Option<i64>,
1698 pub show_plan: Option<bool>
1700}
1701
1702impl GetSymbolSearchParams {
1703 pub fn builder() -> GetSymbolSearchParamsBuilder {
1705 GetSymbolSearchParamsBuilder::default()
1706 }
1707}
1708
1709#[derive(Clone, Debug, Default)]
1711pub struct GetSymbolSearchParamsBuilder {
1712 symbol: String,
1714 outputsize: Option<i64>,
1716 show_plan: Option<bool>
1718}
1719
1720impl GetSymbolSearchParamsBuilder {
1721 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1723 self.symbol = symbol.into();
1724 self
1725 }
1726 pub fn outputsize(mut self, outputsize: i64) -> Self {
1728 self.outputsize = Some(outputsize);
1729 self
1730 }
1731 pub fn show_plan(mut self, show_plan: bool) -> Self {
1733 self.show_plan = Some(show_plan);
1734 self
1735 }
1736
1737 pub fn build(self) -> GetSymbolSearchParams {
1739 GetSymbolSearchParams {
1740 symbol: self.symbol,
1741 outputsize: self.outputsize,
1742 show_plan: self.show_plan
1743 }
1744 }
1745}
1746
1747
1748#[derive(Debug, Clone, Serialize, Deserialize)]
1750#[serde(untagged)]
1751pub enum GetBondsError {
1752 UnknownValue(serde_json::Value),
1753}
1754
1755#[derive(Debug, Clone, Serialize, Deserialize)]
1757#[serde(untagged)]
1758pub enum GetCommoditiesError {
1759 UnknownValue(serde_json::Value),
1760}
1761
1762#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum GetCountriesError {
1766 UnknownValue(serde_json::Value),
1767}
1768
1769#[derive(Debug, Clone, Serialize, Deserialize)]
1771#[serde(untagged)]
1772pub enum GetCrossListingsError {
1773 UnknownValue(serde_json::Value),
1774}
1775
1776#[derive(Debug, Clone, Serialize, Deserialize)]
1778#[serde(untagged)]
1779pub enum GetCryptocurrenciesError {
1780 UnknownValue(serde_json::Value),
1781}
1782
1783#[derive(Debug, Clone, Serialize, Deserialize)]
1785#[serde(untagged)]
1786pub enum GetCryptocurrencyExchangesError {
1787 UnknownValue(serde_json::Value),
1788}
1789
1790#[derive(Debug, Clone, Serialize, Deserialize)]
1792#[serde(untagged)]
1793pub enum GetEarliestTimestampError {
1794 UnknownValue(serde_json::Value),
1795}
1796
1797#[derive(Debug, Clone, Serialize, Deserialize)]
1799#[serde(untagged)]
1800pub enum GetEtfError {
1801 UnknownValue(serde_json::Value),
1802}
1803
1804#[derive(Debug, Clone, Serialize, Deserialize)]
1806#[serde(untagged)]
1807pub enum GetEtfsFamilyError {
1808 UnknownValue(serde_json::Value),
1809}
1810
1811#[derive(Debug, Clone, Serialize, Deserialize)]
1813#[serde(untagged)]
1814pub enum GetEtfsListError {
1815 UnknownValue(serde_json::Value),
1816}
1817
1818#[derive(Debug, Clone, Serialize, Deserialize)]
1820#[serde(untagged)]
1821pub enum GetEtfsTypeError {
1822 UnknownValue(serde_json::Value),
1823}
1824
1825#[derive(Debug, Clone, Serialize, Deserialize)]
1827#[serde(untagged)]
1828pub enum GetExchangeScheduleError {
1829 UnknownValue(serde_json::Value),
1830}
1831
1832#[derive(Debug, Clone, Serialize, Deserialize)]
1834#[serde(untagged)]
1835pub enum GetExchangesError {
1836 UnknownValue(serde_json::Value),
1837}
1838
1839#[derive(Debug, Clone, Serialize, Deserialize)]
1841#[serde(untagged)]
1842pub enum GetForexPairsError {
1843 UnknownValue(serde_json::Value),
1844}
1845
1846#[derive(Debug, Clone, Serialize, Deserialize)]
1848#[serde(untagged)]
1849pub enum GetFundsError {
1850 UnknownValue(serde_json::Value),
1851}
1852
1853#[derive(Debug, Clone, Serialize, Deserialize)]
1855#[serde(untagged)]
1856pub enum GetInstrumentTypeError {
1857 UnknownValue(serde_json::Value),
1858}
1859
1860#[derive(Debug, Clone, Serialize, Deserialize)]
1862#[serde(untagged)]
1863pub enum GetIntervalsError {
1864 UnknownValue(serde_json::Value),
1865}
1866
1867#[derive(Debug, Clone, Serialize, Deserialize)]
1869#[serde(untagged)]
1870pub enum GetMarketStateError {
1871 UnknownValue(serde_json::Value),
1872}
1873
1874#[derive(Debug, Clone, Serialize, Deserialize)]
1876#[serde(untagged)]
1877pub enum GetMutualFundsFamilyError {
1878 UnknownValue(serde_json::Value),
1879}
1880
1881#[derive(Debug, Clone, Serialize, Deserialize)]
1883#[serde(untagged)]
1884pub enum GetMutualFundsListError {
1885 UnknownValue(serde_json::Value),
1886}
1887
1888#[derive(Debug, Clone, Serialize, Deserialize)]
1890#[serde(untagged)]
1891pub enum GetMutualFundsTypeError {
1892 UnknownValue(serde_json::Value),
1893}
1894
1895#[derive(Debug, Clone, Serialize, Deserialize)]
1897#[serde(untagged)]
1898pub enum GetStocksError {
1899 UnknownValue(serde_json::Value),
1900}
1901
1902#[derive(Debug, Clone, Serialize, Deserialize)]
1904#[serde(untagged)]
1905pub enum GetSymbolSearchError {
1906 UnknownValue(serde_json::Value),
1907}
1908
1909#[derive(Debug, Clone, Serialize, Deserialize)]
1911#[serde(untagged)]
1912pub enum GetTechnicalIndicatorsError {
1913 UnknownValue(serde_json::Value),
1914}
1915
1916
1917pub async fn get_bonds(configuration: &configuration::Configuration, params: GetBondsParams) -> Result<models::GetBonds200Response, Error<GetBondsError>> {
1919 let p_query_symbol = params.symbol;
1921 let p_query_exchange = params.exchange;
1922 let p_query_country = params.country;
1923 let p_query_format = params.format;
1924 let p_query_delimiter = params.delimiter;
1925 let p_query_show_plan = params.show_plan;
1926 let p_query_page = params.page;
1927 let p_query_outputsize = params.outputsize;
1928
1929 let uri_str = format!("{}/bonds", configuration.base_path);
1930 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1931
1932 if let Some(ref param_value) = p_query_symbol {
1933 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1934 }
1935 if let Some(ref param_value) = p_query_exchange {
1936 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1937 }
1938 if let Some(ref param_value) = p_query_country {
1939 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1940 }
1941 if let Some(ref param_value) = p_query_format {
1942 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
1943 }
1944 if let Some(ref param_value) = p_query_delimiter {
1945 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1946 }
1947 if let Some(ref param_value) = p_query_show_plan {
1948 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
1949 }
1950 if let Some(ref param_value) = p_query_page {
1951 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1952 }
1953 if let Some(ref param_value) = p_query_outputsize {
1954 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1955 }
1956 if let Some(ref user_agent) = configuration.user_agent {
1957 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1958 }
1959 if let Some(ref apikey) = configuration.api_key {
1960 let key = apikey.key.clone();
1961 let value = match apikey.prefix {
1962 Some(ref prefix) => format!("{} {}", prefix, key),
1963 None => key,
1964 };
1965 req_builder = req_builder.header("Authorization", value);
1966 };
1967
1968 let req = req_builder.build()?;
1969 let resp = configuration.client.execute(req).await?;
1970
1971 let status = resp.status();
1972 let content_type = resp
1973 .headers()
1974 .get("content-type")
1975 .and_then(|v| v.to_str().ok())
1976 .unwrap_or("application/octet-stream");
1977 let content_type = super::ContentType::from(content_type);
1978
1979 if !status.is_client_error() && !status.is_server_error() {
1980 let content = resp.text().await?;
1981 match content_type {
1982 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1983 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBonds200Response`"))),
1984 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetBonds200Response`")))),
1985 }
1986 } else {
1987 let content = resp.text().await?;
1988 let entity: Option<GetBondsError> = serde_json::from_str(&content).ok();
1989 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1990 }
1991}
1992
1993pub async fn get_commodities(configuration: &configuration::Configuration, params: GetCommoditiesParams) -> Result<models::GetCommodities200Response, Error<GetCommoditiesError>> {
1995 let p_query_symbol = params.symbol;
1997 let p_query_category = params.category;
1998 let p_query_format = params.format;
1999 let p_query_delimiter = params.delimiter;
2000
2001 let uri_str = format!("{}/commodities", configuration.base_path);
2002 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2003
2004 if let Some(ref param_value) = p_query_symbol {
2005 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2006 }
2007 if let Some(ref param_value) = p_query_category {
2008 req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
2009 }
2010 if let Some(ref param_value) = p_query_format {
2011 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2012 }
2013 if let Some(ref param_value) = p_query_delimiter {
2014 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2015 }
2016 if let Some(ref user_agent) = configuration.user_agent {
2017 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2018 }
2019 if let Some(ref apikey) = configuration.api_key {
2020 let key = apikey.key.clone();
2021 let value = match apikey.prefix {
2022 Some(ref prefix) => format!("{} {}", prefix, key),
2023 None => key,
2024 };
2025 req_builder = req_builder.header("Authorization", value);
2026 };
2027
2028 let req = req_builder.build()?;
2029 let resp = configuration.client.execute(req).await?;
2030
2031 let status = resp.status();
2032 let content_type = resp
2033 .headers()
2034 .get("content-type")
2035 .and_then(|v| v.to_str().ok())
2036 .unwrap_or("application/octet-stream");
2037 let content_type = super::ContentType::from(content_type);
2038
2039 if !status.is_client_error() && !status.is_server_error() {
2040 let content = resp.text().await?;
2041 match content_type {
2042 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2043 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCommodities200Response`"))),
2044 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCommodities200Response`")))),
2045 }
2046 } else {
2047 let content = resp.text().await?;
2048 let entity: Option<GetCommoditiesError> = serde_json::from_str(&content).ok();
2049 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2050 }
2051}
2052
2053pub async fn get_countries(configuration: &configuration::Configuration) -> Result<models::GetCountries200Response, Error<GetCountriesError>> {
2055
2056 let uri_str = format!("{}/countries", configuration.base_path);
2057 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2058
2059 if let Some(ref user_agent) = configuration.user_agent {
2060 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2061 }
2062 if let Some(ref apikey) = configuration.api_key {
2063 let key = apikey.key.clone();
2064 let value = match apikey.prefix {
2065 Some(ref prefix) => format!("{} {}", prefix, key),
2066 None => key,
2067 };
2068 req_builder = req_builder.header("Authorization", value);
2069 };
2070
2071 let req = req_builder.build()?;
2072 let resp = configuration.client.execute(req).await?;
2073
2074 let status = resp.status();
2075 let content_type = resp
2076 .headers()
2077 .get("content-type")
2078 .and_then(|v| v.to_str().ok())
2079 .unwrap_or("application/octet-stream");
2080 let content_type = super::ContentType::from(content_type);
2081
2082 if !status.is_client_error() && !status.is_server_error() {
2083 let content = resp.text().await?;
2084 match content_type {
2085 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2086 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCountries200Response`"))),
2087 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCountries200Response`")))),
2088 }
2089 } else {
2090 let content = resp.text().await?;
2091 let entity: Option<GetCountriesError> = serde_json::from_str(&content).ok();
2092 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2093 }
2094}
2095
2096pub async fn get_cross_listings(configuration: &configuration::Configuration, params: GetCrossListingsParams) -> Result<models::GetCrossListings200Response, Error<GetCrossListingsError>> {
2098 let p_query_symbol = params.symbol;
2100 let p_query_exchange = params.exchange;
2101 let p_query_mic_code = params.mic_code;
2102 let p_query_country = params.country;
2103
2104 let uri_str = format!("{}/cross_listings", configuration.base_path);
2105 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2106
2107 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
2108 if let Some(ref param_value) = p_query_exchange {
2109 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2110 }
2111 if let Some(ref param_value) = p_query_mic_code {
2112 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2113 }
2114 if let Some(ref param_value) = p_query_country {
2115 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2116 }
2117 if let Some(ref user_agent) = configuration.user_agent {
2118 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2119 }
2120 if let Some(ref apikey) = configuration.api_key {
2121 let key = apikey.key.clone();
2122 let value = match apikey.prefix {
2123 Some(ref prefix) => format!("{} {}", prefix, key),
2124 None => key,
2125 };
2126 req_builder = req_builder.header("Authorization", value);
2127 };
2128
2129 let req = req_builder.build()?;
2130 let resp = configuration.client.execute(req).await?;
2131
2132 let status = resp.status();
2133 let content_type = resp
2134 .headers()
2135 .get("content-type")
2136 .and_then(|v| v.to_str().ok())
2137 .unwrap_or("application/octet-stream");
2138 let content_type = super::ContentType::from(content_type);
2139
2140 if !status.is_client_error() && !status.is_server_error() {
2141 let content = resp.text().await?;
2142 match content_type {
2143 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2144 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCrossListings200Response`"))),
2145 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCrossListings200Response`")))),
2146 }
2147 } else {
2148 let content = resp.text().await?;
2149 let entity: Option<GetCrossListingsError> = serde_json::from_str(&content).ok();
2150 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2151 }
2152}
2153
2154pub async fn get_cryptocurrencies(configuration: &configuration::Configuration, params: GetCryptocurrenciesParams) -> Result<models::GetCryptocurrencies200Response, Error<GetCryptocurrenciesError>> {
2156 let p_query_symbol = params.symbol;
2158 let p_query_exchange = params.exchange;
2159 let p_query_currency_base = params.currency_base;
2160 let p_query_currency_quote = params.currency_quote;
2161 let p_query_format = params.format;
2162 let p_query_delimiter = params.delimiter;
2163
2164 let uri_str = format!("{}/cryptocurrencies", configuration.base_path);
2165 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2166
2167 if let Some(ref param_value) = p_query_symbol {
2168 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2169 }
2170 if let Some(ref param_value) = p_query_exchange {
2171 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2172 }
2173 if let Some(ref param_value) = p_query_currency_base {
2174 req_builder = req_builder.query(&[("currency_base", ¶m_value.to_string())]);
2175 }
2176 if let Some(ref param_value) = p_query_currency_quote {
2177 req_builder = req_builder.query(&[("currency_quote", ¶m_value.to_string())]);
2178 }
2179 if let Some(ref param_value) = p_query_format {
2180 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2181 }
2182 if let Some(ref param_value) = p_query_delimiter {
2183 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2184 }
2185 if let Some(ref user_agent) = configuration.user_agent {
2186 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2187 }
2188 if let Some(ref apikey) = configuration.api_key {
2189 let key = apikey.key.clone();
2190 let value = match apikey.prefix {
2191 Some(ref prefix) => format!("{} {}", prefix, key),
2192 None => key,
2193 };
2194 req_builder = req_builder.header("Authorization", value);
2195 };
2196
2197 let req = req_builder.build()?;
2198 let resp = configuration.client.execute(req).await?;
2199
2200 let status = resp.status();
2201 let content_type = resp
2202 .headers()
2203 .get("content-type")
2204 .and_then(|v| v.to_str().ok())
2205 .unwrap_or("application/octet-stream");
2206 let content_type = super::ContentType::from(content_type);
2207
2208 if !status.is_client_error() && !status.is_server_error() {
2209 let content = resp.text().await?;
2210 match content_type {
2211 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2212 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCryptocurrencies200Response`"))),
2213 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCryptocurrencies200Response`")))),
2214 }
2215 } else {
2216 let content = resp.text().await?;
2217 let entity: Option<GetCryptocurrenciesError> = serde_json::from_str(&content).ok();
2218 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2219 }
2220}
2221
2222pub async fn get_cryptocurrency_exchanges(configuration: &configuration::Configuration, params: GetCryptocurrencyExchangesParams) -> Result<models::GetCryptocurrencyExchanges200Response, Error<GetCryptocurrencyExchangesError>> {
2224 let p_query_format = params.format;
2226 let p_query_delimiter = params.delimiter;
2227
2228 let uri_str = format!("{}/cryptocurrency_exchanges", configuration.base_path);
2229 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2230
2231 if let Some(ref param_value) = p_query_format {
2232 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2233 }
2234 if let Some(ref param_value) = p_query_delimiter {
2235 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2236 }
2237 if let Some(ref user_agent) = configuration.user_agent {
2238 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2239 }
2240 if let Some(ref apikey) = configuration.api_key {
2241 let key = apikey.key.clone();
2242 let value = match apikey.prefix {
2243 Some(ref prefix) => format!("{} {}", prefix, key),
2244 None => key,
2245 };
2246 req_builder = req_builder.header("Authorization", value);
2247 };
2248
2249 let req = req_builder.build()?;
2250 let resp = configuration.client.execute(req).await?;
2251
2252 let status = resp.status();
2253 let content_type = resp
2254 .headers()
2255 .get("content-type")
2256 .and_then(|v| v.to_str().ok())
2257 .unwrap_or("application/octet-stream");
2258 let content_type = super::ContentType::from(content_type);
2259
2260 if !status.is_client_error() && !status.is_server_error() {
2261 let content = resp.text().await?;
2262 match content_type {
2263 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2264 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCryptocurrencyExchanges200Response`"))),
2265 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCryptocurrencyExchanges200Response`")))),
2266 }
2267 } else {
2268 let content = resp.text().await?;
2269 let entity: Option<GetCryptocurrencyExchangesError> = serde_json::from_str(&content).ok();
2270 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2271 }
2272}
2273
2274pub async fn get_earliest_timestamp(configuration: &configuration::Configuration, params: GetEarliestTimestampParams) -> Result<models::GetEarliestTimestamp200Response, Error<GetEarliestTimestampError>> {
2276 let p_query_interval = params.interval;
2278 let p_query_symbol = params.symbol;
2279 let p_query_figi = params.figi;
2280 let p_query_isin = params.isin;
2281 let p_query_cusip = params.cusip;
2282 let p_query_exchange = params.exchange;
2283 let p_query_mic_code = params.mic_code;
2284 let p_query_timezone = params.timezone;
2285
2286 let uri_str = format!("{}/earliest_timestamp", configuration.base_path);
2287 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2288
2289 if let Some(ref param_value) = p_query_symbol {
2290 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2291 }
2292 if let Some(ref param_value) = p_query_figi {
2293 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2294 }
2295 if let Some(ref param_value) = p_query_isin {
2296 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2297 }
2298 if let Some(ref param_value) = p_query_cusip {
2299 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2300 }
2301 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
2302 if let Some(ref param_value) = p_query_exchange {
2303 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2304 }
2305 if let Some(ref param_value) = p_query_mic_code {
2306 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2307 }
2308 if let Some(ref param_value) = p_query_timezone {
2309 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
2310 }
2311 if let Some(ref user_agent) = configuration.user_agent {
2312 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2313 }
2314 if let Some(ref apikey) = configuration.api_key {
2315 let key = apikey.key.clone();
2316 let value = match apikey.prefix {
2317 Some(ref prefix) => format!("{} {}", prefix, key),
2318 None => key,
2319 };
2320 req_builder = req_builder.header("Authorization", value);
2321 };
2322
2323 let req = req_builder.build()?;
2324 let resp = configuration.client.execute(req).await?;
2325
2326 let status = resp.status();
2327 let content_type = resp
2328 .headers()
2329 .get("content-type")
2330 .and_then(|v| v.to_str().ok())
2331 .unwrap_or("application/octet-stream");
2332 let content_type = super::ContentType::from(content_type);
2333
2334 if !status.is_client_error() && !status.is_server_error() {
2335 let content = resp.text().await?;
2336 match content_type {
2337 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2338 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEarliestTimestamp200Response`"))),
2339 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEarliestTimestamp200Response`")))),
2340 }
2341 } else {
2342 let content = resp.text().await?;
2343 let entity: Option<GetEarliestTimestampError> = serde_json::from_str(&content).ok();
2344 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2345 }
2346}
2347
2348pub async fn get_etf(configuration: &configuration::Configuration, params: GetEtfParams) -> Result<models::GetEtf200Response, Error<GetEtfError>> {
2350 let p_query_symbol = params.symbol;
2352 let p_query_figi = params.figi;
2353 let p_query_isin = params.isin;
2354 let p_query_cusip = params.cusip;
2355 let p_query_cik = params.cik;
2356 let p_query_exchange = params.exchange;
2357 let p_query_mic_code = params.mic_code;
2358 let p_query_country = params.country;
2359 let p_query_format = params.format;
2360 let p_query_delimiter = params.delimiter;
2361 let p_query_show_plan = params.show_plan;
2362 let p_query_include_delisted = params.include_delisted;
2363
2364 let uri_str = format!("{}/etfs", configuration.base_path);
2365 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2366
2367 if let Some(ref param_value) = p_query_symbol {
2368 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2369 }
2370 if let Some(ref param_value) = p_query_figi {
2371 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2372 }
2373 if let Some(ref param_value) = p_query_isin {
2374 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2375 }
2376 if let Some(ref param_value) = p_query_cusip {
2377 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2378 }
2379 if let Some(ref param_value) = p_query_cik {
2380 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2381 }
2382 if let Some(ref param_value) = p_query_exchange {
2383 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2384 }
2385 if let Some(ref param_value) = p_query_mic_code {
2386 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2387 }
2388 if let Some(ref param_value) = p_query_country {
2389 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2390 }
2391 if let Some(ref param_value) = p_query_format {
2392 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2393 }
2394 if let Some(ref param_value) = p_query_delimiter {
2395 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2396 }
2397 if let Some(ref param_value) = p_query_show_plan {
2398 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2399 }
2400 if let Some(ref param_value) = p_query_include_delisted {
2401 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
2402 }
2403 if let Some(ref user_agent) = configuration.user_agent {
2404 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2405 }
2406 if let Some(ref apikey) = configuration.api_key {
2407 let key = apikey.key.clone();
2408 let value = match apikey.prefix {
2409 Some(ref prefix) => format!("{} {}", prefix, key),
2410 None => key,
2411 };
2412 req_builder = req_builder.header("Authorization", value);
2413 };
2414
2415 let req = req_builder.build()?;
2416 let resp = configuration.client.execute(req).await?;
2417
2418 let status = resp.status();
2419 let content_type = resp
2420 .headers()
2421 .get("content-type")
2422 .and_then(|v| v.to_str().ok())
2423 .unwrap_or("application/octet-stream");
2424 let content_type = super::ContentType::from(content_type);
2425
2426 if !status.is_client_error() && !status.is_server_error() {
2427 let content = resp.text().await?;
2428 match content_type {
2429 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2430 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtf200Response`"))),
2431 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEtf200Response`")))),
2432 }
2433 } else {
2434 let content = resp.text().await?;
2435 let entity: Option<GetEtfError> = serde_json::from_str(&content).ok();
2436 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2437 }
2438}
2439
2440pub async fn get_etfs_family(configuration: &configuration::Configuration, params: GetEtfsFamilyParams) -> Result<models::GetEtfsFamily200Response, Error<GetEtfsFamilyError>> {
2442 let p_query_country = params.country;
2444 let p_query_fund_family = params.fund_family;
2445
2446 let uri_str = format!("{}/etfs/family", configuration.base_path);
2447 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2448
2449 if let Some(ref param_value) = p_query_country {
2450 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2451 }
2452 if let Some(ref param_value) = p_query_fund_family {
2453 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2454 }
2455 if let Some(ref user_agent) = configuration.user_agent {
2456 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2457 }
2458 if let Some(ref apikey) = configuration.api_key {
2459 let key = apikey.key.clone();
2460 let value = match apikey.prefix {
2461 Some(ref prefix) => format!("{} {}", prefix, key),
2462 None => key,
2463 };
2464 req_builder = req_builder.header("Authorization", value);
2465 };
2466
2467 let req = req_builder.build()?;
2468 let resp = configuration.client.execute(req).await?;
2469
2470 let status = resp.status();
2471 let content_type = resp
2472 .headers()
2473 .get("content-type")
2474 .and_then(|v| v.to_str().ok())
2475 .unwrap_or("application/octet-stream");
2476 let content_type = super::ContentType::from(content_type);
2477
2478 if !status.is_client_error() && !status.is_server_error() {
2479 let content = resp.text().await?;
2480 match content_type {
2481 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2482 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsFamily200Response`"))),
2483 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEtfsFamily200Response`")))),
2484 }
2485 } else {
2486 let content = resp.text().await?;
2487 let entity: Option<GetEtfsFamilyError> = serde_json::from_str(&content).ok();
2488 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2489 }
2490}
2491
2492pub async fn get_etfs_list(configuration: &configuration::Configuration, params: GetEtfsListParams) -> Result<models::GetEtfsList200Response, Error<GetEtfsListError>> {
2494 let p_query_symbol = params.symbol;
2496 let p_query_figi = params.figi;
2497 let p_query_isin = params.isin;
2498 let p_query_cusip = params.cusip;
2499 let p_query_cik = params.cik;
2500 let p_query_country = params.country;
2501 let p_query_fund_family = params.fund_family;
2502 let p_query_fund_type = params.fund_type;
2503 let p_query_page = params.page;
2504 let p_query_outputsize = params.outputsize;
2505
2506 let uri_str = format!("{}/etfs/list", configuration.base_path);
2507 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2508
2509 if let Some(ref param_value) = p_query_symbol {
2510 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2511 }
2512 if let Some(ref param_value) = p_query_figi {
2513 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2514 }
2515 if let Some(ref param_value) = p_query_isin {
2516 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2517 }
2518 if let Some(ref param_value) = p_query_cusip {
2519 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2520 }
2521 if let Some(ref param_value) = p_query_cik {
2522 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2523 }
2524 if let Some(ref param_value) = p_query_country {
2525 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2526 }
2527 if let Some(ref param_value) = p_query_fund_family {
2528 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2529 }
2530 if let Some(ref param_value) = p_query_fund_type {
2531 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2532 }
2533 if let Some(ref param_value) = p_query_page {
2534 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2535 }
2536 if let Some(ref param_value) = p_query_outputsize {
2537 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2538 }
2539 if let Some(ref user_agent) = configuration.user_agent {
2540 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2541 }
2542 if let Some(ref apikey) = configuration.api_key {
2543 let key = apikey.key.clone();
2544 let value = match apikey.prefix {
2545 Some(ref prefix) => format!("{} {}", prefix, key),
2546 None => key,
2547 };
2548 req_builder = req_builder.header("Authorization", value);
2549 };
2550
2551 let req = req_builder.build()?;
2552 let resp = configuration.client.execute(req).await?;
2553
2554 let status = resp.status();
2555 let content_type = resp
2556 .headers()
2557 .get("content-type")
2558 .and_then(|v| v.to_str().ok())
2559 .unwrap_or("application/octet-stream");
2560 let content_type = super::ContentType::from(content_type);
2561
2562 if !status.is_client_error() && !status.is_server_error() {
2563 let content = resp.text().await?;
2564 match content_type {
2565 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2566 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsList200Response`"))),
2567 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEtfsList200Response`")))),
2568 }
2569 } else {
2570 let content = resp.text().await?;
2571 let entity: Option<GetEtfsListError> = serde_json::from_str(&content).ok();
2572 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2573 }
2574}
2575
2576pub async fn get_etfs_type(configuration: &configuration::Configuration, params: GetEtfsTypeParams) -> Result<models::GetEtfsType200Response, Error<GetEtfsTypeError>> {
2578 let p_query_country = params.country;
2580 let p_query_fund_type = params.fund_type;
2581
2582 let uri_str = format!("{}/etfs/type", configuration.base_path);
2583 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2584
2585 if let Some(ref param_value) = p_query_country {
2586 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2587 }
2588 if let Some(ref param_value) = p_query_fund_type {
2589 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2590 }
2591 if let Some(ref user_agent) = configuration.user_agent {
2592 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2593 }
2594 if let Some(ref apikey) = configuration.api_key {
2595 let key = apikey.key.clone();
2596 let value = match apikey.prefix {
2597 Some(ref prefix) => format!("{} {}", prefix, key),
2598 None => key,
2599 };
2600 req_builder = req_builder.header("Authorization", value);
2601 };
2602
2603 let req = req_builder.build()?;
2604 let resp = configuration.client.execute(req).await?;
2605
2606 let status = resp.status();
2607 let content_type = resp
2608 .headers()
2609 .get("content-type")
2610 .and_then(|v| v.to_str().ok())
2611 .unwrap_or("application/octet-stream");
2612 let content_type = super::ContentType::from(content_type);
2613
2614 if !status.is_client_error() && !status.is_server_error() {
2615 let content = resp.text().await?;
2616 match content_type {
2617 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2618 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEtfsType200Response`"))),
2619 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEtfsType200Response`")))),
2620 }
2621 } else {
2622 let content = resp.text().await?;
2623 let entity: Option<GetEtfsTypeError> = serde_json::from_str(&content).ok();
2624 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2625 }
2626}
2627
2628pub async fn get_exchange_schedule(configuration: &configuration::Configuration, params: GetExchangeScheduleParams) -> Result<models::GetExchangeSchedule200Response, Error<GetExchangeScheduleError>> {
2630 let p_query_mic_name = params.mic_name;
2632 let p_query_mic_code = params.mic_code;
2633 let p_query_country = params.country;
2634 let p_query_date = params.date;
2635
2636 let uri_str = format!("{}/exchange_schedule", configuration.base_path);
2637 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2638
2639 if let Some(ref param_value) = p_query_mic_name {
2640 req_builder = req_builder.query(&[("mic_name", ¶m_value.to_string())]);
2641 }
2642 if let Some(ref param_value) = p_query_mic_code {
2643 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2644 }
2645 if let Some(ref param_value) = p_query_country {
2646 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2647 }
2648 if let Some(ref param_value) = p_query_date {
2649 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
2650 }
2651 if let Some(ref user_agent) = configuration.user_agent {
2652 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2653 }
2654 if let Some(ref apikey) = configuration.api_key {
2655 let key = apikey.key.clone();
2656 let value = match apikey.prefix {
2657 Some(ref prefix) => format!("{} {}", prefix, key),
2658 None => key,
2659 };
2660 req_builder = req_builder.header("Authorization", value);
2661 };
2662
2663 let req = req_builder.build()?;
2664 let resp = configuration.client.execute(req).await?;
2665
2666 let status = resp.status();
2667 let content_type = resp
2668 .headers()
2669 .get("content-type")
2670 .and_then(|v| v.to_str().ok())
2671 .unwrap_or("application/octet-stream");
2672 let content_type = super::ContentType::from(content_type);
2673
2674 if !status.is_client_error() && !status.is_server_error() {
2675 let content = resp.text().await?;
2676 match content_type {
2677 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2678 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchangeSchedule200Response`"))),
2679 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExchangeSchedule200Response`")))),
2680 }
2681 } else {
2682 let content = resp.text().await?;
2683 let entity: Option<GetExchangeScheduleError> = serde_json::from_str(&content).ok();
2684 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2685 }
2686}
2687
2688pub async fn get_exchanges(configuration: &configuration::Configuration, params: GetExchangesParams) -> Result<models::GetExchanges200Response, Error<GetExchangesError>> {
2690 let p_query_type = params.r#type;
2692 let p_query_name = params.name;
2693 let p_query_code = params.code;
2694 let p_query_country = params.country;
2695 let p_query_format = params.format;
2696 let p_query_delimiter = params.delimiter;
2697 let p_query_show_plan = params.show_plan;
2698
2699 let uri_str = format!("{}/exchanges", configuration.base_path);
2700 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2701
2702 if let Some(ref param_value) = p_query_type {
2703 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
2704 }
2705 if let Some(ref param_value) = p_query_name {
2706 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2707 }
2708 if let Some(ref param_value) = p_query_code {
2709 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
2710 }
2711 if let Some(ref param_value) = p_query_country {
2712 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2713 }
2714 if let Some(ref param_value) = p_query_format {
2715 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2716 }
2717 if let Some(ref param_value) = p_query_delimiter {
2718 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2719 }
2720 if let Some(ref param_value) = p_query_show_plan {
2721 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2722 }
2723 if let Some(ref user_agent) = configuration.user_agent {
2724 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2725 }
2726 if let Some(ref apikey) = configuration.api_key {
2727 let key = apikey.key.clone();
2728 let value = match apikey.prefix {
2729 Some(ref prefix) => format!("{} {}", prefix, key),
2730 None => key,
2731 };
2732 req_builder = req_builder.header("Authorization", value);
2733 };
2734
2735 let req = req_builder.build()?;
2736 let resp = configuration.client.execute(req).await?;
2737
2738 let status = resp.status();
2739 let content_type = resp
2740 .headers()
2741 .get("content-type")
2742 .and_then(|v| v.to_str().ok())
2743 .unwrap_or("application/octet-stream");
2744 let content_type = super::ContentType::from(content_type);
2745
2746 if !status.is_client_error() && !status.is_server_error() {
2747 let content = resp.text().await?;
2748 match content_type {
2749 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2750 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExchanges200Response`"))),
2751 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExchanges200Response`")))),
2752 }
2753 } else {
2754 let content = resp.text().await?;
2755 let entity: Option<GetExchangesError> = serde_json::from_str(&content).ok();
2756 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2757 }
2758}
2759
2760pub async fn get_forex_pairs(configuration: &configuration::Configuration, params: GetForexPairsParams) -> Result<models::GetForexPairs200Response, Error<GetForexPairsError>> {
2762 let p_query_symbol = params.symbol;
2764 let p_query_currency_base = params.currency_base;
2765 let p_query_currency_quote = params.currency_quote;
2766 let p_query_format = params.format;
2767 let p_query_delimiter = params.delimiter;
2768
2769 let uri_str = format!("{}/forex_pairs", configuration.base_path);
2770 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2771
2772 if let Some(ref param_value) = p_query_symbol {
2773 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2774 }
2775 if let Some(ref param_value) = p_query_currency_base {
2776 req_builder = req_builder.query(&[("currency_base", ¶m_value.to_string())]);
2777 }
2778 if let Some(ref param_value) = p_query_currency_quote {
2779 req_builder = req_builder.query(&[("currency_quote", ¶m_value.to_string())]);
2780 }
2781 if let Some(ref param_value) = p_query_format {
2782 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2783 }
2784 if let Some(ref param_value) = p_query_delimiter {
2785 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2786 }
2787 if let Some(ref user_agent) = configuration.user_agent {
2788 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2789 }
2790 if let Some(ref apikey) = configuration.api_key {
2791 let key = apikey.key.clone();
2792 let value = match apikey.prefix {
2793 Some(ref prefix) => format!("{} {}", prefix, key),
2794 None => key,
2795 };
2796 req_builder = req_builder.header("Authorization", value);
2797 };
2798
2799 let req = req_builder.build()?;
2800 let resp = configuration.client.execute(req).await?;
2801
2802 let status = resp.status();
2803 let content_type = resp
2804 .headers()
2805 .get("content-type")
2806 .and_then(|v| v.to_str().ok())
2807 .unwrap_or("application/octet-stream");
2808 let content_type = super::ContentType::from(content_type);
2809
2810 if !status.is_client_error() && !status.is_server_error() {
2811 let content = resp.text().await?;
2812 match content_type {
2813 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2814 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetForexPairs200Response`"))),
2815 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetForexPairs200Response`")))),
2816 }
2817 } else {
2818 let content = resp.text().await?;
2819 let entity: Option<GetForexPairsError> = serde_json::from_str(&content).ok();
2820 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2821 }
2822}
2823
2824pub async fn get_funds(configuration: &configuration::Configuration, params: GetFundsParams) -> Result<models::GetFunds200Response, Error<GetFundsError>> {
2826 let p_query_symbol = params.symbol;
2828 let p_query_figi = params.figi;
2829 let p_query_isin = params.isin;
2830 let p_query_cusip = params.cusip;
2831 let p_query_cik = params.cik;
2832 let p_query_exchange = params.exchange;
2833 let p_query_country = params.country;
2834 let p_query_format = params.format;
2835 let p_query_delimiter = params.delimiter;
2836 let p_query_show_plan = params.show_plan;
2837 let p_query_page = params.page;
2838 let p_query_outputsize = params.outputsize;
2839
2840 let uri_str = format!("{}/funds", configuration.base_path);
2841 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2842
2843 if let Some(ref param_value) = p_query_symbol {
2844 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2845 }
2846 if let Some(ref param_value) = p_query_figi {
2847 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2848 }
2849 if let Some(ref param_value) = p_query_isin {
2850 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2851 }
2852 if let Some(ref param_value) = p_query_cusip {
2853 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2854 }
2855 if let Some(ref param_value) = p_query_cik {
2856 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2857 }
2858 if let Some(ref param_value) = p_query_exchange {
2859 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2860 }
2861 if let Some(ref param_value) = p_query_country {
2862 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2863 }
2864 if let Some(ref param_value) = p_query_format {
2865 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
2866 }
2867 if let Some(ref param_value) = p_query_delimiter {
2868 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2869 }
2870 if let Some(ref param_value) = p_query_show_plan {
2871 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2872 }
2873 if let Some(ref param_value) = p_query_page {
2874 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2875 }
2876 if let Some(ref param_value) = p_query_outputsize {
2877 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2878 }
2879 if let Some(ref user_agent) = configuration.user_agent {
2880 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2881 }
2882 if let Some(ref apikey) = configuration.api_key {
2883 let key = apikey.key.clone();
2884 let value = match apikey.prefix {
2885 Some(ref prefix) => format!("{} {}", prefix, key),
2886 None => key,
2887 };
2888 req_builder = req_builder.header("Authorization", value);
2889 };
2890
2891 let req = req_builder.build()?;
2892 let resp = configuration.client.execute(req).await?;
2893
2894 let status = resp.status();
2895 let content_type = resp
2896 .headers()
2897 .get("content-type")
2898 .and_then(|v| v.to_str().ok())
2899 .unwrap_or("application/octet-stream");
2900 let content_type = super::ContentType::from(content_type);
2901
2902 if !status.is_client_error() && !status.is_server_error() {
2903 let content = resp.text().await?;
2904 match content_type {
2905 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2906 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetFunds200Response`"))),
2907 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetFunds200Response`")))),
2908 }
2909 } else {
2910 let content = resp.text().await?;
2911 let entity: Option<GetFundsError> = serde_json::from_str(&content).ok();
2912 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2913 }
2914}
2915
2916pub async fn get_instrument_type(configuration: &configuration::Configuration) -> Result<models::GetInstrumentType200Response, Error<GetInstrumentTypeError>> {
2918
2919 let uri_str = format!("{}/instrument_type", configuration.base_path);
2920 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2921
2922 if let Some(ref user_agent) = configuration.user_agent {
2923 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2924 }
2925 if let Some(ref apikey) = configuration.api_key {
2926 let key = apikey.key.clone();
2927 let value = match apikey.prefix {
2928 Some(ref prefix) => format!("{} {}", prefix, key),
2929 None => key,
2930 };
2931 req_builder = req_builder.header("Authorization", value);
2932 };
2933
2934 let req = req_builder.build()?;
2935 let resp = configuration.client.execute(req).await?;
2936
2937 let status = resp.status();
2938 let content_type = resp
2939 .headers()
2940 .get("content-type")
2941 .and_then(|v| v.to_str().ok())
2942 .unwrap_or("application/octet-stream");
2943 let content_type = super::ContentType::from(content_type);
2944
2945 if !status.is_client_error() && !status.is_server_error() {
2946 let content = resp.text().await?;
2947 match content_type {
2948 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2949 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetInstrumentType200Response`"))),
2950 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetInstrumentType200Response`")))),
2951 }
2952 } else {
2953 let content = resp.text().await?;
2954 let entity: Option<GetInstrumentTypeError> = serde_json::from_str(&content).ok();
2955 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2956 }
2957}
2958
2959pub async fn get_intervals(configuration: &configuration::Configuration) -> Result<models::GetIntervals200Response, Error<GetIntervalsError>> {
2961
2962 let uri_str = format!("{}/intervals", configuration.base_path);
2963 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2964
2965 if let Some(ref user_agent) = configuration.user_agent {
2966 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2967 }
2968 if let Some(ref apikey) = configuration.api_key {
2969 let key = apikey.key.clone();
2970 let value = match apikey.prefix {
2971 Some(ref prefix) => format!("{} {}", prefix, key),
2972 None => key,
2973 };
2974 req_builder = req_builder.header("Authorization", value);
2975 };
2976
2977 let req = req_builder.build()?;
2978 let resp = configuration.client.execute(req).await?;
2979
2980 let status = resp.status();
2981 let content_type = resp
2982 .headers()
2983 .get("content-type")
2984 .and_then(|v| v.to_str().ok())
2985 .unwrap_or("application/octet-stream");
2986 let content_type = super::ContentType::from(content_type);
2987
2988 if !status.is_client_error() && !status.is_server_error() {
2989 let content = resp.text().await?;
2990 match content_type {
2991 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2992 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetIntervals200Response`"))),
2993 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetIntervals200Response`")))),
2994 }
2995 } else {
2996 let content = resp.text().await?;
2997 let entity: Option<GetIntervalsError> = serde_json::from_str(&content).ok();
2998 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2999 }
3000}
3001
3002pub async fn get_market_state(configuration: &configuration::Configuration, params: GetMarketStateParams) -> Result<Vec<models::MarketStateResponseItem>, Error<GetMarketStateError>> {
3004 let p_query_exchange = params.exchange;
3006 let p_query_code = params.code;
3007 let p_query_country = params.country;
3008
3009 let uri_str = format!("{}/market_state", configuration.base_path);
3010 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3011
3012 if let Some(ref param_value) = p_query_exchange {
3013 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3014 }
3015 if let Some(ref param_value) = p_query_code {
3016 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
3017 }
3018 if let Some(ref param_value) = p_query_country {
3019 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3020 }
3021 if let Some(ref user_agent) = configuration.user_agent {
3022 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3023 }
3024 if let Some(ref apikey) = configuration.api_key {
3025 let key = apikey.key.clone();
3026 let value = match apikey.prefix {
3027 Some(ref prefix) => format!("{} {}", prefix, key),
3028 None => key,
3029 };
3030 req_builder = req_builder.header("Authorization", value);
3031 };
3032
3033 let req = req_builder.build()?;
3034 let resp = configuration.client.execute(req).await?;
3035
3036 let status = resp.status();
3037 let content_type = resp
3038 .headers()
3039 .get("content-type")
3040 .and_then(|v| v.to_str().ok())
3041 .unwrap_or("application/octet-stream");
3042 let content_type = super::ContentType::from(content_type);
3043
3044 if !status.is_client_error() && !status.is_server_error() {
3045 let content = resp.text().await?;
3046 match content_type {
3047 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3048 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::MarketStateResponseItem>`"))),
3049 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::MarketStateResponseItem>`")))),
3050 }
3051 } else {
3052 let content = resp.text().await?;
3053 let entity: Option<GetMarketStateError> = serde_json::from_str(&content).ok();
3054 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3055 }
3056}
3057
3058pub async fn get_mutual_funds_family(configuration: &configuration::Configuration, params: GetMutualFundsFamilyParams) -> Result<models::GetMutualFundsFamily200Response, Error<GetMutualFundsFamilyError>> {
3060 let p_query_fund_family = params.fund_family;
3062 let p_query_country = params.country;
3063
3064 let uri_str = format!("{}/mutual_funds/family", configuration.base_path);
3065 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3066
3067 if let Some(ref param_value) = p_query_fund_family {
3068 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3069 }
3070 if let Some(ref param_value) = p_query_country {
3071 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3072 }
3073 if let Some(ref user_agent) = configuration.user_agent {
3074 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3075 }
3076 if let Some(ref apikey) = configuration.api_key {
3077 let key = apikey.key.clone();
3078 let value = match apikey.prefix {
3079 Some(ref prefix) => format!("{} {}", prefix, key),
3080 None => key,
3081 };
3082 req_builder = req_builder.header("Authorization", value);
3083 };
3084
3085 let req = req_builder.build()?;
3086 let resp = configuration.client.execute(req).await?;
3087
3088 let status = resp.status();
3089 let content_type = resp
3090 .headers()
3091 .get("content-type")
3092 .and_then(|v| v.to_str().ok())
3093 .unwrap_or("application/octet-stream");
3094 let content_type = super::ContentType::from(content_type);
3095
3096 if !status.is_client_error() && !status.is_server_error() {
3097 let content = resp.text().await?;
3098 match content_type {
3099 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3100 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsFamily200Response`"))),
3101 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMutualFundsFamily200Response`")))),
3102 }
3103 } else {
3104 let content = resp.text().await?;
3105 let entity: Option<GetMutualFundsFamilyError> = serde_json::from_str(&content).ok();
3106 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3107 }
3108}
3109
3110pub async fn get_mutual_funds_list(configuration: &configuration::Configuration, params: GetMutualFundsListParams) -> Result<models::GetMutualFundsList200Response, Error<GetMutualFundsListError>> {
3112 let p_query_symbol = params.symbol;
3114 let p_query_figi = params.figi;
3115 let p_query_isin = params.isin;
3116 let p_query_cusip = params.cusip;
3117 let p_query_cik = params.cik;
3118 let p_query_country = params.country;
3119 let p_query_fund_family = params.fund_family;
3120 let p_query_fund_type = params.fund_type;
3121 let p_query_performance_rating = params.performance_rating;
3122 let p_query_risk_rating = params.risk_rating;
3123 let p_query_page = params.page;
3124 let p_query_outputsize = params.outputsize;
3125
3126 let uri_str = format!("{}/mutual_funds/list", configuration.base_path);
3127 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3128
3129 if let Some(ref param_value) = p_query_symbol {
3130 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3131 }
3132 if let Some(ref param_value) = p_query_figi {
3133 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3134 }
3135 if let Some(ref param_value) = p_query_isin {
3136 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3137 }
3138 if let Some(ref param_value) = p_query_cusip {
3139 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3140 }
3141 if let Some(ref param_value) = p_query_cik {
3142 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3143 }
3144 if let Some(ref param_value) = p_query_country {
3145 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3146 }
3147 if let Some(ref param_value) = p_query_fund_family {
3148 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3149 }
3150 if let Some(ref param_value) = p_query_fund_type {
3151 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3152 }
3153 if let Some(ref param_value) = p_query_performance_rating {
3154 req_builder = req_builder.query(&[("performance_rating", ¶m_value.to_string())]);
3155 }
3156 if let Some(ref param_value) = p_query_risk_rating {
3157 req_builder = req_builder.query(&[("risk_rating", ¶m_value.to_string())]);
3158 }
3159 if let Some(ref param_value) = p_query_page {
3160 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3161 }
3162 if let Some(ref param_value) = p_query_outputsize {
3163 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3164 }
3165 if let Some(ref user_agent) = configuration.user_agent {
3166 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3167 }
3168 if let Some(ref apikey) = configuration.api_key {
3169 let key = apikey.key.clone();
3170 let value = match apikey.prefix {
3171 Some(ref prefix) => format!("{} {}", prefix, key),
3172 None => key,
3173 };
3174 req_builder = req_builder.header("Authorization", value);
3175 };
3176
3177 let req = req_builder.build()?;
3178 let resp = configuration.client.execute(req).await?;
3179
3180 let status = resp.status();
3181 let content_type = resp
3182 .headers()
3183 .get("content-type")
3184 .and_then(|v| v.to_str().ok())
3185 .unwrap_or("application/octet-stream");
3186 let content_type = super::ContentType::from(content_type);
3187
3188 if !status.is_client_error() && !status.is_server_error() {
3189 let content = resp.text().await?;
3190 match content_type {
3191 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3192 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsList200Response`"))),
3193 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMutualFundsList200Response`")))),
3194 }
3195 } else {
3196 let content = resp.text().await?;
3197 let entity: Option<GetMutualFundsListError> = serde_json::from_str(&content).ok();
3198 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3199 }
3200}
3201
3202pub async fn get_mutual_funds_type(configuration: &configuration::Configuration, params: GetMutualFundsTypeParams) -> Result<models::GetMutualFundsType200Response, Error<GetMutualFundsTypeError>> {
3204 let p_query_fund_type = params.fund_type;
3206 let p_query_country = params.country;
3207
3208 let uri_str = format!("{}/mutual_funds/type", configuration.base_path);
3209 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3210
3211 if let Some(ref param_value) = p_query_fund_type {
3212 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3213 }
3214 if let Some(ref param_value) = p_query_country {
3215 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3216 }
3217 if let Some(ref user_agent) = configuration.user_agent {
3218 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3219 }
3220 if let Some(ref apikey) = configuration.api_key {
3221 let key = apikey.key.clone();
3222 let value = match apikey.prefix {
3223 Some(ref prefix) => format!("{} {}", prefix, key),
3224 None => key,
3225 };
3226 req_builder = req_builder.header("Authorization", value);
3227 };
3228
3229 let req = req_builder.build()?;
3230 let resp = configuration.client.execute(req).await?;
3231
3232 let status = resp.status();
3233 let content_type = resp
3234 .headers()
3235 .get("content-type")
3236 .and_then(|v| v.to_str().ok())
3237 .unwrap_or("application/octet-stream");
3238 let content_type = super::ContentType::from(content_type);
3239
3240 if !status.is_client_error() && !status.is_server_error() {
3241 let content = resp.text().await?;
3242 match content_type {
3243 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3244 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMutualFundsType200Response`"))),
3245 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMutualFundsType200Response`")))),
3246 }
3247 } else {
3248 let content = resp.text().await?;
3249 let entity: Option<GetMutualFundsTypeError> = serde_json::from_str(&content).ok();
3250 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3251 }
3252}
3253
3254pub async fn get_stocks(configuration: &configuration::Configuration, params: GetStocksParams) -> Result<models::GetStocks200Response, Error<GetStocksError>> {
3256 let p_query_symbol = params.symbol;
3258 let p_query_figi = params.figi;
3259 let p_query_isin = params.isin;
3260 let p_query_cusip = params.cusip;
3261 let p_query_cik = params.cik;
3262 let p_query_exchange = params.exchange;
3263 let p_query_mic_code = params.mic_code;
3264 let p_query_country = params.country;
3265 let p_query_type = params.r#type;
3266 let p_query_format = params.format;
3267 let p_query_delimiter = params.delimiter;
3268 let p_query_show_plan = params.show_plan;
3269 let p_query_include_delisted = params.include_delisted;
3270
3271 let uri_str = format!("{}/stocks", configuration.base_path);
3272 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3273
3274 if let Some(ref param_value) = p_query_symbol {
3275 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3276 }
3277 if let Some(ref param_value) = p_query_figi {
3278 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3279 }
3280 if let Some(ref param_value) = p_query_isin {
3281 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3282 }
3283 if let Some(ref param_value) = p_query_cusip {
3284 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3285 }
3286 if let Some(ref param_value) = p_query_cik {
3287 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3288 }
3289 if let Some(ref param_value) = p_query_exchange {
3290 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3291 }
3292 if let Some(ref param_value) = p_query_mic_code {
3293 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
3294 }
3295 if let Some(ref param_value) = p_query_country {
3296 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3297 }
3298 if let Some(ref param_value) = p_query_type {
3299 req_builder = req_builder.query(&[("type", &serde_json::to_string(param_value)?)]);
3300 }
3301 if let Some(ref param_value) = p_query_format {
3302 req_builder = req_builder.query(&[("format", &serde_json::to_string(param_value)?)]);
3303 }
3304 if let Some(ref param_value) = p_query_delimiter {
3305 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
3306 }
3307 if let Some(ref param_value) = p_query_show_plan {
3308 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3309 }
3310 if let Some(ref param_value) = p_query_include_delisted {
3311 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
3312 }
3313 if let Some(ref user_agent) = configuration.user_agent {
3314 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3315 }
3316 if let Some(ref apikey) = configuration.api_key {
3317 let key = apikey.key.clone();
3318 let value = match apikey.prefix {
3319 Some(ref prefix) => format!("{} {}", prefix, key),
3320 None => key,
3321 };
3322 req_builder = req_builder.header("Authorization", value);
3323 };
3324
3325 let req = req_builder.build()?;
3326 let resp = configuration.client.execute(req).await?;
3327
3328 let status = resp.status();
3329 let content_type = resp
3330 .headers()
3331 .get("content-type")
3332 .and_then(|v| v.to_str().ok())
3333 .unwrap_or("application/octet-stream");
3334 let content_type = super::ContentType::from(content_type);
3335
3336 if !status.is_client_error() && !status.is_server_error() {
3337 let content = resp.text().await?;
3338 match content_type {
3339 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3340 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetStocks200Response`"))),
3341 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetStocks200Response`")))),
3342 }
3343 } else {
3344 let content = resp.text().await?;
3345 let entity: Option<GetStocksError> = serde_json::from_str(&content).ok();
3346 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3347 }
3348}
3349
3350pub async fn get_symbol_search(configuration: &configuration::Configuration, params: GetSymbolSearchParams) -> Result<models::GetSymbolSearch200Response, Error<GetSymbolSearchError>> {
3352 let p_query_symbol = params.symbol;
3354 let p_query_outputsize = params.outputsize;
3355 let p_query_show_plan = params.show_plan;
3356
3357 let uri_str = format!("{}/symbol_search", configuration.base_path);
3358 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3359
3360 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3361 if let Some(ref param_value) = p_query_outputsize {
3362 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3363 }
3364 if let Some(ref param_value) = p_query_show_plan {
3365 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3366 }
3367 if let Some(ref user_agent) = configuration.user_agent {
3368 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3369 }
3370 if let Some(ref apikey) = configuration.api_key {
3371 let key = apikey.key.clone();
3372 let value = match apikey.prefix {
3373 Some(ref prefix) => format!("{} {}", prefix, key),
3374 None => key,
3375 };
3376 req_builder = req_builder.header("Authorization", value);
3377 };
3378
3379 let req = req_builder.build()?;
3380 let resp = configuration.client.execute(req).await?;
3381
3382 let status = resp.status();
3383 let content_type = resp
3384 .headers()
3385 .get("content-type")
3386 .and_then(|v| v.to_str().ok())
3387 .unwrap_or("application/octet-stream");
3388 let content_type = super::ContentType::from(content_type);
3389
3390 if !status.is_client_error() && !status.is_server_error() {
3391 let content = resp.text().await?;
3392 match content_type {
3393 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3394 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSymbolSearch200Response`"))),
3395 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSymbolSearch200Response`")))),
3396 }
3397 } else {
3398 let content = resp.text().await?;
3399 let entity: Option<GetSymbolSearchError> = serde_json::from_str(&content).ok();
3400 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3401 }
3402}
3403
3404pub async fn get_technical_indicators(configuration: &configuration::Configuration) -> Result<models::GetTechnicalIndicators200Response, Error<GetTechnicalIndicatorsError>> {
3406
3407 let uri_str = format!("{}/technical_indicators", configuration.base_path);
3408 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3409
3410 if let Some(ref user_agent) = configuration.user_agent {
3411 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3412 }
3413 if let Some(ref apikey) = configuration.api_key {
3414 let key = apikey.key.clone();
3415 let value = match apikey.prefix {
3416 Some(ref prefix) => format!("{} {}", prefix, key),
3417 None => key,
3418 };
3419 req_builder = req_builder.header("Authorization", value);
3420 };
3421
3422 let req = req_builder.build()?;
3423 let resp = configuration.client.execute(req).await?;
3424
3425 let status = resp.status();
3426 let content_type = resp
3427 .headers()
3428 .get("content-type")
3429 .and_then(|v| v.to_str().ok())
3430 .unwrap_or("application/octet-stream");
3431 let content_type = super::ContentType::from(content_type);
3432
3433 if !status.is_client_error() && !status.is_server_error() {
3434 let content = resp.text().await?;
3435 match content_type {
3436 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3437 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTechnicalIndicators200Response`"))),
3438 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTechnicalIndicators200Response`")))),
3439 }
3440 } else {
3441 let content = resp.text().await?;
3442 let entity: Option<GetTechnicalIndicatorsError> = serde_json::from_str(&content).ok();
3443 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3444 }
3445}
3446