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