1use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16#[derive(Clone, Debug, Default, Serialize, Deserialize)]
18pub struct GetBondsParams {
19 pub symbol: Option<String>,
21 pub exchange: Option<String>,
23 pub country: Option<String>,
25 pub format: Option<String>,
27 pub delimiter: Option<String>,
29 pub show_plan: Option<bool>,
31 pub page: Option<i64>,
33 pub outputsize: Option<i64>,
35}
36
37impl GetBondsParams {
38 pub fn builder() -> GetBondsParamsBuilder {
40 GetBondsParamsBuilder::default()
41 }
42}
43
44#[derive(Clone, Debug, Default)]
46pub struct GetBondsParamsBuilder {
47 symbol: Option<String>,
49 exchange: Option<String>,
51 country: Option<String>,
53 format: Option<String>,
55 delimiter: Option<String>,
57 show_plan: Option<bool>,
59 page: Option<i64>,
61 outputsize: Option<i64>,
63}
64
65impl GetBondsParamsBuilder {
66 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
68 self.symbol = Some(symbol.into());
69 self
70 }
71 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
73 self.exchange = Some(exchange.into());
74 self
75 }
76 pub fn country(mut self, country: impl Into<String>) -> Self {
78 self.country = Some(country.into());
79 self
80 }
81 pub fn format(mut self, format: impl Into<String>) -> Self {
83 self.format = Some(format.into());
84 self
85 }
86 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
88 self.delimiter = Some(delimiter.into());
89 self
90 }
91 pub fn show_plan(mut self, show_plan: bool) -> Self {
93 self.show_plan = Some(show_plan);
94 self
95 }
96 pub fn page(mut self, page: i64) -> Self {
98 self.page = Some(page);
99 self
100 }
101 pub fn outputsize(mut self, outputsize: i64) -> Self {
103 self.outputsize = Some(outputsize);
104 self
105 }
106
107 pub fn build(self) -> GetBondsParams {
109 GetBondsParams {
110 symbol: self.symbol,
111 exchange: self.exchange,
112 country: self.country,
113 format: self.format,
114 delimiter: self.delimiter,
115 show_plan: self.show_plan,
116 page: self.page,
117 outputsize: self.outputsize,
118 }
119 }
120}
121
122#[derive(Clone, Debug, Default, Serialize, Deserialize)]
124pub struct GetCommoditiesParams {
125 pub symbol: Option<String>,
127 pub category: Option<String>,
129 pub format: Option<String>,
131 pub delimiter: Option<String>,
133}
134
135impl GetCommoditiesParams {
136 pub fn builder() -> GetCommoditiesParamsBuilder {
138 GetCommoditiesParamsBuilder::default()
139 }
140}
141
142#[derive(Clone, Debug, Default)]
144pub struct GetCommoditiesParamsBuilder {
145 symbol: Option<String>,
147 category: Option<String>,
149 format: Option<String>,
151 delimiter: Option<String>,
153}
154
155impl GetCommoditiesParamsBuilder {
156 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
158 self.symbol = Some(symbol.into());
159 self
160 }
161 pub fn category(mut self, category: impl Into<String>) -> Self {
163 self.category = Some(category.into());
164 self
165 }
166 pub fn format(mut self, format: impl Into<String>) -> Self {
168 self.format = Some(format.into());
169 self
170 }
171 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
173 self.delimiter = Some(delimiter.into());
174 self
175 }
176
177 pub fn build(self) -> GetCommoditiesParams {
179 GetCommoditiesParams {
180 symbol: self.symbol,
181 category: self.category,
182 format: self.format,
183 delimiter: self.delimiter,
184 }
185 }
186}
187
188#[derive(Clone, Debug, Default, Serialize, Deserialize)]
190pub struct GetCrossListingsParams {
191 pub symbol: String,
193 pub exchange: Option<String>,
195 pub mic_code: Option<String>,
197 pub country: Option<String>,
199}
200
201impl GetCrossListingsParams {
202 pub fn builder() -> GetCrossListingsParamsBuilder {
204 GetCrossListingsParamsBuilder::default()
205 }
206}
207
208#[derive(Clone, Debug, Default)]
210pub struct GetCrossListingsParamsBuilder {
211 symbol: String,
213 exchange: Option<String>,
215 mic_code: Option<String>,
217 country: Option<String>,
219}
220
221impl GetCrossListingsParamsBuilder {
222 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
224 self.symbol = symbol.into();
225 self
226 }
227 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
229 self.exchange = Some(exchange.into());
230 self
231 }
232 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
234 self.mic_code = Some(mic_code.into());
235 self
236 }
237 pub fn country(mut self, country: impl Into<String>) -> Self {
239 self.country = Some(country.into());
240 self
241 }
242
243 pub fn build(self) -> GetCrossListingsParams {
245 GetCrossListingsParams {
246 symbol: self.symbol,
247 exchange: self.exchange,
248 mic_code: self.mic_code,
249 country: self.country,
250 }
251 }
252}
253
254#[derive(Clone, Debug, Default, Serialize, Deserialize)]
256pub struct GetCryptocurrenciesParams {
257 pub symbol: Option<String>,
259 pub exchange: Option<String>,
261 pub currency_base: Option<String>,
263 pub currency_quote: Option<String>,
265 pub format: Option<String>,
267 pub delimiter: Option<String>,
269}
270
271impl GetCryptocurrenciesParams {
272 pub fn builder() -> GetCryptocurrenciesParamsBuilder {
274 GetCryptocurrenciesParamsBuilder::default()
275 }
276}
277
278#[derive(Clone, Debug, Default)]
280pub struct GetCryptocurrenciesParamsBuilder {
281 symbol: Option<String>,
283 exchange: Option<String>,
285 currency_base: Option<String>,
287 currency_quote: Option<String>,
289 format: Option<String>,
291 delimiter: Option<String>,
293}
294
295impl GetCryptocurrenciesParamsBuilder {
296 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
298 self.symbol = Some(symbol.into());
299 self
300 }
301 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
303 self.exchange = Some(exchange.into());
304 self
305 }
306 pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
308 self.currency_base = Some(currency_base.into());
309 self
310 }
311 pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
313 self.currency_quote = Some(currency_quote.into());
314 self
315 }
316 pub fn format(mut self, format: impl Into<String>) -> Self {
318 self.format = Some(format.into());
319 self
320 }
321 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
323 self.delimiter = Some(delimiter.into());
324 self
325 }
326
327 pub fn build(self) -> GetCryptocurrenciesParams {
329 GetCryptocurrenciesParams {
330 symbol: self.symbol,
331 exchange: self.exchange,
332 currency_base: self.currency_base,
333 currency_quote: self.currency_quote,
334 format: self.format,
335 delimiter: self.delimiter,
336 }
337 }
338}
339
340#[derive(Clone, Debug, Default, Serialize, Deserialize)]
342pub struct GetCryptocurrencyExchangesParams {
343 pub format: Option<String>,
345 pub delimiter: Option<String>,
347}
348
349impl GetCryptocurrencyExchangesParams {
350 pub fn builder() -> GetCryptocurrencyExchangesParamsBuilder {
352 GetCryptocurrencyExchangesParamsBuilder::default()
353 }
354}
355
356#[derive(Clone, Debug, Default)]
358pub struct GetCryptocurrencyExchangesParamsBuilder {
359 format: Option<String>,
361 delimiter: Option<String>,
363}
364
365impl GetCryptocurrencyExchangesParamsBuilder {
366 pub fn format(mut self, format: impl Into<String>) -> Self {
368 self.format = Some(format.into());
369 self
370 }
371 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
373 self.delimiter = Some(delimiter.into());
374 self
375 }
376
377 pub fn build(self) -> GetCryptocurrencyExchangesParams {
379 GetCryptocurrencyExchangesParams {
380 format: self.format,
381 delimiter: self.delimiter,
382 }
383 }
384}
385
386#[derive(Clone, Debug, Default, Serialize, Deserialize)]
388pub struct GetEarliestTimestampParams {
389 pub interval: String,
391 pub symbol: Option<String>,
393 pub figi: Option<String>,
395 pub isin: Option<String>,
397 pub cusip: Option<String>,
399 pub exchange: Option<String>,
401 pub mic_code: Option<String>,
403 pub timezone: Option<String>,
405}
406
407impl GetEarliestTimestampParams {
408 pub fn builder() -> GetEarliestTimestampParamsBuilder {
410 GetEarliestTimestampParamsBuilder::default()
411 }
412}
413
414#[derive(Clone, Debug, Default)]
416pub struct GetEarliestTimestampParamsBuilder {
417 interval: String,
419 symbol: Option<String>,
421 figi: Option<String>,
423 isin: Option<String>,
425 cusip: Option<String>,
427 exchange: Option<String>,
429 mic_code: Option<String>,
431 timezone: Option<String>,
433}
434
435impl GetEarliestTimestampParamsBuilder {
436 pub fn interval(mut self, interval: impl Into<String>) -> Self {
438 self.interval = interval.into();
439 self
440 }
441 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
443 self.symbol = Some(symbol.into());
444 self
445 }
446 pub fn figi(mut self, figi: impl Into<String>) -> Self {
448 self.figi = Some(figi.into());
449 self
450 }
451 pub fn isin(mut self, isin: impl Into<String>) -> Self {
453 self.isin = Some(isin.into());
454 self
455 }
456 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
458 self.cusip = Some(cusip.into());
459 self
460 }
461 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
463 self.exchange = Some(exchange.into());
464 self
465 }
466 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
468 self.mic_code = Some(mic_code.into());
469 self
470 }
471 pub fn timezone(mut self, timezone: impl Into<String>) -> Self {
473 self.timezone = Some(timezone.into());
474 self
475 }
476
477 pub fn build(self) -> GetEarliestTimestampParams {
479 GetEarliestTimestampParams {
480 interval: self.interval,
481 symbol: self.symbol,
482 figi: self.figi,
483 isin: self.isin,
484 cusip: self.cusip,
485 exchange: self.exchange,
486 mic_code: self.mic_code,
487 timezone: self.timezone,
488 }
489 }
490}
491
492#[derive(Clone, Debug, Default, Serialize, Deserialize)]
494pub struct GetEtfParams {
495 pub symbol: Option<String>,
497 pub figi: Option<String>,
499 pub isin: Option<String>,
501 pub cusip: Option<String>,
503 pub cik: Option<String>,
505 pub exchange: Option<String>,
507 pub mic_code: Option<String>,
509 pub country: Option<String>,
511 pub format: Option<String>,
513 pub delimiter: Option<String>,
515 pub show_plan: Option<bool>,
517 pub include_delisted: Option<bool>,
519}
520
521impl GetEtfParams {
522 pub fn builder() -> GetEtfParamsBuilder {
524 GetEtfParamsBuilder::default()
525 }
526}
527
528#[derive(Clone, Debug, Default)]
530pub struct GetEtfParamsBuilder {
531 symbol: Option<String>,
533 figi: Option<String>,
535 isin: Option<String>,
537 cusip: Option<String>,
539 cik: Option<String>,
541 exchange: Option<String>,
543 mic_code: Option<String>,
545 country: Option<String>,
547 format: Option<String>,
549 delimiter: Option<String>,
551 show_plan: Option<bool>,
553 include_delisted: Option<bool>,
555}
556
557impl GetEtfParamsBuilder {
558 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
560 self.symbol = Some(symbol.into());
561 self
562 }
563 pub fn figi(mut self, figi: impl Into<String>) -> Self {
565 self.figi = Some(figi.into());
566 self
567 }
568 pub fn isin(mut self, isin: impl Into<String>) -> Self {
570 self.isin = Some(isin.into());
571 self
572 }
573 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
575 self.cusip = Some(cusip.into());
576 self
577 }
578 pub fn cik(mut self, cik: impl Into<String>) -> Self {
580 self.cik = Some(cik.into());
581 self
582 }
583 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
585 self.exchange = Some(exchange.into());
586 self
587 }
588 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
590 self.mic_code = Some(mic_code.into());
591 self
592 }
593 pub fn country(mut self, country: impl Into<String>) -> Self {
595 self.country = Some(country.into());
596 self
597 }
598 pub fn format(mut self, format: impl Into<String>) -> Self {
600 self.format = Some(format.into());
601 self
602 }
603 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
605 self.delimiter = Some(delimiter.into());
606 self
607 }
608 pub fn show_plan(mut self, show_plan: bool) -> Self {
610 self.show_plan = Some(show_plan);
611 self
612 }
613 pub fn include_delisted(mut self, include_delisted: bool) -> Self {
615 self.include_delisted = Some(include_delisted);
616 self
617 }
618
619 pub fn build(self) -> GetEtfParams {
621 GetEtfParams {
622 symbol: self.symbol,
623 figi: self.figi,
624 isin: self.isin,
625 cusip: self.cusip,
626 cik: self.cik,
627 exchange: self.exchange,
628 mic_code: self.mic_code,
629 country: self.country,
630 format: self.format,
631 delimiter: self.delimiter,
632 show_plan: self.show_plan,
633 include_delisted: self.include_delisted,
634 }
635 }
636}
637
638#[derive(Clone, Debug, Default, Serialize, Deserialize)]
640pub struct GetEtfsFamilyParams {
641 pub country: Option<String>,
643 pub fund_family: Option<String>,
645}
646
647impl GetEtfsFamilyParams {
648 pub fn builder() -> GetEtfsFamilyParamsBuilder {
650 GetEtfsFamilyParamsBuilder::default()
651 }
652}
653
654#[derive(Clone, Debug, Default)]
656pub struct GetEtfsFamilyParamsBuilder {
657 country: Option<String>,
659 fund_family: Option<String>,
661}
662
663impl GetEtfsFamilyParamsBuilder {
664 pub fn country(mut self, country: impl Into<String>) -> Self {
666 self.country = Some(country.into());
667 self
668 }
669 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
671 self.fund_family = Some(fund_family.into());
672 self
673 }
674
675 pub fn build(self) -> GetEtfsFamilyParams {
677 GetEtfsFamilyParams {
678 country: self.country,
679 fund_family: self.fund_family,
680 }
681 }
682}
683
684#[derive(Clone, Debug, Default, Serialize, Deserialize)]
686pub struct GetEtfsListParams {
687 pub symbol: Option<String>,
689 pub figi: Option<String>,
691 pub isin: Option<String>,
693 pub cusip: Option<String>,
695 pub cik: Option<String>,
697 pub country: Option<String>,
699 pub fund_family: Option<String>,
701 pub fund_type: Option<String>,
703 pub page: Option<i64>,
705 pub outputsize: Option<i64>,
707}
708
709impl GetEtfsListParams {
710 pub fn builder() -> GetEtfsListParamsBuilder {
712 GetEtfsListParamsBuilder::default()
713 }
714}
715
716#[derive(Clone, Debug, Default)]
718pub struct GetEtfsListParamsBuilder {
719 symbol: Option<String>,
721 figi: Option<String>,
723 isin: Option<String>,
725 cusip: Option<String>,
727 cik: Option<String>,
729 country: Option<String>,
731 fund_family: Option<String>,
733 fund_type: Option<String>,
735 page: Option<i64>,
737 outputsize: Option<i64>,
739}
740
741impl GetEtfsListParamsBuilder {
742 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
744 self.symbol = Some(symbol.into());
745 self
746 }
747 pub fn figi(mut self, figi: impl Into<String>) -> Self {
749 self.figi = Some(figi.into());
750 self
751 }
752 pub fn isin(mut self, isin: impl Into<String>) -> Self {
754 self.isin = Some(isin.into());
755 self
756 }
757 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
759 self.cusip = Some(cusip.into());
760 self
761 }
762 pub fn cik(mut self, cik: impl Into<String>) -> Self {
764 self.cik = Some(cik.into());
765 self
766 }
767 pub fn country(mut self, country: impl Into<String>) -> Self {
769 self.country = Some(country.into());
770 self
771 }
772 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
774 self.fund_family = Some(fund_family.into());
775 self
776 }
777 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
779 self.fund_type = Some(fund_type.into());
780 self
781 }
782 pub fn page(mut self, page: i64) -> Self {
784 self.page = Some(page);
785 self
786 }
787 pub fn outputsize(mut self, outputsize: i64) -> Self {
789 self.outputsize = Some(outputsize);
790 self
791 }
792
793 pub fn build(self) -> GetEtfsListParams {
795 GetEtfsListParams {
796 symbol: self.symbol,
797 figi: self.figi,
798 isin: self.isin,
799 cusip: self.cusip,
800 cik: self.cik,
801 country: self.country,
802 fund_family: self.fund_family,
803 fund_type: self.fund_type,
804 page: self.page,
805 outputsize: self.outputsize,
806 }
807 }
808}
809
810#[derive(Clone, Debug, Default, Serialize, Deserialize)]
812pub struct GetEtfsTypeParams {
813 pub country: Option<String>,
815 pub fund_type: Option<String>,
817}
818
819impl GetEtfsTypeParams {
820 pub fn builder() -> GetEtfsTypeParamsBuilder {
822 GetEtfsTypeParamsBuilder::default()
823 }
824}
825
826#[derive(Clone, Debug, Default)]
828pub struct GetEtfsTypeParamsBuilder {
829 country: Option<String>,
831 fund_type: Option<String>,
833}
834
835impl GetEtfsTypeParamsBuilder {
836 pub fn country(mut self, country: impl Into<String>) -> Self {
838 self.country = Some(country.into());
839 self
840 }
841 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
843 self.fund_type = Some(fund_type.into());
844 self
845 }
846
847 pub fn build(self) -> GetEtfsTypeParams {
849 GetEtfsTypeParams {
850 country: self.country,
851 fund_type: self.fund_type,
852 }
853 }
854}
855
856#[derive(Clone, Debug, Default, Serialize, Deserialize)]
858pub struct GetExchangeScheduleParams {
859 pub mic_name: Option<String>,
861 pub mic_code: Option<String>,
863 pub country: Option<String>,
865 pub date: Option<String>,
867}
868
869impl GetExchangeScheduleParams {
870 pub fn builder() -> GetExchangeScheduleParamsBuilder {
872 GetExchangeScheduleParamsBuilder::default()
873 }
874}
875
876#[derive(Clone, Debug, Default)]
878pub struct GetExchangeScheduleParamsBuilder {
879 mic_name: Option<String>,
881 mic_code: Option<String>,
883 country: Option<String>,
885 date: Option<String>,
887}
888
889impl GetExchangeScheduleParamsBuilder {
890 pub fn mic_name(mut self, mic_name: impl Into<String>) -> Self {
892 self.mic_name = Some(mic_name.into());
893 self
894 }
895 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
897 self.mic_code = Some(mic_code.into());
898 self
899 }
900 pub fn country(mut self, country: impl Into<String>) -> Self {
902 self.country = Some(country.into());
903 self
904 }
905 pub fn date(mut self, date: impl Into<String>) -> Self {
907 self.date = Some(date.into());
908 self
909 }
910
911 pub fn build(self) -> GetExchangeScheduleParams {
913 GetExchangeScheduleParams {
914 mic_name: self.mic_name,
915 mic_code: self.mic_code,
916 country: self.country,
917 date: self.date,
918 }
919 }
920}
921
922#[derive(Clone, Debug, Default, Serialize, Deserialize)]
924pub struct GetExchangesParams {
925 pub r#type: Option<String>,
927 pub name: Option<String>,
929 pub code: Option<String>,
931 pub country: Option<String>,
933 pub format: Option<String>,
935 pub delimiter: Option<String>,
937 pub show_plan: Option<bool>,
939}
940
941impl GetExchangesParams {
942 pub fn builder() -> GetExchangesParamsBuilder {
944 GetExchangesParamsBuilder::default()
945 }
946}
947
948#[derive(Clone, Debug, Default)]
950pub struct GetExchangesParamsBuilder {
951 r#type: Option<String>,
953 name: Option<String>,
955 code: Option<String>,
957 country: Option<String>,
959 format: Option<String>,
961 delimiter: Option<String>,
963 show_plan: Option<bool>,
965}
966
967impl GetExchangesParamsBuilder {
968 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
970 self.r#type = Some(r#type.into());
971 self
972 }
973 pub fn name(mut self, name: impl Into<String>) -> Self {
975 self.name = Some(name.into());
976 self
977 }
978 pub fn code(mut self, code: impl Into<String>) -> Self {
980 self.code = Some(code.into());
981 self
982 }
983 pub fn country(mut self, country: impl Into<String>) -> Self {
985 self.country = Some(country.into());
986 self
987 }
988 pub fn format(mut self, format: impl Into<String>) -> Self {
990 self.format = Some(format.into());
991 self
992 }
993 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
995 self.delimiter = Some(delimiter.into());
996 self
997 }
998 pub fn show_plan(mut self, show_plan: bool) -> Self {
1000 self.show_plan = Some(show_plan);
1001 self
1002 }
1003
1004 pub fn build(self) -> GetExchangesParams {
1006 GetExchangesParams {
1007 r#type: self.r#type,
1008 name: self.name,
1009 code: self.code,
1010 country: self.country,
1011 format: self.format,
1012 delimiter: self.delimiter,
1013 show_plan: self.show_plan,
1014 }
1015 }
1016}
1017
1018#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1020pub struct GetForexPairsParams {
1021 pub symbol: Option<String>,
1023 pub currency_base: Option<String>,
1025 pub currency_quote: Option<String>,
1027 pub format: Option<String>,
1029 pub delimiter: Option<String>,
1031}
1032
1033impl GetForexPairsParams {
1034 pub fn builder() -> GetForexPairsParamsBuilder {
1036 GetForexPairsParamsBuilder::default()
1037 }
1038}
1039
1040#[derive(Clone, Debug, Default)]
1042pub struct GetForexPairsParamsBuilder {
1043 symbol: Option<String>,
1045 currency_base: Option<String>,
1047 currency_quote: Option<String>,
1049 format: Option<String>,
1051 delimiter: Option<String>,
1053}
1054
1055impl GetForexPairsParamsBuilder {
1056 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1058 self.symbol = Some(symbol.into());
1059 self
1060 }
1061 pub fn currency_base(mut self, currency_base: impl Into<String>) -> Self {
1063 self.currency_base = Some(currency_base.into());
1064 self
1065 }
1066 pub fn currency_quote(mut self, currency_quote: impl Into<String>) -> Self {
1068 self.currency_quote = Some(currency_quote.into());
1069 self
1070 }
1071 pub fn format(mut self, format: impl Into<String>) -> Self {
1073 self.format = Some(format.into());
1074 self
1075 }
1076 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1078 self.delimiter = Some(delimiter.into());
1079 self
1080 }
1081
1082 pub fn build(self) -> GetForexPairsParams {
1084 GetForexPairsParams {
1085 symbol: self.symbol,
1086 currency_base: self.currency_base,
1087 currency_quote: self.currency_quote,
1088 format: self.format,
1089 delimiter: self.delimiter,
1090 }
1091 }
1092}
1093
1094#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1096pub struct GetFundsParams {
1097 pub symbol: Option<String>,
1099 pub figi: Option<String>,
1101 pub isin: Option<String>,
1103 pub cusip: Option<String>,
1105 pub cik: Option<String>,
1107 pub exchange: Option<String>,
1109 pub country: Option<String>,
1111 pub format: Option<String>,
1113 pub delimiter: Option<String>,
1115 pub show_plan: Option<bool>,
1117 pub page: Option<i64>,
1119 pub outputsize: Option<i64>,
1121}
1122
1123impl GetFundsParams {
1124 pub fn builder() -> GetFundsParamsBuilder {
1126 GetFundsParamsBuilder::default()
1127 }
1128}
1129
1130#[derive(Clone, Debug, Default)]
1132pub struct GetFundsParamsBuilder {
1133 symbol: Option<String>,
1135 figi: Option<String>,
1137 isin: Option<String>,
1139 cusip: Option<String>,
1141 cik: Option<String>,
1143 exchange: Option<String>,
1145 country: Option<String>,
1147 format: Option<String>,
1149 delimiter: Option<String>,
1151 show_plan: Option<bool>,
1153 page: Option<i64>,
1155 outputsize: Option<i64>,
1157}
1158
1159impl GetFundsParamsBuilder {
1160 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1162 self.symbol = Some(symbol.into());
1163 self
1164 }
1165 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1167 self.figi = Some(figi.into());
1168 self
1169 }
1170 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1172 self.isin = Some(isin.into());
1173 self
1174 }
1175 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1177 self.cusip = Some(cusip.into());
1178 self
1179 }
1180 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1182 self.cik = Some(cik.into());
1183 self
1184 }
1185 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1187 self.exchange = Some(exchange.into());
1188 self
1189 }
1190 pub fn country(mut self, country: impl Into<String>) -> Self {
1192 self.country = Some(country.into());
1193 self
1194 }
1195 pub fn format(mut self, format: impl Into<String>) -> Self {
1197 self.format = Some(format.into());
1198 self
1199 }
1200 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1202 self.delimiter = Some(delimiter.into());
1203 self
1204 }
1205 pub fn show_plan(mut self, show_plan: bool) -> Self {
1207 self.show_plan = Some(show_plan);
1208 self
1209 }
1210 pub fn page(mut self, page: i64) -> Self {
1212 self.page = Some(page);
1213 self
1214 }
1215 pub fn outputsize(mut self, outputsize: i64) -> Self {
1217 self.outputsize = Some(outputsize);
1218 self
1219 }
1220
1221 pub fn build(self) -> GetFundsParams {
1223 GetFundsParams {
1224 symbol: self.symbol,
1225 figi: self.figi,
1226 isin: self.isin,
1227 cusip: self.cusip,
1228 cik: self.cik,
1229 exchange: self.exchange,
1230 country: self.country,
1231 format: self.format,
1232 delimiter: self.delimiter,
1233 show_plan: self.show_plan,
1234 page: self.page,
1235 outputsize: self.outputsize,
1236 }
1237 }
1238}
1239
1240#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1242pub struct GetMarketStateParams {
1243 pub exchange: Option<String>,
1245 pub code: Option<String>,
1247 pub country: Option<String>,
1249}
1250
1251impl GetMarketStateParams {
1252 pub fn builder() -> GetMarketStateParamsBuilder {
1254 GetMarketStateParamsBuilder::default()
1255 }
1256}
1257
1258#[derive(Clone, Debug, Default)]
1260pub struct GetMarketStateParamsBuilder {
1261 exchange: Option<String>,
1263 code: Option<String>,
1265 country: Option<String>,
1267}
1268
1269impl GetMarketStateParamsBuilder {
1270 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1272 self.exchange = Some(exchange.into());
1273 self
1274 }
1275 pub fn code(mut self, code: impl Into<String>) -> Self {
1277 self.code = Some(code.into());
1278 self
1279 }
1280 pub fn country(mut self, country: impl Into<String>) -> Self {
1282 self.country = Some(country.into());
1283 self
1284 }
1285
1286 pub fn build(self) -> GetMarketStateParams {
1288 GetMarketStateParams {
1289 exchange: self.exchange,
1290 code: self.code,
1291 country: self.country,
1292 }
1293 }
1294}
1295
1296#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1298pub struct GetMutualFundsFamilyParams {
1299 pub fund_family: Option<String>,
1301 pub country: Option<String>,
1303}
1304
1305impl GetMutualFundsFamilyParams {
1306 pub fn builder() -> GetMutualFundsFamilyParamsBuilder {
1308 GetMutualFundsFamilyParamsBuilder::default()
1309 }
1310}
1311
1312#[derive(Clone, Debug, Default)]
1314pub struct GetMutualFundsFamilyParamsBuilder {
1315 fund_family: Option<String>,
1317 country: Option<String>,
1319}
1320
1321impl GetMutualFundsFamilyParamsBuilder {
1322 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1324 self.fund_family = Some(fund_family.into());
1325 self
1326 }
1327 pub fn country(mut self, country: impl Into<String>) -> Self {
1329 self.country = Some(country.into());
1330 self
1331 }
1332
1333 pub fn build(self) -> GetMutualFundsFamilyParams {
1335 GetMutualFundsFamilyParams {
1336 fund_family: self.fund_family,
1337 country: self.country,
1338 }
1339 }
1340}
1341
1342#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1344pub struct GetMutualFundsListParams {
1345 pub symbol: Option<String>,
1347 pub figi: Option<String>,
1349 pub isin: Option<String>,
1351 pub cusip: Option<String>,
1353 pub cik: Option<String>,
1355 pub country: Option<String>,
1357 pub fund_family: Option<String>,
1359 pub fund_type: Option<String>,
1361 pub performance_rating: Option<i64>,
1363 pub risk_rating: Option<i64>,
1365 pub page: Option<i64>,
1367 pub outputsize: Option<i64>,
1369}
1370
1371impl GetMutualFundsListParams {
1372 pub fn builder() -> GetMutualFundsListParamsBuilder {
1374 GetMutualFundsListParamsBuilder::default()
1375 }
1376}
1377
1378#[derive(Clone, Debug, Default)]
1380pub struct GetMutualFundsListParamsBuilder {
1381 symbol: Option<String>,
1383 figi: Option<String>,
1385 isin: Option<String>,
1387 cusip: Option<String>,
1389 cik: Option<String>,
1391 country: Option<String>,
1393 fund_family: Option<String>,
1395 fund_type: Option<String>,
1397 performance_rating: Option<i64>,
1399 risk_rating: Option<i64>,
1401 page: Option<i64>,
1403 outputsize: Option<i64>,
1405}
1406
1407impl GetMutualFundsListParamsBuilder {
1408 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1410 self.symbol = Some(symbol.into());
1411 self
1412 }
1413 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1415 self.figi = Some(figi.into());
1416 self
1417 }
1418 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1420 self.isin = Some(isin.into());
1421 self
1422 }
1423 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1425 self.cusip = Some(cusip.into());
1426 self
1427 }
1428 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1430 self.cik = Some(cik.into());
1431 self
1432 }
1433 pub fn country(mut self, country: impl Into<String>) -> Self {
1435 self.country = Some(country.into());
1436 self
1437 }
1438 pub fn fund_family(mut self, fund_family: impl Into<String>) -> Self {
1440 self.fund_family = Some(fund_family.into());
1441 self
1442 }
1443 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1445 self.fund_type = Some(fund_type.into());
1446 self
1447 }
1448 pub fn performance_rating(mut self, performance_rating: i64) -> Self {
1450 self.performance_rating = Some(performance_rating);
1451 self
1452 }
1453 pub fn risk_rating(mut self, risk_rating: i64) -> Self {
1455 self.risk_rating = Some(risk_rating);
1456 self
1457 }
1458 pub fn page(mut self, page: i64) -> Self {
1460 self.page = Some(page);
1461 self
1462 }
1463 pub fn outputsize(mut self, outputsize: i64) -> Self {
1465 self.outputsize = Some(outputsize);
1466 self
1467 }
1468
1469 pub fn build(self) -> GetMutualFundsListParams {
1471 GetMutualFundsListParams {
1472 symbol: self.symbol,
1473 figi: self.figi,
1474 isin: self.isin,
1475 cusip: self.cusip,
1476 cik: self.cik,
1477 country: self.country,
1478 fund_family: self.fund_family,
1479 fund_type: self.fund_type,
1480 performance_rating: self.performance_rating,
1481 risk_rating: self.risk_rating,
1482 page: self.page,
1483 outputsize: self.outputsize,
1484 }
1485 }
1486}
1487
1488#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1490pub struct GetMutualFundsTypeParams {
1491 pub fund_type: Option<String>,
1493 pub country: Option<String>,
1495}
1496
1497impl GetMutualFundsTypeParams {
1498 pub fn builder() -> GetMutualFundsTypeParamsBuilder {
1500 GetMutualFundsTypeParamsBuilder::default()
1501 }
1502}
1503
1504#[derive(Clone, Debug, Default)]
1506pub struct GetMutualFundsTypeParamsBuilder {
1507 fund_type: Option<String>,
1509 country: Option<String>,
1511}
1512
1513impl GetMutualFundsTypeParamsBuilder {
1514 pub fn fund_type(mut self, fund_type: impl Into<String>) -> Self {
1516 self.fund_type = Some(fund_type.into());
1517 self
1518 }
1519 pub fn country(mut self, country: impl Into<String>) -> Self {
1521 self.country = Some(country.into());
1522 self
1523 }
1524
1525 pub fn build(self) -> GetMutualFundsTypeParams {
1527 GetMutualFundsTypeParams {
1528 fund_type: self.fund_type,
1529 country: self.country,
1530 }
1531 }
1532}
1533
1534#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1536pub struct GetStocksParams {
1537 pub symbol: Option<String>,
1539 pub figi: Option<String>,
1541 pub isin: Option<String>,
1543 pub cusip: Option<String>,
1545 pub cik: Option<String>,
1547 pub exchange: Option<String>,
1549 pub mic_code: Option<String>,
1551 pub country: Option<String>,
1553 pub r#type: Option<String>,
1555 pub format: Option<String>,
1557 pub delimiter: Option<String>,
1559 pub show_plan: Option<bool>,
1561 pub include_delisted: Option<bool>,
1563}
1564
1565impl GetStocksParams {
1566 pub fn builder() -> GetStocksParamsBuilder {
1568 GetStocksParamsBuilder::default()
1569 }
1570}
1571
1572#[derive(Clone, Debug, Default)]
1574pub struct GetStocksParamsBuilder {
1575 symbol: Option<String>,
1577 figi: Option<String>,
1579 isin: Option<String>,
1581 cusip: Option<String>,
1583 cik: Option<String>,
1585 exchange: Option<String>,
1587 mic_code: Option<String>,
1589 country: Option<String>,
1591 r#type: Option<String>,
1593 format: Option<String>,
1595 delimiter: Option<String>,
1597 show_plan: Option<bool>,
1599 include_delisted: Option<bool>,
1601}
1602
1603impl GetStocksParamsBuilder {
1604 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1606 self.symbol = Some(symbol.into());
1607 self
1608 }
1609 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1611 self.figi = Some(figi.into());
1612 self
1613 }
1614 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1616 self.isin = Some(isin.into());
1617 self
1618 }
1619 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1621 self.cusip = Some(cusip.into());
1622 self
1623 }
1624 pub fn cik(mut self, cik: impl Into<String>) -> Self {
1626 self.cik = Some(cik.into());
1627 self
1628 }
1629 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1631 self.exchange = Some(exchange.into());
1632 self
1633 }
1634 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
1636 self.mic_code = Some(mic_code.into());
1637 self
1638 }
1639 pub fn country(mut self, country: impl Into<String>) -> Self {
1641 self.country = Some(country.into());
1642 self
1643 }
1644 pub fn r#type(mut self, r#type: impl Into<String>) -> Self {
1646 self.r#type = Some(r#type.into());
1647 self
1648 }
1649 pub fn format(mut self, format: impl Into<String>) -> Self {
1651 self.format = Some(format.into());
1652 self
1653 }
1654 pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self {
1656 self.delimiter = Some(delimiter.into());
1657 self
1658 }
1659 pub fn show_plan(mut self, show_plan: bool) -> Self {
1661 self.show_plan = Some(show_plan);
1662 self
1663 }
1664 pub fn include_delisted(mut self, include_delisted: bool) -> Self {
1666 self.include_delisted = Some(include_delisted);
1667 self
1668 }
1669
1670 pub fn build(self) -> GetStocksParams {
1672 GetStocksParams {
1673 symbol: self.symbol,
1674 figi: self.figi,
1675 isin: self.isin,
1676 cusip: self.cusip,
1677 cik: self.cik,
1678 exchange: self.exchange,
1679 mic_code: self.mic_code,
1680 country: self.country,
1681 r#type: self.r#type,
1682 format: self.format,
1683 delimiter: self.delimiter,
1684 show_plan: self.show_plan,
1685 include_delisted: self.include_delisted,
1686 }
1687 }
1688}
1689
1690#[derive(Clone, Debug, Default, Serialize, Deserialize)]
1692pub struct GetSymbolSearchParams {
1693 pub symbol: String,
1695 pub outputsize: Option<i64>,
1697 pub show_plan: Option<bool>,
1699}
1700
1701impl GetSymbolSearchParams {
1702 pub fn builder() -> GetSymbolSearchParamsBuilder {
1704 GetSymbolSearchParamsBuilder::default()
1705 }
1706}
1707
1708#[derive(Clone, Debug, Default)]
1710pub struct GetSymbolSearchParamsBuilder {
1711 symbol: String,
1713 outputsize: Option<i64>,
1715 show_plan: Option<bool>,
1717}
1718
1719impl GetSymbolSearchParamsBuilder {
1720 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
1722 self.symbol = symbol.into();
1723 self
1724 }
1725 pub fn outputsize(mut self, outputsize: i64) -> Self {
1727 self.outputsize = Some(outputsize);
1728 self
1729 }
1730 pub fn show_plan(mut self, show_plan: bool) -> Self {
1732 self.show_plan = Some(show_plan);
1733 self
1734 }
1735
1736 pub fn build(self) -> GetSymbolSearchParams {
1738 GetSymbolSearchParams {
1739 symbol: self.symbol,
1740 outputsize: self.outputsize,
1741 show_plan: self.show_plan,
1742 }
1743 }
1744}
1745
1746#[derive(Debug, Clone, Serialize, Deserialize)]
1748#[serde(untagged)]
1749pub enum GetBondsError {
1750 UnknownValue(serde_json::Value),
1751}
1752
1753#[derive(Debug, Clone, Serialize, Deserialize)]
1755#[serde(untagged)]
1756pub enum GetCommoditiesError {
1757 UnknownValue(serde_json::Value),
1758}
1759
1760#[derive(Debug, Clone, Serialize, Deserialize)]
1762#[serde(untagged)]
1763pub enum GetCountriesError {
1764 UnknownValue(serde_json::Value),
1765}
1766
1767#[derive(Debug, Clone, Serialize, Deserialize)]
1769#[serde(untagged)]
1770pub enum GetCrossListingsError {
1771 UnknownValue(serde_json::Value),
1772}
1773
1774#[derive(Debug, Clone, Serialize, Deserialize)]
1776#[serde(untagged)]
1777pub enum GetCryptocurrenciesError {
1778 UnknownValue(serde_json::Value),
1779}
1780
1781#[derive(Debug, Clone, Serialize, Deserialize)]
1783#[serde(untagged)]
1784pub enum GetCryptocurrencyExchangesError {
1785 UnknownValue(serde_json::Value),
1786}
1787
1788#[derive(Debug, Clone, Serialize, Deserialize)]
1790#[serde(untagged)]
1791pub enum GetEarliestTimestampError {
1792 UnknownValue(serde_json::Value),
1793}
1794
1795#[derive(Debug, Clone, Serialize, Deserialize)]
1797#[serde(untagged)]
1798pub enum GetEtfError {
1799 UnknownValue(serde_json::Value),
1800}
1801
1802#[derive(Debug, Clone, Serialize, Deserialize)]
1804#[serde(untagged)]
1805pub enum GetEtfsFamilyError {
1806 UnknownValue(serde_json::Value),
1807}
1808
1809#[derive(Debug, Clone, Serialize, Deserialize)]
1811#[serde(untagged)]
1812pub enum GetEtfsListError {
1813 UnknownValue(serde_json::Value),
1814}
1815
1816#[derive(Debug, Clone, Serialize, Deserialize)]
1818#[serde(untagged)]
1819pub enum GetEtfsTypeError {
1820 UnknownValue(serde_json::Value),
1821}
1822
1823#[derive(Debug, Clone, Serialize, Deserialize)]
1825#[serde(untagged)]
1826pub enum GetExchangeScheduleError {
1827 UnknownValue(serde_json::Value),
1828}
1829
1830#[derive(Debug, Clone, Serialize, Deserialize)]
1832#[serde(untagged)]
1833pub enum GetExchangesError {
1834 UnknownValue(serde_json::Value),
1835}
1836
1837#[derive(Debug, Clone, Serialize, Deserialize)]
1839#[serde(untagged)]
1840pub enum GetForexPairsError {
1841 UnknownValue(serde_json::Value),
1842}
1843
1844#[derive(Debug, Clone, Serialize, Deserialize)]
1846#[serde(untagged)]
1847pub enum GetFundsError {
1848 UnknownValue(serde_json::Value),
1849}
1850
1851#[derive(Debug, Clone, Serialize, Deserialize)]
1853#[serde(untagged)]
1854pub enum GetInstrumentTypeError {
1855 UnknownValue(serde_json::Value),
1856}
1857
1858#[derive(Debug, Clone, Serialize, Deserialize)]
1860#[serde(untagged)]
1861pub enum GetIntervalsError {
1862 UnknownValue(serde_json::Value),
1863}
1864
1865#[derive(Debug, Clone, Serialize, Deserialize)]
1867#[serde(untagged)]
1868pub enum GetMarketStateError {
1869 UnknownValue(serde_json::Value),
1870}
1871
1872#[derive(Debug, Clone, Serialize, Deserialize)]
1874#[serde(untagged)]
1875pub enum GetMutualFundsFamilyError {
1876 UnknownValue(serde_json::Value),
1877}
1878
1879#[derive(Debug, Clone, Serialize, Deserialize)]
1881#[serde(untagged)]
1882pub enum GetMutualFundsListError {
1883 UnknownValue(serde_json::Value),
1884}
1885
1886#[derive(Debug, Clone, Serialize, Deserialize)]
1888#[serde(untagged)]
1889pub enum GetMutualFundsTypeError {
1890 UnknownValue(serde_json::Value),
1891}
1892
1893#[derive(Debug, Clone, Serialize, Deserialize)]
1895#[serde(untagged)]
1896pub enum GetStocksError {
1897 UnknownValue(serde_json::Value),
1898}
1899
1900#[derive(Debug, Clone, Serialize, Deserialize)]
1902#[serde(untagged)]
1903pub enum GetSymbolSearchError {
1904 UnknownValue(serde_json::Value),
1905}
1906
1907#[derive(Debug, Clone, Serialize, Deserialize)]
1909#[serde(untagged)]
1910pub enum GetTechnicalIndicatorsError {
1911 UnknownValue(serde_json::Value),
1912}
1913
1914pub async fn get_bonds(
1916 configuration: &configuration::Configuration,
1917 params: GetBondsParams,
1918) -> Result<models::GetBondsResponse, Error<GetBondsError>> {
1919 let p_query_symbol = params.symbol;
1921 let p_query_exchange = params.exchange;
1922 let p_query_country = params.country;
1923 let p_query_format = params.format;
1924 let p_query_delimiter = params.delimiter;
1925 let p_query_show_plan = params.show_plan;
1926 let p_query_page = params.page;
1927 let p_query_outputsize = params.outputsize;
1928
1929 let uri_str = format!("{}/bonds", configuration.base_path);
1930 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1931
1932 if let Some(ref param_value) = p_query_symbol {
1933 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1934 }
1935 if let Some(ref param_value) = p_query_exchange {
1936 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1937 }
1938 if let Some(ref param_value) = p_query_country {
1939 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1940 }
1941 if let Some(ref param_value) = p_query_format {
1942 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
1943 }
1944 if let Some(ref param_value) = p_query_delimiter {
1945 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
1946 }
1947 if let Some(ref param_value) = p_query_show_plan {
1948 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
1949 }
1950 if let Some(ref param_value) = p_query_page {
1951 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1952 }
1953 if let Some(ref param_value) = p_query_outputsize {
1954 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1955 }
1956 if let Some(ref user_agent) = configuration.user_agent {
1957 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1958 }
1959 if let Some(ref apikey) = configuration.api_key {
1960 let key = apikey.key.clone();
1961 let value = match apikey.prefix {
1962 Some(ref prefix) => format!("{} {}", prefix, key),
1963 None => key,
1964 };
1965 req_builder = req_builder.header("Authorization", value);
1966 };
1967
1968 let req = req_builder.build()?;
1969 let resp = configuration.client.execute(req).await?;
1970
1971 let status = resp.status();
1972 let content_type = resp
1973 .headers()
1974 .get("content-type")
1975 .and_then(|v| v.to_str().ok())
1976 .unwrap_or("application/octet-stream");
1977 let content_type = super::ContentType::from(content_type);
1978
1979 if !status.is_client_error() && !status.is_server_error() {
1980 let content = resp.text().await?;
1981 match content_type {
1982 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1983 ContentType::Text => return Ok(models::GetBondsResponse::Text(content)),
1984 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetBondsResponse`")))),
1985 }
1986 } else {
1987 let content = resp.text().await?;
1988 let entity: Option<GetBondsError> = serde_json::from_str(&content).ok();
1989 Err(Error::ResponseError(ResponseContent {
1990 status,
1991 content,
1992 entity,
1993 }))
1994 }
1995}
1996
1997pub async fn get_commodities(
1999 configuration: &configuration::Configuration,
2000 params: GetCommoditiesParams,
2001) -> Result<models::GetCommoditiesResponse, Error<GetCommoditiesError>> {
2002 let p_query_symbol = params.symbol;
2004 let p_query_category = params.category;
2005 let p_query_format = params.format;
2006 let p_query_delimiter = params.delimiter;
2007
2008 let uri_str = format!("{}/commodities", configuration.base_path);
2009 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2010
2011 if let Some(ref param_value) = p_query_symbol {
2012 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2013 }
2014 if let Some(ref param_value) = p_query_category {
2015 req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
2016 }
2017 if let Some(ref param_value) = p_query_format {
2018 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2019 }
2020 if let Some(ref param_value) = p_query_delimiter {
2021 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2022 }
2023 if let Some(ref user_agent) = configuration.user_agent {
2024 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2025 }
2026 if let Some(ref apikey) = configuration.api_key {
2027 let key = apikey.key.clone();
2028 let value = match apikey.prefix {
2029 Some(ref prefix) => format!("{} {}", prefix, key),
2030 None => key,
2031 };
2032 req_builder = req_builder.header("Authorization", value);
2033 };
2034
2035 let req = req_builder.build()?;
2036 let resp = configuration.client.execute(req).await?;
2037
2038 let status = resp.status();
2039 let content_type = resp
2040 .headers()
2041 .get("content-type")
2042 .and_then(|v| v.to_str().ok())
2043 .unwrap_or("application/octet-stream");
2044 let content_type = super::ContentType::from(content_type);
2045
2046 if !status.is_client_error() && !status.is_server_error() {
2047 let content = resp.text().await?;
2048 match content_type {
2049 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2050 ContentType::Text => return Ok(models::GetCommoditiesResponse::Text(content)),
2051 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::GetCommoditiesResponse`")))),
2052 }
2053 } else {
2054 let content = resp.text().await?;
2055 let entity: Option<GetCommoditiesError> = serde_json::from_str(&content).ok();
2056 Err(Error::ResponseError(ResponseContent {
2057 status,
2058 content,
2059 entity,
2060 }))
2061 }
2062}
2063
2064pub async fn get_countries(
2066 configuration: &configuration::Configuration,
2067) -> Result<models::GetCountriesResponse, Error<GetCountriesError>> {
2068 let uri_str = format!("{}/countries", configuration.base_path);
2069 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2070
2071 if let Some(ref user_agent) = configuration.user_agent {
2072 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2073 }
2074 if let Some(ref apikey) = configuration.api_key {
2075 let key = apikey.key.clone();
2076 let value = match apikey.prefix {
2077 Some(ref prefix) => format!("{} {}", prefix, key),
2078 None => key,
2079 };
2080 req_builder = req_builder.header("Authorization", value);
2081 };
2082
2083 let req = req_builder.build()?;
2084 let resp = configuration.client.execute(req).await?;
2085
2086 let status = resp.status();
2087 let content_type = resp
2088 .headers()
2089 .get("content-type")
2090 .and_then(|v| v.to_str().ok())
2091 .unwrap_or("application/octet-stream");
2092 let content_type = super::ContentType::from(content_type);
2093
2094 if !status.is_client_error() && !status.is_server_error() {
2095 let content = resp.text().await?;
2096 match content_type {
2097 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2098 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCountriesResponse`"))),
2099 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::GetCountriesResponse`")))),
2100 }
2101 } else {
2102 let content = resp.text().await?;
2103 let entity: Option<GetCountriesError> = serde_json::from_str(&content).ok();
2104 Err(Error::ResponseError(ResponseContent {
2105 status,
2106 content,
2107 entity,
2108 }))
2109 }
2110}
2111
2112pub async fn get_cross_listings(
2114 configuration: &configuration::Configuration,
2115 params: GetCrossListingsParams,
2116) -> Result<models::GetCrossListingsResponse, Error<GetCrossListingsError>> {
2117 let p_query_symbol = params.symbol;
2119 let p_query_exchange = params.exchange;
2120 let p_query_mic_code = params.mic_code;
2121 let p_query_country = params.country;
2122
2123 let uri_str = format!("{}/cross_listings", configuration.base_path);
2124 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2125
2126 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
2127 if let Some(ref param_value) = p_query_exchange {
2128 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2129 }
2130 if let Some(ref param_value) = p_query_mic_code {
2131 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2132 }
2133 if let Some(ref param_value) = p_query_country {
2134 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2135 }
2136 if let Some(ref user_agent) = configuration.user_agent {
2137 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2138 }
2139 if let Some(ref apikey) = configuration.api_key {
2140 let key = apikey.key.clone();
2141 let value = match apikey.prefix {
2142 Some(ref prefix) => format!("{} {}", prefix, key),
2143 None => key,
2144 };
2145 req_builder = req_builder.header("Authorization", value);
2146 };
2147
2148 let req = req_builder.build()?;
2149 let resp = configuration.client.execute(req).await?;
2150
2151 let status = resp.status();
2152 let content_type = resp
2153 .headers()
2154 .get("content-type")
2155 .and_then(|v| v.to_str().ok())
2156 .unwrap_or("application/octet-stream");
2157 let content_type = super::ContentType::from(content_type);
2158
2159 if !status.is_client_error() && !status.is_server_error() {
2160 let content = resp.text().await?;
2161 match content_type {
2162 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2163 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetCrossListingsResponse`"))),
2164 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::GetCrossListingsResponse`")))),
2165 }
2166 } else {
2167 let content = resp.text().await?;
2168 let entity: Option<GetCrossListingsError> = serde_json::from_str(&content).ok();
2169 Err(Error::ResponseError(ResponseContent {
2170 status,
2171 content,
2172 entity,
2173 }))
2174 }
2175}
2176
2177pub async fn get_cryptocurrencies(
2179 configuration: &configuration::Configuration,
2180 params: GetCryptocurrenciesParams,
2181) -> Result<models::GetCryptocurrenciesResponse, Error<GetCryptocurrenciesError>> {
2182 let p_query_symbol = params.symbol;
2184 let p_query_exchange = params.exchange;
2185 let p_query_currency_base = params.currency_base;
2186 let p_query_currency_quote = params.currency_quote;
2187 let p_query_format = params.format;
2188 let p_query_delimiter = params.delimiter;
2189
2190 let uri_str = format!("{}/cryptocurrencies", configuration.base_path);
2191 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2192
2193 if let Some(ref param_value) = p_query_symbol {
2194 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2195 }
2196 if let Some(ref param_value) = p_query_exchange {
2197 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2198 }
2199 if let Some(ref param_value) = p_query_currency_base {
2200 req_builder = req_builder.query(&[("currency_base", ¶m_value.to_string())]);
2201 }
2202 if let Some(ref param_value) = p_query_currency_quote {
2203 req_builder = req_builder.query(&[("currency_quote", ¶m_value.to_string())]);
2204 }
2205 if let Some(ref param_value) = p_query_format {
2206 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2207 }
2208 if let Some(ref param_value) = p_query_delimiter {
2209 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2210 }
2211 if let Some(ref user_agent) = configuration.user_agent {
2212 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2213 }
2214 if let Some(ref apikey) = configuration.api_key {
2215 let key = apikey.key.clone();
2216 let value = match apikey.prefix {
2217 Some(ref prefix) => format!("{} {}", prefix, key),
2218 None => key,
2219 };
2220 req_builder = req_builder.header("Authorization", value);
2221 };
2222
2223 let req = req_builder.build()?;
2224 let resp = configuration.client.execute(req).await?;
2225
2226 let status = resp.status();
2227 let content_type = resp
2228 .headers()
2229 .get("content-type")
2230 .and_then(|v| v.to_str().ok())
2231 .unwrap_or("application/octet-stream");
2232 let content_type = super::ContentType::from(content_type);
2233
2234 if !status.is_client_error() && !status.is_server_error() {
2235 let content = resp.text().await?;
2236 match content_type {
2237 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2238 ContentType::Text => return Ok(models::GetCryptocurrenciesResponse::Text(content)),
2239 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::GetCryptocurrenciesResponse`")))),
2240 }
2241 } else {
2242 let content = resp.text().await?;
2243 let entity: Option<GetCryptocurrenciesError> = serde_json::from_str(&content).ok();
2244 Err(Error::ResponseError(ResponseContent {
2245 status,
2246 content,
2247 entity,
2248 }))
2249 }
2250}
2251
2252pub async fn get_cryptocurrency_exchanges(
2254 configuration: &configuration::Configuration,
2255 params: GetCryptocurrencyExchangesParams,
2256) -> Result<models::GetCryptocurrencyExchangesResponse, Error<GetCryptocurrencyExchangesError>> {
2257 let p_query_format = params.format;
2259 let p_query_delimiter = params.delimiter;
2260
2261 let uri_str = format!("{}/cryptocurrency_exchanges", configuration.base_path);
2262 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2263
2264 if let Some(ref param_value) = p_query_format {
2265 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2266 }
2267 if let Some(ref param_value) = p_query_delimiter {
2268 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2269 }
2270 if let Some(ref user_agent) = configuration.user_agent {
2271 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2272 }
2273 if let Some(ref apikey) = configuration.api_key {
2274 let key = apikey.key.clone();
2275 let value = match apikey.prefix {
2276 Some(ref prefix) => format!("{} {}", prefix, key),
2277 None => key,
2278 };
2279 req_builder = req_builder.header("Authorization", value);
2280 };
2281
2282 let req = req_builder.build()?;
2283 let resp = configuration.client.execute(req).await?;
2284
2285 let status = resp.status();
2286 let content_type = resp
2287 .headers()
2288 .get("content-type")
2289 .and_then(|v| v.to_str().ok())
2290 .unwrap_or("application/octet-stream");
2291 let content_type = super::ContentType::from(content_type);
2292
2293 if !status.is_client_error() && !status.is_server_error() {
2294 let content = resp.text().await?;
2295 match content_type {
2296 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2297 ContentType::Text => return Ok(models::GetCryptocurrencyExchangesResponse::Text(content)),
2298 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::GetCryptocurrencyExchangesResponse`")))),
2299 }
2300 } else {
2301 let content = resp.text().await?;
2302 let entity: Option<GetCryptocurrencyExchangesError> = serde_json::from_str(&content).ok();
2303 Err(Error::ResponseError(ResponseContent {
2304 status,
2305 content,
2306 entity,
2307 }))
2308 }
2309}
2310
2311pub async fn get_earliest_timestamp(
2313 configuration: &configuration::Configuration,
2314 params: GetEarliestTimestampParams,
2315) -> Result<models::GetEarliestTimestampResponse, Error<GetEarliestTimestampError>> {
2316 let p_query_interval = params.interval;
2318 let p_query_symbol = params.symbol;
2319 let p_query_figi = params.figi;
2320 let p_query_isin = params.isin;
2321 let p_query_cusip = params.cusip;
2322 let p_query_exchange = params.exchange;
2323 let p_query_mic_code = params.mic_code;
2324 let p_query_timezone = params.timezone;
2325
2326 let uri_str = format!("{}/earliest_timestamp", configuration.base_path);
2327 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2328
2329 if let Some(ref param_value) = p_query_symbol {
2330 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2331 }
2332 if let Some(ref param_value) = p_query_figi {
2333 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2334 }
2335 if let Some(ref param_value) = p_query_isin {
2336 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2337 }
2338 if let Some(ref param_value) = p_query_cusip {
2339 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2340 }
2341 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
2342 if let Some(ref param_value) = p_query_exchange {
2343 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2344 }
2345 if let Some(ref param_value) = p_query_mic_code {
2346 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2347 }
2348 if let Some(ref param_value) = p_query_timezone {
2349 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
2350 }
2351 if let Some(ref user_agent) = configuration.user_agent {
2352 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2353 }
2354 if let Some(ref apikey) = configuration.api_key {
2355 let key = apikey.key.clone();
2356 let value = match apikey.prefix {
2357 Some(ref prefix) => format!("{} {}", prefix, key),
2358 None => key,
2359 };
2360 req_builder = req_builder.header("Authorization", value);
2361 };
2362
2363 let req = req_builder.build()?;
2364 let resp = configuration.client.execute(req).await?;
2365
2366 let status = resp.status();
2367 let content_type = resp
2368 .headers()
2369 .get("content-type")
2370 .and_then(|v| v.to_str().ok())
2371 .unwrap_or("application/octet-stream");
2372 let content_type = super::ContentType::from(content_type);
2373
2374 if !status.is_client_error() && !status.is_server_error() {
2375 let content = resp.text().await?;
2376 match content_type {
2377 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2378 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEarliestTimestampResponse`"))),
2379 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::GetEarliestTimestampResponse`")))),
2380 }
2381 } else {
2382 let content = resp.text().await?;
2383 let entity: Option<GetEarliestTimestampError> = serde_json::from_str(&content).ok();
2384 Err(Error::ResponseError(ResponseContent {
2385 status,
2386 content,
2387 entity,
2388 }))
2389 }
2390}
2391
2392pub async fn get_etf(
2394 configuration: &configuration::Configuration,
2395 params: GetEtfParams,
2396) -> Result<models::GetEtfResponse, Error<GetEtfError>> {
2397 let p_query_symbol = params.symbol;
2399 let p_query_figi = params.figi;
2400 let p_query_isin = params.isin;
2401 let p_query_cusip = params.cusip;
2402 let p_query_cik = params.cik;
2403 let p_query_exchange = params.exchange;
2404 let p_query_mic_code = params.mic_code;
2405 let p_query_country = params.country;
2406 let p_query_format = params.format;
2407 let p_query_delimiter = params.delimiter;
2408 let p_query_show_plan = params.show_plan;
2409 let p_query_include_delisted = params.include_delisted;
2410
2411 let uri_str = format!("{}/etfs", configuration.base_path);
2412 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2413
2414 if let Some(ref param_value) = p_query_symbol {
2415 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2416 }
2417 if let Some(ref param_value) = p_query_figi {
2418 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2419 }
2420 if let Some(ref param_value) = p_query_isin {
2421 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2422 }
2423 if let Some(ref param_value) = p_query_cusip {
2424 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2425 }
2426 if let Some(ref param_value) = p_query_cik {
2427 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2428 }
2429 if let Some(ref param_value) = p_query_exchange {
2430 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2431 }
2432 if let Some(ref param_value) = p_query_mic_code {
2433 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2434 }
2435 if let Some(ref param_value) = p_query_country {
2436 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2437 }
2438 if let Some(ref param_value) = p_query_format {
2439 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2440 }
2441 if let Some(ref param_value) = p_query_delimiter {
2442 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2443 }
2444 if let Some(ref param_value) = p_query_show_plan {
2445 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2446 }
2447 if let Some(ref param_value) = p_query_include_delisted {
2448 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
2449 }
2450 if let Some(ref user_agent) = configuration.user_agent {
2451 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2452 }
2453 if let Some(ref apikey) = configuration.api_key {
2454 let key = apikey.key.clone();
2455 let value = match apikey.prefix {
2456 Some(ref prefix) => format!("{} {}", prefix, key),
2457 None => key,
2458 };
2459 req_builder = req_builder.header("Authorization", value);
2460 };
2461
2462 let req = req_builder.build()?;
2463 let resp = configuration.client.execute(req).await?;
2464
2465 let status = resp.status();
2466 let content_type = resp
2467 .headers()
2468 .get("content-type")
2469 .and_then(|v| v.to_str().ok())
2470 .unwrap_or("application/octet-stream");
2471 let content_type = super::ContentType::from(content_type);
2472
2473 if !status.is_client_error() && !status.is_server_error() {
2474 let content = resp.text().await?;
2475 match content_type {
2476 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2477 ContentType::Text => return Ok(models::GetEtfResponse::Text(content)),
2478 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::GetEtfResponse`")))),
2479 }
2480 } else {
2481 let content = resp.text().await?;
2482 let entity: Option<GetEtfError> = serde_json::from_str(&content).ok();
2483 Err(Error::ResponseError(ResponseContent {
2484 status,
2485 content,
2486 entity,
2487 }))
2488 }
2489}
2490
2491pub async fn get_etfs_family(
2493 configuration: &configuration::Configuration,
2494 params: GetEtfsFamilyParams,
2495) -> Result<models::GetEtfsFamilyResponse, Error<GetEtfsFamilyError>> {
2496 let p_query_country = params.country;
2498 let p_query_fund_family = params.fund_family;
2499
2500 let uri_str = format!("{}/etfs/family", configuration.base_path);
2501 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2502
2503 if let Some(ref param_value) = p_query_country {
2504 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2505 }
2506 if let Some(ref param_value) = p_query_fund_family {
2507 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2508 }
2509 if let Some(ref user_agent) = configuration.user_agent {
2510 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2511 }
2512 if let Some(ref apikey) = configuration.api_key {
2513 let key = apikey.key.clone();
2514 let value = match apikey.prefix {
2515 Some(ref prefix) => format!("{} {}", prefix, key),
2516 None => key,
2517 };
2518 req_builder = req_builder.header("Authorization", value);
2519 };
2520
2521 let req = req_builder.build()?;
2522 let resp = configuration.client.execute(req).await?;
2523
2524 let status = resp.status();
2525 let content_type = resp
2526 .headers()
2527 .get("content-type")
2528 .and_then(|v| v.to_str().ok())
2529 .unwrap_or("application/octet-stream");
2530 let content_type = super::ContentType::from(content_type);
2531
2532 if !status.is_client_error() && !status.is_server_error() {
2533 let content = resp.text().await?;
2534 match content_type {
2535 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2536 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsFamilyResponse`"))),
2537 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::GetEtfsFamilyResponse`")))),
2538 }
2539 } else {
2540 let content = resp.text().await?;
2541 let entity: Option<GetEtfsFamilyError> = serde_json::from_str(&content).ok();
2542 Err(Error::ResponseError(ResponseContent {
2543 status,
2544 content,
2545 entity,
2546 }))
2547 }
2548}
2549
2550pub async fn get_etfs_list(
2552 configuration: &configuration::Configuration,
2553 params: GetEtfsListParams,
2554) -> Result<models::GetEtfsListResponse, Error<GetEtfsListError>> {
2555 let p_query_symbol = params.symbol;
2557 let p_query_figi = params.figi;
2558 let p_query_isin = params.isin;
2559 let p_query_cusip = params.cusip;
2560 let p_query_cik = params.cik;
2561 let p_query_country = params.country;
2562 let p_query_fund_family = params.fund_family;
2563 let p_query_fund_type = params.fund_type;
2564 let p_query_page = params.page;
2565 let p_query_outputsize = params.outputsize;
2566
2567 let uri_str = format!("{}/etfs/list", configuration.base_path);
2568 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2569
2570 if let Some(ref param_value) = p_query_symbol {
2571 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2572 }
2573 if let Some(ref param_value) = p_query_figi {
2574 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2575 }
2576 if let Some(ref param_value) = p_query_isin {
2577 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2578 }
2579 if let Some(ref param_value) = p_query_cusip {
2580 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2581 }
2582 if let Some(ref param_value) = p_query_cik {
2583 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2584 }
2585 if let Some(ref param_value) = p_query_country {
2586 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2587 }
2588 if let Some(ref param_value) = p_query_fund_family {
2589 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2590 }
2591 if let Some(ref param_value) = p_query_fund_type {
2592 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2593 }
2594 if let Some(ref param_value) = p_query_page {
2595 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2596 }
2597 if let Some(ref param_value) = p_query_outputsize {
2598 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2599 }
2600 if let Some(ref user_agent) = configuration.user_agent {
2601 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2602 }
2603 if let Some(ref apikey) = configuration.api_key {
2604 let key = apikey.key.clone();
2605 let value = match apikey.prefix {
2606 Some(ref prefix) => format!("{} {}", prefix, key),
2607 None => key,
2608 };
2609 req_builder = req_builder.header("Authorization", value);
2610 };
2611
2612 let req = req_builder.build()?;
2613 let resp = configuration.client.execute(req).await?;
2614
2615 let status = resp.status();
2616 let content_type = resp
2617 .headers()
2618 .get("content-type")
2619 .and_then(|v| v.to_str().ok())
2620 .unwrap_or("application/octet-stream");
2621 let content_type = super::ContentType::from(content_type);
2622
2623 if !status.is_client_error() && !status.is_server_error() {
2624 let content = resp.text().await?;
2625 match content_type {
2626 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2627 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsListResponse`"))),
2628 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::GetEtfsListResponse`")))),
2629 }
2630 } else {
2631 let content = resp.text().await?;
2632 let entity: Option<GetEtfsListError> = serde_json::from_str(&content).ok();
2633 Err(Error::ResponseError(ResponseContent {
2634 status,
2635 content,
2636 entity,
2637 }))
2638 }
2639}
2640
2641pub async fn get_etfs_type(
2643 configuration: &configuration::Configuration,
2644 params: GetEtfsTypeParams,
2645) -> Result<models::GetEtfsTypeResponse, Error<GetEtfsTypeError>> {
2646 let p_query_country = params.country;
2648 let p_query_fund_type = params.fund_type;
2649
2650 let uri_str = format!("{}/etfs/type", configuration.base_path);
2651 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2652
2653 if let Some(ref param_value) = p_query_country {
2654 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2655 }
2656 if let Some(ref param_value) = p_query_fund_type {
2657 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2658 }
2659 if let Some(ref user_agent) = configuration.user_agent {
2660 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2661 }
2662 if let Some(ref apikey) = configuration.api_key {
2663 let key = apikey.key.clone();
2664 let value = match apikey.prefix {
2665 Some(ref prefix) => format!("{} {}", prefix, key),
2666 None => key,
2667 };
2668 req_builder = req_builder.header("Authorization", value);
2669 };
2670
2671 let req = req_builder.build()?;
2672 let resp = configuration.client.execute(req).await?;
2673
2674 let status = resp.status();
2675 let content_type = resp
2676 .headers()
2677 .get("content-type")
2678 .and_then(|v| v.to_str().ok())
2679 .unwrap_or("application/octet-stream");
2680 let content_type = super::ContentType::from(content_type);
2681
2682 if !status.is_client_error() && !status.is_server_error() {
2683 let content = resp.text().await?;
2684 match content_type {
2685 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2686 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsTypeResponse`"))),
2687 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::GetEtfsTypeResponse`")))),
2688 }
2689 } else {
2690 let content = resp.text().await?;
2691 let entity: Option<GetEtfsTypeError> = serde_json::from_str(&content).ok();
2692 Err(Error::ResponseError(ResponseContent {
2693 status,
2694 content,
2695 entity,
2696 }))
2697 }
2698}
2699
2700pub async fn get_exchange_schedule(
2702 configuration: &configuration::Configuration,
2703 params: GetExchangeScheduleParams,
2704) -> Result<models::GetExchangeScheduleResponse, Error<GetExchangeScheduleError>> {
2705 let p_query_mic_name = params.mic_name;
2707 let p_query_mic_code = params.mic_code;
2708 let p_query_country = params.country;
2709 let p_query_date = params.date;
2710
2711 let uri_str = format!("{}/exchange_schedule", configuration.base_path);
2712 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2713
2714 if let Some(ref param_value) = p_query_mic_name {
2715 req_builder = req_builder.query(&[("mic_name", ¶m_value.to_string())]);
2716 }
2717 if let Some(ref param_value) = p_query_mic_code {
2718 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2719 }
2720 if let Some(ref param_value) = p_query_country {
2721 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2722 }
2723 if let Some(ref param_value) = p_query_date {
2724 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
2725 }
2726 if let Some(ref user_agent) = configuration.user_agent {
2727 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2728 }
2729 if let Some(ref apikey) = configuration.api_key {
2730 let key = apikey.key.clone();
2731 let value = match apikey.prefix {
2732 Some(ref prefix) => format!("{} {}", prefix, key),
2733 None => key,
2734 };
2735 req_builder = req_builder.header("Authorization", value);
2736 };
2737
2738 let req = req_builder.build()?;
2739 let resp = configuration.client.execute(req).await?;
2740
2741 let status = resp.status();
2742 let content_type = resp
2743 .headers()
2744 .get("content-type")
2745 .and_then(|v| v.to_str().ok())
2746 .unwrap_or("application/octet-stream");
2747 let content_type = super::ContentType::from(content_type);
2748
2749 if !status.is_client_error() && !status.is_server_error() {
2750 let content = resp.text().await?;
2751 match content_type {
2752 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2753 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetExchangeScheduleResponse`"))),
2754 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::GetExchangeScheduleResponse`")))),
2755 }
2756 } else {
2757 let content = resp.text().await?;
2758 let entity: Option<GetExchangeScheduleError> = serde_json::from_str(&content).ok();
2759 Err(Error::ResponseError(ResponseContent {
2760 status,
2761 content,
2762 entity,
2763 }))
2764 }
2765}
2766
2767pub async fn get_exchanges(
2769 configuration: &configuration::Configuration,
2770 params: GetExchangesParams,
2771) -> Result<models::GetExchangesResponse, Error<GetExchangesError>> {
2772 let p_query_type = params.r#type;
2774 let p_query_name = params.name;
2775 let p_query_code = params.code;
2776 let p_query_country = params.country;
2777 let p_query_format = params.format;
2778 let p_query_delimiter = params.delimiter;
2779 let p_query_show_plan = params.show_plan;
2780
2781 let uri_str = format!("{}/exchanges", configuration.base_path);
2782 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2783
2784 if let Some(ref param_value) = p_query_type {
2785 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
2786 }
2787 if let Some(ref param_value) = p_query_name {
2788 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2789 }
2790 if let Some(ref param_value) = p_query_code {
2791 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
2792 }
2793 if let Some(ref param_value) = p_query_country {
2794 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2795 }
2796 if let Some(ref param_value) = p_query_format {
2797 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2798 }
2799 if let Some(ref param_value) = p_query_delimiter {
2800 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2801 }
2802 if let Some(ref param_value) = p_query_show_plan {
2803 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2804 }
2805 if let Some(ref user_agent) = configuration.user_agent {
2806 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2807 }
2808 if let Some(ref apikey) = configuration.api_key {
2809 let key = apikey.key.clone();
2810 let value = match apikey.prefix {
2811 Some(ref prefix) => format!("{} {}", prefix, key),
2812 None => key,
2813 };
2814 req_builder = req_builder.header("Authorization", value);
2815 };
2816
2817 let req = req_builder.build()?;
2818 let resp = configuration.client.execute(req).await?;
2819
2820 let status = resp.status();
2821 let content_type = resp
2822 .headers()
2823 .get("content-type")
2824 .and_then(|v| v.to_str().ok())
2825 .unwrap_or("application/octet-stream");
2826 let content_type = super::ContentType::from(content_type);
2827
2828 if !status.is_client_error() && !status.is_server_error() {
2829 let content = resp.text().await?;
2830 match content_type {
2831 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2832 ContentType::Text => return Ok(models::GetExchangesResponse::Text(content)),
2833 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::GetExchangesResponse`")))),
2834 }
2835 } else {
2836 let content = resp.text().await?;
2837 let entity: Option<GetExchangesError> = serde_json::from_str(&content).ok();
2838 Err(Error::ResponseError(ResponseContent {
2839 status,
2840 content,
2841 entity,
2842 }))
2843 }
2844}
2845
2846pub async fn get_forex_pairs(
2848 configuration: &configuration::Configuration,
2849 params: GetForexPairsParams,
2850) -> Result<models::GetForexPairsResponse, Error<GetForexPairsError>> {
2851 let p_query_symbol = params.symbol;
2853 let p_query_currency_base = params.currency_base;
2854 let p_query_currency_quote = params.currency_quote;
2855 let p_query_format = params.format;
2856 let p_query_delimiter = params.delimiter;
2857
2858 let uri_str = format!("{}/forex_pairs", configuration.base_path);
2859 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2860
2861 if let Some(ref param_value) = p_query_symbol {
2862 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2863 }
2864 if let Some(ref param_value) = p_query_currency_base {
2865 req_builder = req_builder.query(&[("currency_base", ¶m_value.to_string())]);
2866 }
2867 if let Some(ref param_value) = p_query_currency_quote {
2868 req_builder = req_builder.query(&[("currency_quote", ¶m_value.to_string())]);
2869 }
2870 if let Some(ref param_value) = p_query_format {
2871 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2872 }
2873 if let Some(ref param_value) = p_query_delimiter {
2874 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2875 }
2876 if let Some(ref user_agent) = configuration.user_agent {
2877 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2878 }
2879 if let Some(ref apikey) = configuration.api_key {
2880 let key = apikey.key.clone();
2881 let value = match apikey.prefix {
2882 Some(ref prefix) => format!("{} {}", prefix, key),
2883 None => key,
2884 };
2885 req_builder = req_builder.header("Authorization", value);
2886 };
2887
2888 let req = req_builder.build()?;
2889 let resp = configuration.client.execute(req).await?;
2890
2891 let status = resp.status();
2892 let content_type = resp
2893 .headers()
2894 .get("content-type")
2895 .and_then(|v| v.to_str().ok())
2896 .unwrap_or("application/octet-stream");
2897 let content_type = super::ContentType::from(content_type);
2898
2899 if !status.is_client_error() && !status.is_server_error() {
2900 let content = resp.text().await?;
2901 match content_type {
2902 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2903 ContentType::Text => return Ok(models::GetForexPairsResponse::Text(content)),
2904 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::GetForexPairsResponse`")))),
2905 }
2906 } else {
2907 let content = resp.text().await?;
2908 let entity: Option<GetForexPairsError> = serde_json::from_str(&content).ok();
2909 Err(Error::ResponseError(ResponseContent {
2910 status,
2911 content,
2912 entity,
2913 }))
2914 }
2915}
2916
2917pub async fn get_funds(
2919 configuration: &configuration::Configuration,
2920 params: GetFundsParams,
2921) -> Result<models::GetFundsResponse, Error<GetFundsError>> {
2922 let p_query_symbol = params.symbol;
2924 let p_query_figi = params.figi;
2925 let p_query_isin = params.isin;
2926 let p_query_cusip = params.cusip;
2927 let p_query_cik = params.cik;
2928 let p_query_exchange = params.exchange;
2929 let p_query_country = params.country;
2930 let p_query_format = params.format;
2931 let p_query_delimiter = params.delimiter;
2932 let p_query_show_plan = params.show_plan;
2933 let p_query_page = params.page;
2934 let p_query_outputsize = params.outputsize;
2935
2936 let uri_str = format!("{}/funds", configuration.base_path);
2937 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2938
2939 if let Some(ref param_value) = p_query_symbol {
2940 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2941 }
2942 if let Some(ref param_value) = p_query_figi {
2943 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2944 }
2945 if let Some(ref param_value) = p_query_isin {
2946 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2947 }
2948 if let Some(ref param_value) = p_query_cusip {
2949 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2950 }
2951 if let Some(ref param_value) = p_query_cik {
2952 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2953 }
2954 if let Some(ref param_value) = p_query_exchange {
2955 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2956 }
2957 if let Some(ref param_value) = p_query_country {
2958 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2959 }
2960 if let Some(ref param_value) = p_query_format {
2961 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2962 }
2963 if let Some(ref param_value) = p_query_delimiter {
2964 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2965 }
2966 if let Some(ref param_value) = p_query_show_plan {
2967 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2968 }
2969 if let Some(ref param_value) = p_query_page {
2970 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2971 }
2972 if let Some(ref param_value) = p_query_outputsize {
2973 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2974 }
2975 if let Some(ref user_agent) = configuration.user_agent {
2976 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2977 }
2978 if let Some(ref apikey) = configuration.api_key {
2979 let key = apikey.key.clone();
2980 let value = match apikey.prefix {
2981 Some(ref prefix) => format!("{} {}", prefix, key),
2982 None => key,
2983 };
2984 req_builder = req_builder.header("Authorization", value);
2985 };
2986
2987 let req = req_builder.build()?;
2988 let resp = configuration.client.execute(req).await?;
2989
2990 let status = resp.status();
2991 let content_type = resp
2992 .headers()
2993 .get("content-type")
2994 .and_then(|v| v.to_str().ok())
2995 .unwrap_or("application/octet-stream");
2996 let content_type = super::ContentType::from(content_type);
2997
2998 if !status.is_client_error() && !status.is_server_error() {
2999 let content = resp.text().await?;
3000 match content_type {
3001 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3002 ContentType::Text => return Ok(models::GetFundsResponse::Text(content)),
3003 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::GetFundsResponse`")))),
3004 }
3005 } else {
3006 let content = resp.text().await?;
3007 let entity: Option<GetFundsError> = serde_json::from_str(&content).ok();
3008 Err(Error::ResponseError(ResponseContent {
3009 status,
3010 content,
3011 entity,
3012 }))
3013 }
3014}
3015
3016pub async fn get_instrument_type(
3018 configuration: &configuration::Configuration,
3019) -> Result<models::GetInstrumentTypeResponse, Error<GetInstrumentTypeError>> {
3020 let uri_str = format!("{}/instrument_type", configuration.base_path);
3021 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3022
3023 if let Some(ref user_agent) = configuration.user_agent {
3024 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3025 }
3026 if let Some(ref apikey) = configuration.api_key {
3027 let key = apikey.key.clone();
3028 let value = match apikey.prefix {
3029 Some(ref prefix) => format!("{} {}", prefix, key),
3030 None => key,
3031 };
3032 req_builder = req_builder.header("Authorization", value);
3033 };
3034
3035 let req = req_builder.build()?;
3036 let resp = configuration.client.execute(req).await?;
3037
3038 let status = resp.status();
3039 let content_type = resp
3040 .headers()
3041 .get("content-type")
3042 .and_then(|v| v.to_str().ok())
3043 .unwrap_or("application/octet-stream");
3044 let content_type = super::ContentType::from(content_type);
3045
3046 if !status.is_client_error() && !status.is_server_error() {
3047 let content = resp.text().await?;
3048 match content_type {
3049 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3050 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetInstrumentTypeResponse`"))),
3051 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::GetInstrumentTypeResponse`")))),
3052 }
3053 } else {
3054 let content = resp.text().await?;
3055 let entity: Option<GetInstrumentTypeError> = serde_json::from_str(&content).ok();
3056 Err(Error::ResponseError(ResponseContent {
3057 status,
3058 content,
3059 entity,
3060 }))
3061 }
3062}
3063
3064pub async fn get_intervals(
3066 configuration: &configuration::Configuration,
3067) -> Result<models::GetIntervalsResponse, Error<GetIntervalsError>> {
3068 let uri_str = format!("{}/intervals", configuration.base_path);
3069 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3070
3071 if let Some(ref user_agent) = configuration.user_agent {
3072 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3073 }
3074 if let Some(ref apikey) = configuration.api_key {
3075 let key = apikey.key.clone();
3076 let value = match apikey.prefix {
3077 Some(ref prefix) => format!("{} {}", prefix, key),
3078 None => key,
3079 };
3080 req_builder = req_builder.header("Authorization", value);
3081 };
3082
3083 let req = req_builder.build()?;
3084 let resp = configuration.client.execute(req).await?;
3085
3086 let status = resp.status();
3087 let content_type = resp
3088 .headers()
3089 .get("content-type")
3090 .and_then(|v| v.to_str().ok())
3091 .unwrap_or("application/octet-stream");
3092 let content_type = super::ContentType::from(content_type);
3093
3094 if !status.is_client_error() && !status.is_server_error() {
3095 let content = resp.text().await?;
3096 match content_type {
3097 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3098 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIntervalsResponse`"))),
3099 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::GetIntervalsResponse`")))),
3100 }
3101 } else {
3102 let content = resp.text().await?;
3103 let entity: Option<GetIntervalsError> = serde_json::from_str(&content).ok();
3104 Err(Error::ResponseError(ResponseContent {
3105 status,
3106 content,
3107 entity,
3108 }))
3109 }
3110}
3111
3112pub async fn get_market_state(
3114 configuration: &configuration::Configuration,
3115 params: GetMarketStateParams,
3116) -> Result<models::GetMarketStateResponse, Error<GetMarketStateError>> {
3117 let p_query_exchange = params.exchange;
3119 let p_query_code = params.code;
3120 let p_query_country = params.country;
3121
3122 let uri_str = format!("{}/market_state", configuration.base_path);
3123 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3124
3125 if let Some(ref param_value) = p_query_exchange {
3126 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3127 }
3128 if let Some(ref param_value) = p_query_code {
3129 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
3130 }
3131 if let Some(ref param_value) = p_query_country {
3132 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3133 }
3134 if let Some(ref user_agent) = configuration.user_agent {
3135 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3136 }
3137 if let Some(ref apikey) = configuration.api_key {
3138 let key = apikey.key.clone();
3139 let value = match apikey.prefix {
3140 Some(ref prefix) => format!("{} {}", prefix, key),
3141 None => key,
3142 };
3143 req_builder = req_builder.header("Authorization", value);
3144 };
3145
3146 let req = req_builder.build()?;
3147 let resp = configuration.client.execute(req).await?;
3148
3149 let status = resp.status();
3150 let content_type = resp
3151 .headers()
3152 .get("content-type")
3153 .and_then(|v| v.to_str().ok())
3154 .unwrap_or("application/octet-stream");
3155 let content_type = super::ContentType::from(content_type);
3156
3157 if !status.is_client_error() && !status.is_server_error() {
3158 let content = resp.text().await?;
3159 match content_type {
3160 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3161 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMarketStateResponse`"))),
3162 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::GetMarketStateResponse`")))),
3163 }
3164 } else {
3165 let content = resp.text().await?;
3166 let entity: Option<GetMarketStateError> = serde_json::from_str(&content).ok();
3167 Err(Error::ResponseError(ResponseContent {
3168 status,
3169 content,
3170 entity,
3171 }))
3172 }
3173}
3174
3175pub async fn get_mutual_funds_family(
3177 configuration: &configuration::Configuration,
3178 params: GetMutualFundsFamilyParams,
3179) -> Result<models::GetMutualFundsFamilyResponse, Error<GetMutualFundsFamilyError>> {
3180 let p_query_fund_family = params.fund_family;
3182 let p_query_country = params.country;
3183
3184 let uri_str = format!("{}/mutual_funds/family", configuration.base_path);
3185 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3186
3187 if let Some(ref param_value) = p_query_fund_family {
3188 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3189 }
3190 if let Some(ref param_value) = p_query_country {
3191 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3192 }
3193 if let Some(ref user_agent) = configuration.user_agent {
3194 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3195 }
3196 if let Some(ref apikey) = configuration.api_key {
3197 let key = apikey.key.clone();
3198 let value = match apikey.prefix {
3199 Some(ref prefix) => format!("{} {}", prefix, key),
3200 None => key,
3201 };
3202 req_builder = req_builder.header("Authorization", value);
3203 };
3204
3205 let req = req_builder.build()?;
3206 let resp = configuration.client.execute(req).await?;
3207
3208 let status = resp.status();
3209 let content_type = resp
3210 .headers()
3211 .get("content-type")
3212 .and_then(|v| v.to_str().ok())
3213 .unwrap_or("application/octet-stream");
3214 let content_type = super::ContentType::from(content_type);
3215
3216 if !status.is_client_error() && !status.is_server_error() {
3217 let content = resp.text().await?;
3218 match content_type {
3219 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3220 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsFamilyResponse`"))),
3221 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::GetMutualFundsFamilyResponse`")))),
3222 }
3223 } else {
3224 let content = resp.text().await?;
3225 let entity: Option<GetMutualFundsFamilyError> = serde_json::from_str(&content).ok();
3226 Err(Error::ResponseError(ResponseContent {
3227 status,
3228 content,
3229 entity,
3230 }))
3231 }
3232}
3233
3234pub async fn get_mutual_funds_list(
3236 configuration: &configuration::Configuration,
3237 params: GetMutualFundsListParams,
3238) -> Result<models::GetMutualFundsListResponse, Error<GetMutualFundsListError>> {
3239 let p_query_symbol = params.symbol;
3241 let p_query_figi = params.figi;
3242 let p_query_isin = params.isin;
3243 let p_query_cusip = params.cusip;
3244 let p_query_cik = params.cik;
3245 let p_query_country = params.country;
3246 let p_query_fund_family = params.fund_family;
3247 let p_query_fund_type = params.fund_type;
3248 let p_query_performance_rating = params.performance_rating;
3249 let p_query_risk_rating = params.risk_rating;
3250 let p_query_page = params.page;
3251 let p_query_outputsize = params.outputsize;
3252
3253 let uri_str = format!("{}/mutual_funds/list", configuration.base_path);
3254 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3255
3256 if let Some(ref param_value) = p_query_symbol {
3257 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3258 }
3259 if let Some(ref param_value) = p_query_figi {
3260 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3261 }
3262 if let Some(ref param_value) = p_query_isin {
3263 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3264 }
3265 if let Some(ref param_value) = p_query_cusip {
3266 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3267 }
3268 if let Some(ref param_value) = p_query_cik {
3269 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3270 }
3271 if let Some(ref param_value) = p_query_country {
3272 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3273 }
3274 if let Some(ref param_value) = p_query_fund_family {
3275 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3276 }
3277 if let Some(ref param_value) = p_query_fund_type {
3278 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3279 }
3280 if let Some(ref param_value) = p_query_performance_rating {
3281 req_builder = req_builder.query(&[("performance_rating", ¶m_value.to_string())]);
3282 }
3283 if let Some(ref param_value) = p_query_risk_rating {
3284 req_builder = req_builder.query(&[("risk_rating", ¶m_value.to_string())]);
3285 }
3286 if let Some(ref param_value) = p_query_page {
3287 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3288 }
3289 if let Some(ref param_value) = p_query_outputsize {
3290 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3291 }
3292 if let Some(ref user_agent) = configuration.user_agent {
3293 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3294 }
3295 if let Some(ref apikey) = configuration.api_key {
3296 let key = apikey.key.clone();
3297 let value = match apikey.prefix {
3298 Some(ref prefix) => format!("{} {}", prefix, key),
3299 None => key,
3300 };
3301 req_builder = req_builder.header("Authorization", value);
3302 };
3303
3304 let req = req_builder.build()?;
3305 let resp = configuration.client.execute(req).await?;
3306
3307 let status = resp.status();
3308 let content_type = resp
3309 .headers()
3310 .get("content-type")
3311 .and_then(|v| v.to_str().ok())
3312 .unwrap_or("application/octet-stream");
3313 let content_type = super::ContentType::from(content_type);
3314
3315 if !status.is_client_error() && !status.is_server_error() {
3316 let content = resp.text().await?;
3317 match content_type {
3318 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3319 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsListResponse`"))),
3320 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::GetMutualFundsListResponse`")))),
3321 }
3322 } else {
3323 let content = resp.text().await?;
3324 let entity: Option<GetMutualFundsListError> = serde_json::from_str(&content).ok();
3325 Err(Error::ResponseError(ResponseContent {
3326 status,
3327 content,
3328 entity,
3329 }))
3330 }
3331}
3332
3333pub async fn get_mutual_funds_type(
3335 configuration: &configuration::Configuration,
3336 params: GetMutualFundsTypeParams,
3337) -> Result<models::GetMutualFundsTypeResponse, Error<GetMutualFundsTypeError>> {
3338 let p_query_fund_type = params.fund_type;
3340 let p_query_country = params.country;
3341
3342 let uri_str = format!("{}/mutual_funds/type", configuration.base_path);
3343 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3344
3345 if let Some(ref param_value) = p_query_fund_type {
3346 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3347 }
3348 if let Some(ref param_value) = p_query_country {
3349 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3350 }
3351 if let Some(ref user_agent) = configuration.user_agent {
3352 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3353 }
3354 if let Some(ref apikey) = configuration.api_key {
3355 let key = apikey.key.clone();
3356 let value = match apikey.prefix {
3357 Some(ref prefix) => format!("{} {}", prefix, key),
3358 None => key,
3359 };
3360 req_builder = req_builder.header("Authorization", value);
3361 };
3362
3363 let req = req_builder.build()?;
3364 let resp = configuration.client.execute(req).await?;
3365
3366 let status = resp.status();
3367 let content_type = resp
3368 .headers()
3369 .get("content-type")
3370 .and_then(|v| v.to_str().ok())
3371 .unwrap_or("application/octet-stream");
3372 let content_type = super::ContentType::from(content_type);
3373
3374 if !status.is_client_error() && !status.is_server_error() {
3375 let content = resp.text().await?;
3376 match content_type {
3377 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3378 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsTypeResponse`"))),
3379 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::GetMutualFundsTypeResponse`")))),
3380 }
3381 } else {
3382 let content = resp.text().await?;
3383 let entity: Option<GetMutualFundsTypeError> = serde_json::from_str(&content).ok();
3384 Err(Error::ResponseError(ResponseContent {
3385 status,
3386 content,
3387 entity,
3388 }))
3389 }
3390}
3391
3392pub async fn get_stocks(
3394 configuration: &configuration::Configuration,
3395 params: GetStocksParams,
3396) -> Result<models::GetStocksResponse, Error<GetStocksError>> {
3397 let p_query_symbol = params.symbol;
3399 let p_query_figi = params.figi;
3400 let p_query_isin = params.isin;
3401 let p_query_cusip = params.cusip;
3402 let p_query_cik = params.cik;
3403 let p_query_exchange = params.exchange;
3404 let p_query_mic_code = params.mic_code;
3405 let p_query_country = params.country;
3406 let p_query_type = params.r#type;
3407 let p_query_format = params.format;
3408 let p_query_delimiter = params.delimiter;
3409 let p_query_show_plan = params.show_plan;
3410 let p_query_include_delisted = params.include_delisted;
3411
3412 let uri_str = format!("{}/stocks", configuration.base_path);
3413 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3414
3415 if let Some(ref param_value) = p_query_symbol {
3416 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3417 }
3418 if let Some(ref param_value) = p_query_figi {
3419 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3420 }
3421 if let Some(ref param_value) = p_query_isin {
3422 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3423 }
3424 if let Some(ref param_value) = p_query_cusip {
3425 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3426 }
3427 if let Some(ref param_value) = p_query_cik {
3428 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3429 }
3430 if let Some(ref param_value) = p_query_exchange {
3431 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3432 }
3433 if let Some(ref param_value) = p_query_mic_code {
3434 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
3435 }
3436 if let Some(ref param_value) = p_query_country {
3437 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3438 }
3439 if let Some(ref param_value) = p_query_type {
3440 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
3441 }
3442 if let Some(ref param_value) = p_query_format {
3443 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
3444 }
3445 if let Some(ref param_value) = p_query_delimiter {
3446 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
3447 }
3448 if let Some(ref param_value) = p_query_show_plan {
3449 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3450 }
3451 if let Some(ref param_value) = p_query_include_delisted {
3452 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
3453 }
3454 if let Some(ref user_agent) = configuration.user_agent {
3455 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3456 }
3457 if let Some(ref apikey) = configuration.api_key {
3458 let key = apikey.key.clone();
3459 let value = match apikey.prefix {
3460 Some(ref prefix) => format!("{} {}", prefix, key),
3461 None => key,
3462 };
3463 req_builder = req_builder.header("Authorization", value);
3464 };
3465
3466 let req = req_builder.build()?;
3467 let resp = configuration.client.execute(req).await?;
3468
3469 let status = resp.status();
3470 let content_type = resp
3471 .headers()
3472 .get("content-type")
3473 .and_then(|v| v.to_str().ok())
3474 .unwrap_or("application/octet-stream");
3475 let content_type = super::ContentType::from(content_type);
3476
3477 if !status.is_client_error() && !status.is_server_error() {
3478 let content = resp.text().await?;
3479 match content_type {
3480 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3481 ContentType::Text => return Ok(models::GetStocksResponse::Text(content)),
3482 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::GetStocksResponse`")))),
3483 }
3484 } else {
3485 let content = resp.text().await?;
3486 let entity: Option<GetStocksError> = serde_json::from_str(&content).ok();
3487 Err(Error::ResponseError(ResponseContent {
3488 status,
3489 content,
3490 entity,
3491 }))
3492 }
3493}
3494
3495pub async fn get_symbol_search(
3497 configuration: &configuration::Configuration,
3498 params: GetSymbolSearchParams,
3499) -> Result<models::GetSymbolSearchResponse, Error<GetSymbolSearchError>> {
3500 let p_query_symbol = params.symbol;
3502 let p_query_outputsize = params.outputsize;
3503 let p_query_show_plan = params.show_plan;
3504
3505 let uri_str = format!("{}/symbol_search", configuration.base_path);
3506 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3507
3508 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3509 if let Some(ref param_value) = p_query_outputsize {
3510 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3511 }
3512 if let Some(ref param_value) = p_query_show_plan {
3513 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3514 }
3515 if let Some(ref user_agent) = configuration.user_agent {
3516 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3517 }
3518 if let Some(ref apikey) = configuration.api_key {
3519 let key = apikey.key.clone();
3520 let value = match apikey.prefix {
3521 Some(ref prefix) => format!("{} {}", prefix, key),
3522 None => key,
3523 };
3524 req_builder = req_builder.header("Authorization", value);
3525 };
3526
3527 let req = req_builder.build()?;
3528 let resp = configuration.client.execute(req).await?;
3529
3530 let status = resp.status();
3531 let content_type = resp
3532 .headers()
3533 .get("content-type")
3534 .and_then(|v| v.to_str().ok())
3535 .unwrap_or("application/octet-stream");
3536 let content_type = super::ContentType::from(content_type);
3537
3538 if !status.is_client_error() && !status.is_server_error() {
3539 let content = resp.text().await?;
3540 match content_type {
3541 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3542 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSymbolSearchResponse`"))),
3543 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::GetSymbolSearchResponse`")))),
3544 }
3545 } else {
3546 let content = resp.text().await?;
3547 let entity: Option<GetSymbolSearchError> = serde_json::from_str(&content).ok();
3548 Err(Error::ResponseError(ResponseContent {
3549 status,
3550 content,
3551 entity,
3552 }))
3553 }
3554}
3555
3556pub async fn get_technical_indicators(
3558 configuration: &configuration::Configuration,
3559) -> Result<models::GetTechnicalIndicatorsResponse, Error<GetTechnicalIndicatorsError>> {
3560 let uri_str = format!("{}/technical_indicators", configuration.base_path);
3561 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3562
3563 if let Some(ref user_agent) = configuration.user_agent {
3564 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3565 }
3566 if let Some(ref apikey) = configuration.api_key {
3567 let key = apikey.key.clone();
3568 let value = match apikey.prefix {
3569 Some(ref prefix) => format!("{} {}", prefix, key),
3570 None => key,
3571 };
3572 req_builder = req_builder.header("Authorization", value);
3573 };
3574
3575 let req = req_builder.build()?;
3576 let resp = configuration.client.execute(req).await?;
3577
3578 let status = resp.status();
3579 let content_type = resp
3580 .headers()
3581 .get("content-type")
3582 .and_then(|v| v.to_str().ok())
3583 .unwrap_or("application/octet-stream");
3584 let content_type = super::ContentType::from(content_type);
3585
3586 if !status.is_client_error() && !status.is_server_error() {
3587 let content = resp.text().await?;
3588 match content_type {
3589 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3590 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetTechnicalIndicatorsResponse`"))),
3591 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::GetTechnicalIndicatorsResponse`")))),
3592 }
3593 } else {
3594 let content = resp.text().await?;
3595 let entity: Option<GetTechnicalIndicatorsError> = serde_json::from_str(&content).ok();
3596 Err(Error::ResponseError(ResponseContent {
3597 status,
3598 content,
3599 entity,
3600 }))
3601 }
3602}