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::GetBonds200ResponseEnum, 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::GetBonds200ResponseEnum::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::GetBonds200ResponseEnum`")))),
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::GetCommodities200ResponseEnum, 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::GetCommodities200ResponseEnum::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::GetCommodities200ResponseEnum`")))),
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::GetCountries200ResponseEnum, 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::GetCountries200ResponseEnum`"))),
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::GetCountries200ResponseEnum`")))),
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::GetCrossListings200ResponseEnum, 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::GetCrossListings200ResponseEnum`"))),
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::GetCrossListings200ResponseEnum`")))),
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::GetCryptocurrencies200ResponseEnum, 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::GetCryptocurrencies200ResponseEnum::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::GetCryptocurrencies200ResponseEnum`")))),
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::GetCryptocurrencyExchanges200ResponseEnum, Error<GetCryptocurrencyExchangesError>>
2257{
2258 let p_query_format = params.format;
2260 let p_query_delimiter = params.delimiter;
2261
2262 let uri_str = format!("{}/cryptocurrency_exchanges", configuration.base_path);
2263 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2264
2265 if let Some(ref param_value) = p_query_format {
2266 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2267 }
2268 if let Some(ref param_value) = p_query_delimiter {
2269 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2270 }
2271 if let Some(ref user_agent) = configuration.user_agent {
2272 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2273 }
2274 if let Some(ref apikey) = configuration.api_key {
2275 let key = apikey.key.clone();
2276 let value = match apikey.prefix {
2277 Some(ref prefix) => format!("{} {}", prefix, key),
2278 None => key,
2279 };
2280 req_builder = req_builder.header("Authorization", value);
2281 };
2282
2283 let req = req_builder.build()?;
2284 let resp = configuration.client.execute(req).await?;
2285
2286 let status = resp.status();
2287 let content_type = resp
2288 .headers()
2289 .get("content-type")
2290 .and_then(|v| v.to_str().ok())
2291 .unwrap_or("application/octet-stream");
2292 let content_type = super::ContentType::from(content_type);
2293
2294 if !status.is_client_error() && !status.is_server_error() {
2295 let content = resp.text().await?;
2296 match content_type {
2297 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2298 ContentType::Text => return Ok(models::GetCryptocurrencyExchanges200ResponseEnum::Text(content)),
2299 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::GetCryptocurrencyExchanges200ResponseEnum`")))),
2300 }
2301 } else {
2302 let content = resp.text().await?;
2303 let entity: Option<GetCryptocurrencyExchangesError> = serde_json::from_str(&content).ok();
2304 Err(Error::ResponseError(ResponseContent {
2305 status,
2306 content,
2307 entity,
2308 }))
2309 }
2310}
2311
2312pub async fn get_earliest_timestamp(
2314 configuration: &configuration::Configuration,
2315 params: GetEarliestTimestampParams,
2316) -> Result<models::GetEarliestTimestamp200ResponseEnum, Error<GetEarliestTimestampError>> {
2317 let p_query_interval = params.interval;
2319 let p_query_symbol = params.symbol;
2320 let p_query_figi = params.figi;
2321 let p_query_isin = params.isin;
2322 let p_query_cusip = params.cusip;
2323 let p_query_exchange = params.exchange;
2324 let p_query_mic_code = params.mic_code;
2325 let p_query_timezone = params.timezone;
2326
2327 let uri_str = format!("{}/earliest_timestamp", configuration.base_path);
2328 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2329
2330 if let Some(ref param_value) = p_query_symbol {
2331 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2332 }
2333 if let Some(ref param_value) = p_query_figi {
2334 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2335 }
2336 if let Some(ref param_value) = p_query_isin {
2337 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2338 }
2339 if let Some(ref param_value) = p_query_cusip {
2340 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2341 }
2342 req_builder = req_builder.query(&[("interval", &p_query_interval.to_string())]);
2343 if let Some(ref param_value) = p_query_exchange {
2344 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2345 }
2346 if let Some(ref param_value) = p_query_mic_code {
2347 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2348 }
2349 if let Some(ref param_value) = p_query_timezone {
2350 req_builder = req_builder.query(&[("timezone", ¶m_value.to_string())]);
2351 }
2352 if let Some(ref user_agent) = configuration.user_agent {
2353 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2354 }
2355 if let Some(ref apikey) = configuration.api_key {
2356 let key = apikey.key.clone();
2357 let value = match apikey.prefix {
2358 Some(ref prefix) => format!("{} {}", prefix, key),
2359 None => key,
2360 };
2361 req_builder = req_builder.header("Authorization", value);
2362 };
2363
2364 let req = req_builder.build()?;
2365 let resp = configuration.client.execute(req).await?;
2366
2367 let status = resp.status();
2368 let content_type = resp
2369 .headers()
2370 .get("content-type")
2371 .and_then(|v| v.to_str().ok())
2372 .unwrap_or("application/octet-stream");
2373 let content_type = super::ContentType::from(content_type);
2374
2375 if !status.is_client_error() && !status.is_server_error() {
2376 let content = resp.text().await?;
2377 match content_type {
2378 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2379 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEarliestTimestamp200ResponseEnum`"))),
2380 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::GetEarliestTimestamp200ResponseEnum`")))),
2381 }
2382 } else {
2383 let content = resp.text().await?;
2384 let entity: Option<GetEarliestTimestampError> = serde_json::from_str(&content).ok();
2385 Err(Error::ResponseError(ResponseContent {
2386 status,
2387 content,
2388 entity,
2389 }))
2390 }
2391}
2392
2393pub async fn get_etf(
2395 configuration: &configuration::Configuration,
2396 params: GetEtfParams,
2397) -> Result<models::GetEtf200ResponseEnum, Error<GetEtfError>> {
2398 let p_query_symbol = params.symbol;
2400 let p_query_figi = params.figi;
2401 let p_query_isin = params.isin;
2402 let p_query_cusip = params.cusip;
2403 let p_query_cik = params.cik;
2404 let p_query_exchange = params.exchange;
2405 let p_query_mic_code = params.mic_code;
2406 let p_query_country = params.country;
2407 let p_query_format = params.format;
2408 let p_query_delimiter = params.delimiter;
2409 let p_query_show_plan = params.show_plan;
2410 let p_query_include_delisted = params.include_delisted;
2411
2412 let uri_str = format!("{}/etfs", configuration.base_path);
2413 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2414
2415 if let Some(ref param_value) = p_query_symbol {
2416 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2417 }
2418 if let Some(ref param_value) = p_query_figi {
2419 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2420 }
2421 if let Some(ref param_value) = p_query_isin {
2422 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2423 }
2424 if let Some(ref param_value) = p_query_cusip {
2425 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2426 }
2427 if let Some(ref param_value) = p_query_cik {
2428 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2429 }
2430 if let Some(ref param_value) = p_query_exchange {
2431 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2432 }
2433 if let Some(ref param_value) = p_query_mic_code {
2434 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2435 }
2436 if let Some(ref param_value) = p_query_country {
2437 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2438 }
2439 if let Some(ref param_value) = p_query_format {
2440 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2441 }
2442 if let Some(ref param_value) = p_query_delimiter {
2443 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2444 }
2445 if let Some(ref param_value) = p_query_show_plan {
2446 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2447 }
2448 if let Some(ref param_value) = p_query_include_delisted {
2449 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
2450 }
2451 if let Some(ref user_agent) = configuration.user_agent {
2452 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2453 }
2454 if let Some(ref apikey) = configuration.api_key {
2455 let key = apikey.key.clone();
2456 let value = match apikey.prefix {
2457 Some(ref prefix) => format!("{} {}", prefix, key),
2458 None => key,
2459 };
2460 req_builder = req_builder.header("Authorization", value);
2461 };
2462
2463 let req = req_builder.build()?;
2464 let resp = configuration.client.execute(req).await?;
2465
2466 let status = resp.status();
2467 let content_type = resp
2468 .headers()
2469 .get("content-type")
2470 .and_then(|v| v.to_str().ok())
2471 .unwrap_or("application/octet-stream");
2472 let content_type = super::ContentType::from(content_type);
2473
2474 if !status.is_client_error() && !status.is_server_error() {
2475 let content = resp.text().await?;
2476 match content_type {
2477 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2478 ContentType::Text => return Ok(models::GetEtf200ResponseEnum::Text(content)),
2479 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEtf200ResponseEnum`")))),
2480 }
2481 } else {
2482 let content = resp.text().await?;
2483 let entity: Option<GetEtfError> = serde_json::from_str(&content).ok();
2484 Err(Error::ResponseError(ResponseContent {
2485 status,
2486 content,
2487 entity,
2488 }))
2489 }
2490}
2491
2492pub async fn get_etfs_family(
2494 configuration: &configuration::Configuration,
2495 params: GetEtfsFamilyParams,
2496) -> Result<models::GetEtfsFamily200ResponseEnum, Error<GetEtfsFamilyError>> {
2497 let p_query_country = params.country;
2499 let p_query_fund_family = params.fund_family;
2500
2501 let uri_str = format!("{}/etfs/family", configuration.base_path);
2502 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2503
2504 if let Some(ref param_value) = p_query_country {
2505 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2506 }
2507 if let Some(ref param_value) = p_query_fund_family {
2508 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2509 }
2510 if let Some(ref user_agent) = configuration.user_agent {
2511 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2512 }
2513 if let Some(ref apikey) = configuration.api_key {
2514 let key = apikey.key.clone();
2515 let value = match apikey.prefix {
2516 Some(ref prefix) => format!("{} {}", prefix, key),
2517 None => key,
2518 };
2519 req_builder = req_builder.header("Authorization", value);
2520 };
2521
2522 let req = req_builder.build()?;
2523 let resp = configuration.client.execute(req).await?;
2524
2525 let status = resp.status();
2526 let content_type = resp
2527 .headers()
2528 .get("content-type")
2529 .and_then(|v| v.to_str().ok())
2530 .unwrap_or("application/octet-stream");
2531 let content_type = super::ContentType::from(content_type);
2532
2533 if !status.is_client_error() && !status.is_server_error() {
2534 let content = resp.text().await?;
2535 match content_type {
2536 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2537 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsFamily200ResponseEnum`"))),
2538 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::GetEtfsFamily200ResponseEnum`")))),
2539 }
2540 } else {
2541 let content = resp.text().await?;
2542 let entity: Option<GetEtfsFamilyError> = serde_json::from_str(&content).ok();
2543 Err(Error::ResponseError(ResponseContent {
2544 status,
2545 content,
2546 entity,
2547 }))
2548 }
2549}
2550
2551pub async fn get_etfs_list(
2553 configuration: &configuration::Configuration,
2554 params: GetEtfsListParams,
2555) -> Result<models::GetEtfsList200ResponseEnum, Error<GetEtfsListError>> {
2556 let p_query_symbol = params.symbol;
2558 let p_query_figi = params.figi;
2559 let p_query_isin = params.isin;
2560 let p_query_cusip = params.cusip;
2561 let p_query_cik = params.cik;
2562 let p_query_country = params.country;
2563 let p_query_fund_family = params.fund_family;
2564 let p_query_fund_type = params.fund_type;
2565 let p_query_page = params.page;
2566 let p_query_outputsize = params.outputsize;
2567
2568 let uri_str = format!("{}/etfs/list", configuration.base_path);
2569 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2570
2571 if let Some(ref param_value) = p_query_symbol {
2572 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2573 }
2574 if let Some(ref param_value) = p_query_figi {
2575 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2576 }
2577 if let Some(ref param_value) = p_query_isin {
2578 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2579 }
2580 if let Some(ref param_value) = p_query_cusip {
2581 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2582 }
2583 if let Some(ref param_value) = p_query_cik {
2584 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2585 }
2586 if let Some(ref param_value) = p_query_country {
2587 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2588 }
2589 if let Some(ref param_value) = p_query_fund_family {
2590 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
2591 }
2592 if let Some(ref param_value) = p_query_fund_type {
2593 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2594 }
2595 if let Some(ref param_value) = p_query_page {
2596 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2597 }
2598 if let Some(ref param_value) = p_query_outputsize {
2599 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2600 }
2601 if let Some(ref user_agent) = configuration.user_agent {
2602 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2603 }
2604 if let Some(ref apikey) = configuration.api_key {
2605 let key = apikey.key.clone();
2606 let value = match apikey.prefix {
2607 Some(ref prefix) => format!("{} {}", prefix, key),
2608 None => key,
2609 };
2610 req_builder = req_builder.header("Authorization", value);
2611 };
2612
2613 let req = req_builder.build()?;
2614 let resp = configuration.client.execute(req).await?;
2615
2616 let status = resp.status();
2617 let content_type = resp
2618 .headers()
2619 .get("content-type")
2620 .and_then(|v| v.to_str().ok())
2621 .unwrap_or("application/octet-stream");
2622 let content_type = super::ContentType::from(content_type);
2623
2624 if !status.is_client_error() && !status.is_server_error() {
2625 let content = resp.text().await?;
2626 match content_type {
2627 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2628 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsList200ResponseEnum`"))),
2629 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::GetEtfsList200ResponseEnum`")))),
2630 }
2631 } else {
2632 let content = resp.text().await?;
2633 let entity: Option<GetEtfsListError> = serde_json::from_str(&content).ok();
2634 Err(Error::ResponseError(ResponseContent {
2635 status,
2636 content,
2637 entity,
2638 }))
2639 }
2640}
2641
2642pub async fn get_etfs_type(
2644 configuration: &configuration::Configuration,
2645 params: GetEtfsTypeParams,
2646) -> Result<models::GetEtfsType200ResponseEnum, Error<GetEtfsTypeError>> {
2647 let p_query_country = params.country;
2649 let p_query_fund_type = params.fund_type;
2650
2651 let uri_str = format!("{}/etfs/type", configuration.base_path);
2652 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2653
2654 if let Some(ref param_value) = p_query_country {
2655 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2656 }
2657 if let Some(ref param_value) = p_query_fund_type {
2658 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
2659 }
2660 if let Some(ref user_agent) = configuration.user_agent {
2661 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2662 }
2663 if let Some(ref apikey) = configuration.api_key {
2664 let key = apikey.key.clone();
2665 let value = match apikey.prefix {
2666 Some(ref prefix) => format!("{} {}", prefix, key),
2667 None => key,
2668 };
2669 req_builder = req_builder.header("Authorization", value);
2670 };
2671
2672 let req = req_builder.build()?;
2673 let resp = configuration.client.execute(req).await?;
2674
2675 let status = resp.status();
2676 let content_type = resp
2677 .headers()
2678 .get("content-type")
2679 .and_then(|v| v.to_str().ok())
2680 .unwrap_or("application/octet-stream");
2681 let content_type = super::ContentType::from(content_type);
2682
2683 if !status.is_client_error() && !status.is_server_error() {
2684 let content = resp.text().await?;
2685 match content_type {
2686 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2687 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEtfsType200ResponseEnum`"))),
2688 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::GetEtfsType200ResponseEnum`")))),
2689 }
2690 } else {
2691 let content = resp.text().await?;
2692 let entity: Option<GetEtfsTypeError> = serde_json::from_str(&content).ok();
2693 Err(Error::ResponseError(ResponseContent {
2694 status,
2695 content,
2696 entity,
2697 }))
2698 }
2699}
2700
2701pub async fn get_exchange_schedule(
2703 configuration: &configuration::Configuration,
2704 params: GetExchangeScheduleParams,
2705) -> Result<models::GetExchangeSchedule200ResponseEnum, Error<GetExchangeScheduleError>> {
2706 let p_query_mic_name = params.mic_name;
2708 let p_query_mic_code = params.mic_code;
2709 let p_query_country = params.country;
2710 let p_query_date = params.date;
2711
2712 let uri_str = format!("{}/exchange_schedule", configuration.base_path);
2713 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2714
2715 if let Some(ref param_value) = p_query_mic_name {
2716 req_builder = req_builder.query(&[("mic_name", ¶m_value.to_string())]);
2717 }
2718 if let Some(ref param_value) = p_query_mic_code {
2719 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
2720 }
2721 if let Some(ref param_value) = p_query_country {
2722 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2723 }
2724 if let Some(ref param_value) = p_query_date {
2725 req_builder = req_builder.query(&[("date", ¶m_value.to_string())]);
2726 }
2727 if let Some(ref user_agent) = configuration.user_agent {
2728 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2729 }
2730 if let Some(ref apikey) = configuration.api_key {
2731 let key = apikey.key.clone();
2732 let value = match apikey.prefix {
2733 Some(ref prefix) => format!("{} {}", prefix, key),
2734 None => key,
2735 };
2736 req_builder = req_builder.header("Authorization", value);
2737 };
2738
2739 let req = req_builder.build()?;
2740 let resp = configuration.client.execute(req).await?;
2741
2742 let status = resp.status();
2743 let content_type = resp
2744 .headers()
2745 .get("content-type")
2746 .and_then(|v| v.to_str().ok())
2747 .unwrap_or("application/octet-stream");
2748 let content_type = super::ContentType::from(content_type);
2749
2750 if !status.is_client_error() && !status.is_server_error() {
2751 let content = resp.text().await?;
2752 match content_type {
2753 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2754 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetExchangeSchedule200ResponseEnum`"))),
2755 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::GetExchangeSchedule200ResponseEnum`")))),
2756 }
2757 } else {
2758 let content = resp.text().await?;
2759 let entity: Option<GetExchangeScheduleError> = serde_json::from_str(&content).ok();
2760 Err(Error::ResponseError(ResponseContent {
2761 status,
2762 content,
2763 entity,
2764 }))
2765 }
2766}
2767
2768pub async fn get_exchanges(
2770 configuration: &configuration::Configuration,
2771 params: GetExchangesParams,
2772) -> Result<models::GetExchanges200ResponseEnum, Error<GetExchangesError>> {
2773 let p_query_type = params.r#type;
2775 let p_query_name = params.name;
2776 let p_query_code = params.code;
2777 let p_query_country = params.country;
2778 let p_query_format = params.format;
2779 let p_query_delimiter = params.delimiter;
2780 let p_query_show_plan = params.show_plan;
2781
2782 let uri_str = format!("{}/exchanges", configuration.base_path);
2783 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2784
2785 if let Some(ref param_value) = p_query_type {
2786 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
2787 }
2788 if let Some(ref param_value) = p_query_name {
2789 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2790 }
2791 if let Some(ref param_value) = p_query_code {
2792 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
2793 }
2794 if let Some(ref param_value) = p_query_country {
2795 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2796 }
2797 if let Some(ref param_value) = p_query_format {
2798 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2799 }
2800 if let Some(ref param_value) = p_query_delimiter {
2801 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2802 }
2803 if let Some(ref param_value) = p_query_show_plan {
2804 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2805 }
2806 if let Some(ref user_agent) = configuration.user_agent {
2807 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2808 }
2809 if let Some(ref apikey) = configuration.api_key {
2810 let key = apikey.key.clone();
2811 let value = match apikey.prefix {
2812 Some(ref prefix) => format!("{} {}", prefix, key),
2813 None => key,
2814 };
2815 req_builder = req_builder.header("Authorization", value);
2816 };
2817
2818 let req = req_builder.build()?;
2819 let resp = configuration.client.execute(req).await?;
2820
2821 let status = resp.status();
2822 let content_type = resp
2823 .headers()
2824 .get("content-type")
2825 .and_then(|v| v.to_str().ok())
2826 .unwrap_or("application/octet-stream");
2827 let content_type = super::ContentType::from(content_type);
2828
2829 if !status.is_client_error() && !status.is_server_error() {
2830 let content = resp.text().await?;
2831 match content_type {
2832 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2833 ContentType::Text => return Ok(models::GetExchanges200ResponseEnum::Text(content)),
2834 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::GetExchanges200ResponseEnum`")))),
2835 }
2836 } else {
2837 let content = resp.text().await?;
2838 let entity: Option<GetExchangesError> = serde_json::from_str(&content).ok();
2839 Err(Error::ResponseError(ResponseContent {
2840 status,
2841 content,
2842 entity,
2843 }))
2844 }
2845}
2846
2847pub async fn get_forex_pairs(
2849 configuration: &configuration::Configuration,
2850 params: GetForexPairsParams,
2851) -> Result<models::GetForexPairs200ResponseEnum, Error<GetForexPairsError>> {
2852 let p_query_symbol = params.symbol;
2854 let p_query_currency_base = params.currency_base;
2855 let p_query_currency_quote = params.currency_quote;
2856 let p_query_format = params.format;
2857 let p_query_delimiter = params.delimiter;
2858
2859 let uri_str = format!("{}/forex_pairs", configuration.base_path);
2860 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2861
2862 if let Some(ref param_value) = p_query_symbol {
2863 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2864 }
2865 if let Some(ref param_value) = p_query_currency_base {
2866 req_builder = req_builder.query(&[("currency_base", ¶m_value.to_string())]);
2867 }
2868 if let Some(ref param_value) = p_query_currency_quote {
2869 req_builder = req_builder.query(&[("currency_quote", ¶m_value.to_string())]);
2870 }
2871 if let Some(ref param_value) = p_query_format {
2872 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2873 }
2874 if let Some(ref param_value) = p_query_delimiter {
2875 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2876 }
2877 if let Some(ref user_agent) = configuration.user_agent {
2878 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2879 }
2880 if let Some(ref apikey) = configuration.api_key {
2881 let key = apikey.key.clone();
2882 let value = match apikey.prefix {
2883 Some(ref prefix) => format!("{} {}", prefix, key),
2884 None => key,
2885 };
2886 req_builder = req_builder.header("Authorization", value);
2887 };
2888
2889 let req = req_builder.build()?;
2890 let resp = configuration.client.execute(req).await?;
2891
2892 let status = resp.status();
2893 let content_type = resp
2894 .headers()
2895 .get("content-type")
2896 .and_then(|v| v.to_str().ok())
2897 .unwrap_or("application/octet-stream");
2898 let content_type = super::ContentType::from(content_type);
2899
2900 if !status.is_client_error() && !status.is_server_error() {
2901 let content = resp.text().await?;
2902 match content_type {
2903 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2904 ContentType::Text => return Ok(models::GetForexPairs200ResponseEnum::Text(content)),
2905 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::GetForexPairs200ResponseEnum`")))),
2906 }
2907 } else {
2908 let content = resp.text().await?;
2909 let entity: Option<GetForexPairsError> = serde_json::from_str(&content).ok();
2910 Err(Error::ResponseError(ResponseContent {
2911 status,
2912 content,
2913 entity,
2914 }))
2915 }
2916}
2917
2918pub async fn get_funds(
2920 configuration: &configuration::Configuration,
2921 params: GetFundsParams,
2922) -> Result<models::GetFunds200ResponseEnum, Error<GetFundsError>> {
2923 let p_query_symbol = params.symbol;
2925 let p_query_figi = params.figi;
2926 let p_query_isin = params.isin;
2927 let p_query_cusip = params.cusip;
2928 let p_query_cik = params.cik;
2929 let p_query_exchange = params.exchange;
2930 let p_query_country = params.country;
2931 let p_query_format = params.format;
2932 let p_query_delimiter = params.delimiter;
2933 let p_query_show_plan = params.show_plan;
2934 let p_query_page = params.page;
2935 let p_query_outputsize = params.outputsize;
2936
2937 let uri_str = format!("{}/funds", configuration.base_path);
2938 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2939
2940 if let Some(ref param_value) = p_query_symbol {
2941 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
2942 }
2943 if let Some(ref param_value) = p_query_figi {
2944 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
2945 }
2946 if let Some(ref param_value) = p_query_isin {
2947 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
2948 }
2949 if let Some(ref param_value) = p_query_cusip {
2950 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
2951 }
2952 if let Some(ref param_value) = p_query_cik {
2953 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
2954 }
2955 if let Some(ref param_value) = p_query_exchange {
2956 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
2957 }
2958 if let Some(ref param_value) = p_query_country {
2959 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
2960 }
2961 if let Some(ref param_value) = p_query_format {
2962 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
2963 }
2964 if let Some(ref param_value) = p_query_delimiter {
2965 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
2966 }
2967 if let Some(ref param_value) = p_query_show_plan {
2968 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
2969 }
2970 if let Some(ref param_value) = p_query_page {
2971 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2972 }
2973 if let Some(ref param_value) = p_query_outputsize {
2974 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
2975 }
2976 if let Some(ref user_agent) = configuration.user_agent {
2977 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2978 }
2979 if let Some(ref apikey) = configuration.api_key {
2980 let key = apikey.key.clone();
2981 let value = match apikey.prefix {
2982 Some(ref prefix) => format!("{} {}", prefix, key),
2983 None => key,
2984 };
2985 req_builder = req_builder.header("Authorization", value);
2986 };
2987
2988 let req = req_builder.build()?;
2989 let resp = configuration.client.execute(req).await?;
2990
2991 let status = resp.status();
2992 let content_type = resp
2993 .headers()
2994 .get("content-type")
2995 .and_then(|v| v.to_str().ok())
2996 .unwrap_or("application/octet-stream");
2997 let content_type = super::ContentType::from(content_type);
2998
2999 if !status.is_client_error() && !status.is_server_error() {
3000 let content = resp.text().await?;
3001 match content_type {
3002 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3003 ContentType::Text => return Ok(models::GetFunds200ResponseEnum::Text(content)),
3004 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::GetFunds200ResponseEnum`")))),
3005 }
3006 } else {
3007 let content = resp.text().await?;
3008 let entity: Option<GetFundsError> = serde_json::from_str(&content).ok();
3009 Err(Error::ResponseError(ResponseContent {
3010 status,
3011 content,
3012 entity,
3013 }))
3014 }
3015}
3016
3017pub async fn get_instrument_type(
3019 configuration: &configuration::Configuration,
3020) -> Result<models::GetInstrumentType200ResponseEnum, Error<GetInstrumentTypeError>> {
3021 let uri_str = format!("{}/instrument_type", configuration.base_path);
3022 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3023
3024 if let Some(ref user_agent) = configuration.user_agent {
3025 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3026 }
3027 if let Some(ref apikey) = configuration.api_key {
3028 let key = apikey.key.clone();
3029 let value = match apikey.prefix {
3030 Some(ref prefix) => format!("{} {}", prefix, key),
3031 None => key,
3032 };
3033 req_builder = req_builder.header("Authorization", value);
3034 };
3035
3036 let req = req_builder.build()?;
3037 let resp = configuration.client.execute(req).await?;
3038
3039 let status = resp.status();
3040 let content_type = resp
3041 .headers()
3042 .get("content-type")
3043 .and_then(|v| v.to_str().ok())
3044 .unwrap_or("application/octet-stream");
3045 let content_type = super::ContentType::from(content_type);
3046
3047 if !status.is_client_error() && !status.is_server_error() {
3048 let content = resp.text().await?;
3049 match content_type {
3050 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3051 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetInstrumentType200ResponseEnum`"))),
3052 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::GetInstrumentType200ResponseEnum`")))),
3053 }
3054 } else {
3055 let content = resp.text().await?;
3056 let entity: Option<GetInstrumentTypeError> = serde_json::from_str(&content).ok();
3057 Err(Error::ResponseError(ResponseContent {
3058 status,
3059 content,
3060 entity,
3061 }))
3062 }
3063}
3064
3065pub async fn get_intervals(
3067 configuration: &configuration::Configuration,
3068) -> Result<models::GetIntervals200ResponseEnum, Error<GetIntervalsError>> {
3069 let uri_str = format!("{}/intervals", configuration.base_path);
3070 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3071
3072 if let Some(ref user_agent) = configuration.user_agent {
3073 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3074 }
3075 if let Some(ref apikey) = configuration.api_key {
3076 let key = apikey.key.clone();
3077 let value = match apikey.prefix {
3078 Some(ref prefix) => format!("{} {}", prefix, key),
3079 None => key,
3080 };
3081 req_builder = req_builder.header("Authorization", value);
3082 };
3083
3084 let req = req_builder.build()?;
3085 let resp = configuration.client.execute(req).await?;
3086
3087 let status = resp.status();
3088 let content_type = resp
3089 .headers()
3090 .get("content-type")
3091 .and_then(|v| v.to_str().ok())
3092 .unwrap_or("application/octet-stream");
3093 let content_type = super::ContentType::from(content_type);
3094
3095 if !status.is_client_error() && !status.is_server_error() {
3096 let content = resp.text().await?;
3097 match content_type {
3098 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3099 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetIntervals200ResponseEnum`"))),
3100 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::GetIntervals200ResponseEnum`")))),
3101 }
3102 } else {
3103 let content = resp.text().await?;
3104 let entity: Option<GetIntervalsError> = serde_json::from_str(&content).ok();
3105 Err(Error::ResponseError(ResponseContent {
3106 status,
3107 content,
3108 entity,
3109 }))
3110 }
3111}
3112
3113pub async fn get_market_state(
3115 configuration: &configuration::Configuration,
3116 params: GetMarketStateParams,
3117) -> Result<models::GetMarketState200ResponseEnum, Error<GetMarketStateError>> {
3118 let p_query_exchange = params.exchange;
3120 let p_query_code = params.code;
3121 let p_query_country = params.country;
3122
3123 let uri_str = format!("{}/market_state", configuration.base_path);
3124 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3125
3126 if let Some(ref param_value) = p_query_exchange {
3127 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3128 }
3129 if let Some(ref param_value) = p_query_code {
3130 req_builder = req_builder.query(&[("code", ¶m_value.to_string())]);
3131 }
3132 if let Some(ref param_value) = p_query_country {
3133 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3134 }
3135 if let Some(ref user_agent) = configuration.user_agent {
3136 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3137 }
3138 if let Some(ref apikey) = configuration.api_key {
3139 let key = apikey.key.clone();
3140 let value = match apikey.prefix {
3141 Some(ref prefix) => format!("{} {}", prefix, key),
3142 None => key,
3143 };
3144 req_builder = req_builder.header("Authorization", value);
3145 };
3146
3147 let req = req_builder.build()?;
3148 let resp = configuration.client.execute(req).await?;
3149
3150 let status = resp.status();
3151 let content_type = resp
3152 .headers()
3153 .get("content-type")
3154 .and_then(|v| v.to_str().ok())
3155 .unwrap_or("application/octet-stream");
3156 let content_type = super::ContentType::from(content_type);
3157
3158 if !status.is_client_error() && !status.is_server_error() {
3159 let content = resp.text().await?;
3160 match content_type {
3161 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3162 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMarketState200ResponseEnum`"))),
3163 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::GetMarketState200ResponseEnum`")))),
3164 }
3165 } else {
3166 let content = resp.text().await?;
3167 let entity: Option<GetMarketStateError> = serde_json::from_str(&content).ok();
3168 Err(Error::ResponseError(ResponseContent {
3169 status,
3170 content,
3171 entity,
3172 }))
3173 }
3174}
3175
3176pub async fn get_mutual_funds_family(
3178 configuration: &configuration::Configuration,
3179 params: GetMutualFundsFamilyParams,
3180) -> Result<models::GetMutualFundsFamily200ResponseEnum, Error<GetMutualFundsFamilyError>> {
3181 let p_query_fund_family = params.fund_family;
3183 let p_query_country = params.country;
3184
3185 let uri_str = format!("{}/mutual_funds/family", configuration.base_path);
3186 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3187
3188 if let Some(ref param_value) = p_query_fund_family {
3189 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3190 }
3191 if let Some(ref param_value) = p_query_country {
3192 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3193 }
3194 if let Some(ref user_agent) = configuration.user_agent {
3195 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3196 }
3197 if let Some(ref apikey) = configuration.api_key {
3198 let key = apikey.key.clone();
3199 let value = match apikey.prefix {
3200 Some(ref prefix) => format!("{} {}", prefix, key),
3201 None => key,
3202 };
3203 req_builder = req_builder.header("Authorization", value);
3204 };
3205
3206 let req = req_builder.build()?;
3207 let resp = configuration.client.execute(req).await?;
3208
3209 let status = resp.status();
3210 let content_type = resp
3211 .headers()
3212 .get("content-type")
3213 .and_then(|v| v.to_str().ok())
3214 .unwrap_or("application/octet-stream");
3215 let content_type = super::ContentType::from(content_type);
3216
3217 if !status.is_client_error() && !status.is_server_error() {
3218 let content = resp.text().await?;
3219 match content_type {
3220 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3221 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsFamily200ResponseEnum`"))),
3222 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::GetMutualFundsFamily200ResponseEnum`")))),
3223 }
3224 } else {
3225 let content = resp.text().await?;
3226 let entity: Option<GetMutualFundsFamilyError> = serde_json::from_str(&content).ok();
3227 Err(Error::ResponseError(ResponseContent {
3228 status,
3229 content,
3230 entity,
3231 }))
3232 }
3233}
3234
3235pub async fn get_mutual_funds_list(
3237 configuration: &configuration::Configuration,
3238 params: GetMutualFundsListParams,
3239) -> Result<models::GetMutualFundsList200ResponseEnum, Error<GetMutualFundsListError>> {
3240 let p_query_symbol = params.symbol;
3242 let p_query_figi = params.figi;
3243 let p_query_isin = params.isin;
3244 let p_query_cusip = params.cusip;
3245 let p_query_cik = params.cik;
3246 let p_query_country = params.country;
3247 let p_query_fund_family = params.fund_family;
3248 let p_query_fund_type = params.fund_type;
3249 let p_query_performance_rating = params.performance_rating;
3250 let p_query_risk_rating = params.risk_rating;
3251 let p_query_page = params.page;
3252 let p_query_outputsize = params.outputsize;
3253
3254 let uri_str = format!("{}/mutual_funds/list", configuration.base_path);
3255 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3256
3257 if let Some(ref param_value) = p_query_symbol {
3258 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3259 }
3260 if let Some(ref param_value) = p_query_figi {
3261 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3262 }
3263 if let Some(ref param_value) = p_query_isin {
3264 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3265 }
3266 if let Some(ref param_value) = p_query_cusip {
3267 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3268 }
3269 if let Some(ref param_value) = p_query_cik {
3270 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3271 }
3272 if let Some(ref param_value) = p_query_country {
3273 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3274 }
3275 if let Some(ref param_value) = p_query_fund_family {
3276 req_builder = req_builder.query(&[("fund_family", ¶m_value.to_string())]);
3277 }
3278 if let Some(ref param_value) = p_query_fund_type {
3279 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3280 }
3281 if let Some(ref param_value) = p_query_performance_rating {
3282 req_builder = req_builder.query(&[("performance_rating", ¶m_value.to_string())]);
3283 }
3284 if let Some(ref param_value) = p_query_risk_rating {
3285 req_builder = req_builder.query(&[("risk_rating", ¶m_value.to_string())]);
3286 }
3287 if let Some(ref param_value) = p_query_page {
3288 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3289 }
3290 if let Some(ref param_value) = p_query_outputsize {
3291 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3292 }
3293 if let Some(ref user_agent) = configuration.user_agent {
3294 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3295 }
3296 if let Some(ref apikey) = configuration.api_key {
3297 let key = apikey.key.clone();
3298 let value = match apikey.prefix {
3299 Some(ref prefix) => format!("{} {}", prefix, key),
3300 None => key,
3301 };
3302 req_builder = req_builder.header("Authorization", value);
3303 };
3304
3305 let req = req_builder.build()?;
3306 let resp = configuration.client.execute(req).await?;
3307
3308 let status = resp.status();
3309 let content_type = resp
3310 .headers()
3311 .get("content-type")
3312 .and_then(|v| v.to_str().ok())
3313 .unwrap_or("application/octet-stream");
3314 let content_type = super::ContentType::from(content_type);
3315
3316 if !status.is_client_error() && !status.is_server_error() {
3317 let content = resp.text().await?;
3318 match content_type {
3319 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3320 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsList200ResponseEnum`"))),
3321 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::GetMutualFundsList200ResponseEnum`")))),
3322 }
3323 } else {
3324 let content = resp.text().await?;
3325 let entity: Option<GetMutualFundsListError> = serde_json::from_str(&content).ok();
3326 Err(Error::ResponseError(ResponseContent {
3327 status,
3328 content,
3329 entity,
3330 }))
3331 }
3332}
3333
3334pub async fn get_mutual_funds_type(
3336 configuration: &configuration::Configuration,
3337 params: GetMutualFundsTypeParams,
3338) -> Result<models::GetMutualFundsType200ResponseEnum, Error<GetMutualFundsTypeError>> {
3339 let p_query_fund_type = params.fund_type;
3341 let p_query_country = params.country;
3342
3343 let uri_str = format!("{}/mutual_funds/type", configuration.base_path);
3344 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3345
3346 if let Some(ref param_value) = p_query_fund_type {
3347 req_builder = req_builder.query(&[("fund_type", ¶m_value.to_string())]);
3348 }
3349 if let Some(ref param_value) = p_query_country {
3350 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3351 }
3352 if let Some(ref user_agent) = configuration.user_agent {
3353 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3354 }
3355 if let Some(ref apikey) = configuration.api_key {
3356 let key = apikey.key.clone();
3357 let value = match apikey.prefix {
3358 Some(ref prefix) => format!("{} {}", prefix, key),
3359 None => key,
3360 };
3361 req_builder = req_builder.header("Authorization", value);
3362 };
3363
3364 let req = req_builder.build()?;
3365 let resp = configuration.client.execute(req).await?;
3366
3367 let status = resp.status();
3368 let content_type = resp
3369 .headers()
3370 .get("content-type")
3371 .and_then(|v| v.to_str().ok())
3372 .unwrap_or("application/octet-stream");
3373 let content_type = super::ContentType::from(content_type);
3374
3375 if !status.is_client_error() && !status.is_server_error() {
3376 let content = resp.text().await?;
3377 match content_type {
3378 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3379 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetMutualFundsType200ResponseEnum`"))),
3380 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::GetMutualFundsType200ResponseEnum`")))),
3381 }
3382 } else {
3383 let content = resp.text().await?;
3384 let entity: Option<GetMutualFundsTypeError> = serde_json::from_str(&content).ok();
3385 Err(Error::ResponseError(ResponseContent {
3386 status,
3387 content,
3388 entity,
3389 }))
3390 }
3391}
3392
3393pub async fn get_stocks(
3395 configuration: &configuration::Configuration,
3396 params: GetStocksParams,
3397) -> Result<models::GetStocks200ResponseEnum, Error<GetStocksError>> {
3398 let p_query_symbol = params.symbol;
3400 let p_query_figi = params.figi;
3401 let p_query_isin = params.isin;
3402 let p_query_cusip = params.cusip;
3403 let p_query_cik = params.cik;
3404 let p_query_exchange = params.exchange;
3405 let p_query_mic_code = params.mic_code;
3406 let p_query_country = params.country;
3407 let p_query_type = params.r#type;
3408 let p_query_format = params.format;
3409 let p_query_delimiter = params.delimiter;
3410 let p_query_show_plan = params.show_plan;
3411 let p_query_include_delisted = params.include_delisted;
3412
3413 let uri_str = format!("{}/stocks", configuration.base_path);
3414 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3415
3416 if let Some(ref param_value) = p_query_symbol {
3417 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
3418 }
3419 if let Some(ref param_value) = p_query_figi {
3420 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
3421 }
3422 if let Some(ref param_value) = p_query_isin {
3423 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
3424 }
3425 if let Some(ref param_value) = p_query_cusip {
3426 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
3427 }
3428 if let Some(ref param_value) = p_query_cik {
3429 req_builder = req_builder.query(&[("cik", ¶m_value.to_string())]);
3430 }
3431 if let Some(ref param_value) = p_query_exchange {
3432 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
3433 }
3434 if let Some(ref param_value) = p_query_mic_code {
3435 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
3436 }
3437 if let Some(ref param_value) = p_query_country {
3438 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
3439 }
3440 if let Some(ref param_value) = p_query_type {
3441 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
3442 }
3443 if let Some(ref param_value) = p_query_format {
3444 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
3445 }
3446 if let Some(ref param_value) = p_query_delimiter {
3447 req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]);
3448 }
3449 if let Some(ref param_value) = p_query_show_plan {
3450 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3451 }
3452 if let Some(ref param_value) = p_query_include_delisted {
3453 req_builder = req_builder.query(&[("include_delisted", ¶m_value.to_string())]);
3454 }
3455 if let Some(ref user_agent) = configuration.user_agent {
3456 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3457 }
3458 if let Some(ref apikey) = configuration.api_key {
3459 let key = apikey.key.clone();
3460 let value = match apikey.prefix {
3461 Some(ref prefix) => format!("{} {}", prefix, key),
3462 None => key,
3463 };
3464 req_builder = req_builder.header("Authorization", value);
3465 };
3466
3467 let req = req_builder.build()?;
3468 let resp = configuration.client.execute(req).await?;
3469
3470 let status = resp.status();
3471 let content_type = resp
3472 .headers()
3473 .get("content-type")
3474 .and_then(|v| v.to_str().ok())
3475 .unwrap_or("application/octet-stream");
3476 let content_type = super::ContentType::from(content_type);
3477
3478 if !status.is_client_error() && !status.is_server_error() {
3479 let content = resp.text().await?;
3480 match content_type {
3481 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3482 ContentType::Text => return Ok(models::GetStocks200ResponseEnum::Text(content)),
3483 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::GetStocks200ResponseEnum`")))),
3484 }
3485 } else {
3486 let content = resp.text().await?;
3487 let entity: Option<GetStocksError> = serde_json::from_str(&content).ok();
3488 Err(Error::ResponseError(ResponseContent {
3489 status,
3490 content,
3491 entity,
3492 }))
3493 }
3494}
3495
3496pub async fn get_symbol_search(
3498 configuration: &configuration::Configuration,
3499 params: GetSymbolSearchParams,
3500) -> Result<models::GetSymbolSearch200ResponseEnum, Error<GetSymbolSearchError>> {
3501 let p_query_symbol = params.symbol;
3503 let p_query_outputsize = params.outputsize;
3504 let p_query_show_plan = params.show_plan;
3505
3506 let uri_str = format!("{}/symbol_search", configuration.base_path);
3507 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3508
3509 req_builder = req_builder.query(&[("symbol", &p_query_symbol.to_string())]);
3510 if let Some(ref param_value) = p_query_outputsize {
3511 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
3512 }
3513 if let Some(ref param_value) = p_query_show_plan {
3514 req_builder = req_builder.query(&[("show_plan", ¶m_value.to_string())]);
3515 }
3516 if let Some(ref user_agent) = configuration.user_agent {
3517 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3518 }
3519 if let Some(ref apikey) = configuration.api_key {
3520 let key = apikey.key.clone();
3521 let value = match apikey.prefix {
3522 Some(ref prefix) => format!("{} {}", prefix, key),
3523 None => key,
3524 };
3525 req_builder = req_builder.header("Authorization", value);
3526 };
3527
3528 let req = req_builder.build()?;
3529 let resp = configuration.client.execute(req).await?;
3530
3531 let status = resp.status();
3532 let content_type = resp
3533 .headers()
3534 .get("content-type")
3535 .and_then(|v| v.to_str().ok())
3536 .unwrap_or("application/octet-stream");
3537 let content_type = super::ContentType::from(content_type);
3538
3539 if !status.is_client_error() && !status.is_server_error() {
3540 let content = resp.text().await?;
3541 match content_type {
3542 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3543 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetSymbolSearch200ResponseEnum`"))),
3544 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::GetSymbolSearch200ResponseEnum`")))),
3545 }
3546 } else {
3547 let content = resp.text().await?;
3548 let entity: Option<GetSymbolSearchError> = serde_json::from_str(&content).ok();
3549 Err(Error::ResponseError(ResponseContent {
3550 status,
3551 content,
3552 entity,
3553 }))
3554 }
3555}
3556
3557pub async fn get_technical_indicators(
3559 configuration: &configuration::Configuration,
3560) -> Result<models::GetTechnicalIndicators200ResponseEnum, Error<GetTechnicalIndicatorsError>> {
3561 let uri_str = format!("{}/technical_indicators", configuration.base_path);
3562 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3563
3564 if let Some(ref user_agent) = configuration.user_agent {
3565 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3566 }
3567 if let Some(ref apikey) = configuration.api_key {
3568 let key = apikey.key.clone();
3569 let value = match apikey.prefix {
3570 Some(ref prefix) => format!("{} {}", prefix, key),
3571 None => key,
3572 };
3573 req_builder = req_builder.header("Authorization", value);
3574 };
3575
3576 let req = req_builder.build()?;
3577 let resp = configuration.client.execute(req).await?;
3578
3579 let status = resp.status();
3580 let content_type = resp
3581 .headers()
3582 .get("content-type")
3583 .and_then(|v| v.to_str().ok())
3584 .unwrap_or("application/octet-stream");
3585 let content_type = super::ContentType::from(content_type);
3586
3587 if !status.is_client_error() && !status.is_server_error() {
3588 let content = resp.text().await?;
3589 match content_type {
3590 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3591 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetTechnicalIndicators200ResponseEnum`"))),
3592 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::GetTechnicalIndicators200ResponseEnum`")))),
3593 }
3594 } else {
3595 let content = resp.text().await?;
3596 let entity: Option<GetTechnicalIndicatorsError> = serde_json::from_str(&content).ok();
3597 Err(Error::ResponseError(ResponseContent {
3598 status,
3599 content,
3600 entity,
3601 }))
3602 }
3603}