1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17#[derive(Clone, Debug, Default)]
19pub struct GetAnalystRatingsLightParams {
20 pub symbol: Option<String>,
22 pub figi: Option<String>,
24 pub isin: Option<String>,
26 pub cusip: Option<String>,
28 pub exchange: Option<String>,
30 pub rating_change: Option<String>,
32 pub outputsize: Option<i64>,
34 pub country: Option<String>
36}
37
38impl GetAnalystRatingsLightParams {
39 pub fn builder() -> GetAnalystRatingsLightParamsBuilder {
41 GetAnalystRatingsLightParamsBuilder::default()
42 }
43}
44
45#[derive(Clone, Debug, Default)]
47pub struct GetAnalystRatingsLightParamsBuilder {
48 symbol: Option<String>,
50 figi: Option<String>,
52 isin: Option<String>,
54 cusip: Option<String>,
56 exchange: Option<String>,
58 rating_change: Option<String>,
60 outputsize: Option<i64>,
62 country: Option<String>
64}
65
66impl GetAnalystRatingsLightParamsBuilder {
67 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
69 self.symbol = Some(symbol.into());
70
71 self
72 }
73 pub fn figi(mut self, figi: impl Into<String>) -> Self {
75 self.figi = Some(figi.into());
76
77 self
78 }
79 pub fn isin(mut self, isin: impl Into<String>) -> Self {
81 self.isin = Some(isin.into());
82
83 self
84 }
85 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
87 self.cusip = Some(cusip.into());
88
89 self
90 }
91 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
93 self.exchange = Some(exchange.into());
94
95 self
96 }
97 pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
99 self.rating_change = Some(rating_change.into());
100
101 self
102 }
103 pub fn outputsize(mut self, outputsize: i64) -> Self {
105
106 self.outputsize = Some(outputsize);
107
108 self
109 }
110 pub fn country(mut self, country: impl Into<String>) -> Self {
112 self.country = Some(country.into());
113
114 self
115 }
116
117 pub fn build(self) -> GetAnalystRatingsLightParams {
119 GetAnalystRatingsLightParams {
120 symbol: self.symbol,
121 figi: self.figi,
122 isin: self.isin,
123 cusip: self.cusip,
124 exchange: self.exchange,
125 rating_change: self.rating_change,
126 outputsize: self.outputsize,
127 country: self.country
128 }
129 }
130}
131
132#[derive(Clone, Debug, Default)]
134pub struct GetAnalystRatingsUsEquitiesParams {
135 pub symbol: Option<String>,
137 pub figi: Option<String>,
139 pub isin: Option<String>,
141 pub cusip: Option<String>,
143 pub exchange: Option<String>,
145 pub rating_change: Option<String>,
147 pub outputsize: Option<i64>
149}
150
151impl GetAnalystRatingsUsEquitiesParams {
152 pub fn builder() -> GetAnalystRatingsUsEquitiesParamsBuilder {
154 GetAnalystRatingsUsEquitiesParamsBuilder::default()
155 }
156}
157
158#[derive(Clone, Debug, Default)]
160pub struct GetAnalystRatingsUsEquitiesParamsBuilder {
161 symbol: Option<String>,
163 figi: Option<String>,
165 isin: Option<String>,
167 cusip: Option<String>,
169 exchange: Option<String>,
171 rating_change: Option<String>,
173 outputsize: Option<i64>
175}
176
177impl GetAnalystRatingsUsEquitiesParamsBuilder {
178 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
180 self.symbol = Some(symbol.into());
181
182 self
183 }
184 pub fn figi(mut self, figi: impl Into<String>) -> Self {
186 self.figi = Some(figi.into());
187
188 self
189 }
190 pub fn isin(mut self, isin: impl Into<String>) -> Self {
192 self.isin = Some(isin.into());
193
194 self
195 }
196 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
198 self.cusip = Some(cusip.into());
199
200 self
201 }
202 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
204 self.exchange = Some(exchange.into());
205
206 self
207 }
208 pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
210 self.rating_change = Some(rating_change.into());
211
212 self
213 }
214 pub fn outputsize(mut self, outputsize: i64) -> Self {
216
217 self.outputsize = Some(outputsize);
218
219 self
220 }
221
222 pub fn build(self) -> GetAnalystRatingsUsEquitiesParams {
224 GetAnalystRatingsUsEquitiesParams {
225 symbol: self.symbol,
226 figi: self.figi,
227 isin: self.isin,
228 cusip: self.cusip,
229 exchange: self.exchange,
230 rating_change: self.rating_change,
231 outputsize: self.outputsize
232 }
233 }
234}
235
236#[derive(Clone, Debug, Default)]
238pub struct GetEarningsEstimateParams {
239 pub symbol: Option<String>,
241 pub figi: Option<String>,
243 pub isin: Option<String>,
245 pub cusip: Option<String>,
247 pub country: Option<String>,
249 pub exchange: Option<String>
251}
252
253impl GetEarningsEstimateParams {
254 pub fn builder() -> GetEarningsEstimateParamsBuilder {
256 GetEarningsEstimateParamsBuilder::default()
257 }
258}
259
260#[derive(Clone, Debug, Default)]
262pub struct GetEarningsEstimateParamsBuilder {
263 symbol: Option<String>,
265 figi: Option<String>,
267 isin: Option<String>,
269 cusip: Option<String>,
271 country: Option<String>,
273 exchange: Option<String>
275}
276
277impl GetEarningsEstimateParamsBuilder {
278 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
280 self.symbol = Some(symbol.into());
281
282 self
283 }
284 pub fn figi(mut self, figi: impl Into<String>) -> Self {
286 self.figi = Some(figi.into());
287
288 self
289 }
290 pub fn isin(mut self, isin: impl Into<String>) -> Self {
292 self.isin = Some(isin.into());
293
294 self
295 }
296 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
298 self.cusip = Some(cusip.into());
299
300 self
301 }
302 pub fn country(mut self, country: impl Into<String>) -> Self {
304 self.country = Some(country.into());
305
306 self
307 }
308 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
310 self.exchange = Some(exchange.into());
311
312 self
313 }
314
315 pub fn build(self) -> GetEarningsEstimateParams {
317 GetEarningsEstimateParams {
318 symbol: self.symbol,
319 figi: self.figi,
320 isin: self.isin,
321 cusip: self.cusip,
322 country: self.country,
323 exchange: self.exchange
324 }
325 }
326}
327
328#[derive(Clone, Debug, Default)]
330pub struct GetEdgarFilingsArchiveParams {
331 pub symbol: Option<String>,
333 pub figi: Option<String>,
335 pub isin: Option<String>,
337 pub cusip: Option<String>,
339 pub exchange: Option<String>,
341 pub mic_code: Option<String>,
343 pub country: Option<String>,
345 pub form_type: Option<String>,
347 pub filled_from: Option<String>,
349 pub filled_to: Option<String>,
351 pub page: Option<i64>,
353 pub page_size: Option<i64>
355}
356
357impl GetEdgarFilingsArchiveParams {
358 pub fn builder() -> GetEdgarFilingsArchiveParamsBuilder {
360 GetEdgarFilingsArchiveParamsBuilder::default()
361 }
362}
363
364#[derive(Clone, Debug, Default)]
366pub struct GetEdgarFilingsArchiveParamsBuilder {
367 symbol: Option<String>,
369 figi: Option<String>,
371 isin: Option<String>,
373 cusip: Option<String>,
375 exchange: Option<String>,
377 mic_code: Option<String>,
379 country: Option<String>,
381 form_type: Option<String>,
383 filled_from: Option<String>,
385 filled_to: Option<String>,
387 page: Option<i64>,
389 page_size: Option<i64>
391}
392
393impl GetEdgarFilingsArchiveParamsBuilder {
394 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
396 self.symbol = Some(symbol.into());
397
398 self
399 }
400 pub fn figi(mut self, figi: impl Into<String>) -> Self {
402 self.figi = Some(figi.into());
403
404 self
405 }
406 pub fn isin(mut self, isin: impl Into<String>) -> Self {
408 self.isin = Some(isin.into());
409
410 self
411 }
412 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
414 self.cusip = Some(cusip.into());
415
416 self
417 }
418 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
420 self.exchange = Some(exchange.into());
421
422 self
423 }
424 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
426 self.mic_code = Some(mic_code.into());
427
428 self
429 }
430 pub fn country(mut self, country: impl Into<String>) -> Self {
432 self.country = Some(country.into());
433
434 self
435 }
436 pub fn form_type(mut self, form_type: impl Into<String>) -> Self {
438 self.form_type = Some(form_type.into());
439
440 self
441 }
442 pub fn filled_from(mut self, filled_from: impl Into<String>) -> Self {
444 self.filled_from = Some(filled_from.into());
445
446 self
447 }
448 pub fn filled_to(mut self, filled_to: impl Into<String>) -> Self {
450 self.filled_to = Some(filled_to.into());
451
452 self
453 }
454 pub fn page(mut self, page: i64) -> Self {
456
457 self.page = Some(page);
458
459 self
460 }
461 pub fn page_size(mut self, page_size: i64) -> Self {
463
464 self.page_size = Some(page_size);
465
466 self
467 }
468
469 pub fn build(self) -> GetEdgarFilingsArchiveParams {
471 GetEdgarFilingsArchiveParams {
472 symbol: self.symbol,
473 figi: self.figi,
474 isin: self.isin,
475 cusip: self.cusip,
476 exchange: self.exchange,
477 mic_code: self.mic_code,
478 country: self.country,
479 form_type: self.form_type,
480 filled_from: self.filled_from,
481 filled_to: self.filled_to,
482 page: self.page,
483 page_size: self.page_size
484 }
485 }
486}
487
488#[derive(Clone, Debug, Default)]
490pub struct GetEpsRevisionsParams {
491 pub symbol: Option<String>,
493 pub figi: Option<String>,
495 pub isin: Option<String>,
497 pub cusip: Option<String>,
499 pub country: Option<String>,
501 pub exchange: Option<String>
503}
504
505impl GetEpsRevisionsParams {
506 pub fn builder() -> GetEpsRevisionsParamsBuilder {
508 GetEpsRevisionsParamsBuilder::default()
509 }
510}
511
512#[derive(Clone, Debug, Default)]
514pub struct GetEpsRevisionsParamsBuilder {
515 symbol: Option<String>,
517 figi: Option<String>,
519 isin: Option<String>,
521 cusip: Option<String>,
523 country: Option<String>,
525 exchange: Option<String>
527}
528
529impl GetEpsRevisionsParamsBuilder {
530 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
532 self.symbol = Some(symbol.into());
533
534 self
535 }
536 pub fn figi(mut self, figi: impl Into<String>) -> Self {
538 self.figi = Some(figi.into());
539
540 self
541 }
542 pub fn isin(mut self, isin: impl Into<String>) -> Self {
544 self.isin = Some(isin.into());
545
546 self
547 }
548 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
550 self.cusip = Some(cusip.into());
551
552 self
553 }
554 pub fn country(mut self, country: impl Into<String>) -> Self {
556 self.country = Some(country.into());
557
558 self
559 }
560 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
562 self.exchange = Some(exchange.into());
563
564 self
565 }
566
567 pub fn build(self) -> GetEpsRevisionsParams {
569 GetEpsRevisionsParams {
570 symbol: self.symbol,
571 figi: self.figi,
572 isin: self.isin,
573 cusip: self.cusip,
574 country: self.country,
575 exchange: self.exchange
576 }
577 }
578}
579
580#[derive(Clone, Debug, Default)]
582pub struct GetEpsTrendParams {
583 pub symbol: Option<String>,
585 pub figi: Option<String>,
587 pub isin: Option<String>,
589 pub cusip: Option<String>,
591 pub country: Option<String>,
593 pub exchange: Option<String>
595}
596
597impl GetEpsTrendParams {
598 pub fn builder() -> GetEpsTrendParamsBuilder {
600 GetEpsTrendParamsBuilder::default()
601 }
602}
603
604#[derive(Clone, Debug, Default)]
606pub struct GetEpsTrendParamsBuilder {
607 symbol: Option<String>,
609 figi: Option<String>,
611 isin: Option<String>,
613 cusip: Option<String>,
615 country: Option<String>,
617 exchange: Option<String>
619}
620
621impl GetEpsTrendParamsBuilder {
622 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
624 self.symbol = Some(symbol.into());
625
626 self
627 }
628 pub fn figi(mut self, figi: impl Into<String>) -> Self {
630 self.figi = Some(figi.into());
631
632 self
633 }
634 pub fn isin(mut self, isin: impl Into<String>) -> Self {
636 self.isin = Some(isin.into());
637
638 self
639 }
640 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
642 self.cusip = Some(cusip.into());
643
644 self
645 }
646 pub fn country(mut self, country: impl Into<String>) -> Self {
648 self.country = Some(country.into());
649
650 self
651 }
652 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
654 self.exchange = Some(exchange.into());
655
656 self
657 }
658
659 pub fn build(self) -> GetEpsTrendParams {
661 GetEpsTrendParams {
662 symbol: self.symbol,
663 figi: self.figi,
664 isin: self.isin,
665 cusip: self.cusip,
666 country: self.country,
667 exchange: self.exchange
668 }
669 }
670}
671
672#[derive(Clone, Debug, Default)]
674pub struct GetGrowthEstimatesParams {
675 pub symbol: Option<String>,
677 pub figi: Option<String>,
679 pub isin: Option<String>,
681 pub cusip: Option<String>,
683 pub country: Option<String>,
685 pub exchange: Option<String>
687}
688
689impl GetGrowthEstimatesParams {
690 pub fn builder() -> GetGrowthEstimatesParamsBuilder {
692 GetGrowthEstimatesParamsBuilder::default()
693 }
694}
695
696#[derive(Clone, Debug, Default)]
698pub struct GetGrowthEstimatesParamsBuilder {
699 symbol: Option<String>,
701 figi: Option<String>,
703 isin: Option<String>,
705 cusip: Option<String>,
707 country: Option<String>,
709 exchange: Option<String>
711}
712
713impl GetGrowthEstimatesParamsBuilder {
714 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
716 self.symbol = Some(symbol.into());
717
718 self
719 }
720 pub fn figi(mut self, figi: impl Into<String>) -> Self {
722 self.figi = Some(figi.into());
723
724 self
725 }
726 pub fn isin(mut self, isin: impl Into<String>) -> Self {
728 self.isin = Some(isin.into());
729
730 self
731 }
732 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
734 self.cusip = Some(cusip.into());
735
736 self
737 }
738 pub fn country(mut self, country: impl Into<String>) -> Self {
740 self.country = Some(country.into());
741
742 self
743 }
744 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
746 self.exchange = Some(exchange.into());
747
748 self
749 }
750
751 pub fn build(self) -> GetGrowthEstimatesParams {
753 GetGrowthEstimatesParams {
754 symbol: self.symbol,
755 figi: self.figi,
756 isin: self.isin,
757 cusip: self.cusip,
758 country: self.country,
759 exchange: self.exchange
760 }
761 }
762}
763
764#[derive(Clone, Debug, Default)]
766pub struct GetPriceTargetParams {
767 pub symbol: Option<String>,
769 pub figi: Option<String>,
771 pub isin: Option<String>,
773 pub cusip: Option<String>,
775 pub country: Option<String>,
777 pub exchange: Option<String>
779}
780
781impl GetPriceTargetParams {
782 pub fn builder() -> GetPriceTargetParamsBuilder {
784 GetPriceTargetParamsBuilder::default()
785 }
786}
787
788#[derive(Clone, Debug, Default)]
790pub struct GetPriceTargetParamsBuilder {
791 symbol: Option<String>,
793 figi: Option<String>,
795 isin: Option<String>,
797 cusip: Option<String>,
799 country: Option<String>,
801 exchange: Option<String>
803}
804
805impl GetPriceTargetParamsBuilder {
806 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
808 self.symbol = Some(symbol.into());
809
810 self
811 }
812 pub fn figi(mut self, figi: impl Into<String>) -> Self {
814 self.figi = Some(figi.into());
815
816 self
817 }
818 pub fn isin(mut self, isin: impl Into<String>) -> Self {
820 self.isin = Some(isin.into());
821
822 self
823 }
824 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
826 self.cusip = Some(cusip.into());
827
828 self
829 }
830 pub fn country(mut self, country: impl Into<String>) -> Self {
832 self.country = Some(country.into());
833
834 self
835 }
836 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
838 self.exchange = Some(exchange.into());
839
840 self
841 }
842
843 pub fn build(self) -> GetPriceTargetParams {
845 GetPriceTargetParams {
846 symbol: self.symbol,
847 figi: self.figi,
848 isin: self.isin,
849 cusip: self.cusip,
850 country: self.country,
851 exchange: self.exchange
852 }
853 }
854}
855
856#[derive(Clone, Debug, Default)]
858pub struct GetRecommendationsParams {
859 pub symbol: Option<String>,
861 pub figi: Option<String>,
863 pub isin: Option<String>,
865 pub cusip: Option<String>,
867 pub country: Option<String>,
869 pub exchange: Option<String>
871}
872
873impl GetRecommendationsParams {
874 pub fn builder() -> GetRecommendationsParamsBuilder {
876 GetRecommendationsParamsBuilder::default()
877 }
878}
879
880#[derive(Clone, Debug, Default)]
882pub struct GetRecommendationsParamsBuilder {
883 symbol: Option<String>,
885 figi: Option<String>,
887 isin: Option<String>,
889 cusip: Option<String>,
891 country: Option<String>,
893 exchange: Option<String>
895}
896
897impl GetRecommendationsParamsBuilder {
898 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
900 self.symbol = Some(symbol.into());
901
902 self
903 }
904 pub fn figi(mut self, figi: impl Into<String>) -> Self {
906 self.figi = Some(figi.into());
907
908 self
909 }
910 pub fn isin(mut self, isin: impl Into<String>) -> Self {
912 self.isin = Some(isin.into());
913
914 self
915 }
916 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
918 self.cusip = Some(cusip.into());
919
920 self
921 }
922 pub fn country(mut self, country: impl Into<String>) -> Self {
924 self.country = Some(country.into());
925
926 self
927 }
928 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
930 self.exchange = Some(exchange.into());
931
932 self
933 }
934
935 pub fn build(self) -> GetRecommendationsParams {
937 GetRecommendationsParams {
938 symbol: self.symbol,
939 figi: self.figi,
940 isin: self.isin,
941 cusip: self.cusip,
942 country: self.country,
943 exchange: self.exchange
944 }
945 }
946}
947
948#[derive(Clone, Debug, Default)]
950pub struct GetRevenueEstimateParams {
951 pub symbol: Option<String>,
953 pub figi: Option<String>,
955 pub isin: Option<String>,
957 pub cusip: Option<String>,
959 pub country: Option<String>,
961 pub exchange: Option<String>,
963 pub dp: Option<i64>
965}
966
967impl GetRevenueEstimateParams {
968 pub fn builder() -> GetRevenueEstimateParamsBuilder {
970 GetRevenueEstimateParamsBuilder::default()
971 }
972}
973
974#[derive(Clone, Debug, Default)]
976pub struct GetRevenueEstimateParamsBuilder {
977 symbol: Option<String>,
979 figi: Option<String>,
981 isin: Option<String>,
983 cusip: Option<String>,
985 country: Option<String>,
987 exchange: Option<String>,
989 dp: Option<i64>
991}
992
993impl GetRevenueEstimateParamsBuilder {
994 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
996 self.symbol = Some(symbol.into());
997
998 self
999 }
1000 pub fn figi(mut self, figi: impl Into<String>) -> Self {
1002 self.figi = Some(figi.into());
1003
1004 self
1005 }
1006 pub fn isin(mut self, isin: impl Into<String>) -> Self {
1008 self.isin = Some(isin.into());
1009
1010 self
1011 }
1012 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
1014 self.cusip = Some(cusip.into());
1015
1016 self
1017 }
1018 pub fn country(mut self, country: impl Into<String>) -> Self {
1020 self.country = Some(country.into());
1021
1022 self
1023 }
1024 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
1026 self.exchange = Some(exchange.into());
1027
1028 self
1029 }
1030 pub fn dp(mut self, dp: i64) -> Self {
1032
1033 self.dp = Some(dp);
1034
1035 self
1036 }
1037
1038 pub fn build(self) -> GetRevenueEstimateParams {
1040 GetRevenueEstimateParams {
1041 symbol: self.symbol,
1042 figi: self.figi,
1043 isin: self.isin,
1044 cusip: self.cusip,
1045 country: self.country,
1046 exchange: self.exchange,
1047 dp: self.dp
1048 }
1049 }
1050}
1051
1052
1053#[derive(Debug, Clone, Serialize, Deserialize)]
1055#[serde(untagged)]
1056pub enum GetAnalystRatingsLightError {
1057 UnknownValue(serde_json::Value),
1058}
1059
1060#[derive(Debug, Clone, Serialize, Deserialize)]
1062#[serde(untagged)]
1063pub enum GetAnalystRatingsUsEquitiesError {
1064 UnknownValue(serde_json::Value),
1065}
1066
1067#[derive(Debug, Clone, Serialize, Deserialize)]
1069#[serde(untagged)]
1070pub enum GetEarningsEstimateError {
1071 UnknownValue(serde_json::Value),
1072}
1073
1074#[derive(Debug, Clone, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum GetEdgarFilingsArchiveError {
1078 UnknownValue(serde_json::Value),
1079}
1080
1081#[derive(Debug, Clone, Serialize, Deserialize)]
1083#[serde(untagged)]
1084pub enum GetEpsRevisionsError {
1085 UnknownValue(serde_json::Value),
1086}
1087
1088#[derive(Debug, Clone, Serialize, Deserialize)]
1090#[serde(untagged)]
1091pub enum GetEpsTrendError {
1092 UnknownValue(serde_json::Value),
1093}
1094
1095#[derive(Debug, Clone, Serialize, Deserialize)]
1097#[serde(untagged)]
1098pub enum GetGrowthEstimatesError {
1099 UnknownValue(serde_json::Value),
1100}
1101
1102#[derive(Debug, Clone, Serialize, Deserialize)]
1104#[serde(untagged)]
1105pub enum GetPriceTargetError {
1106 UnknownValue(serde_json::Value),
1107}
1108
1109#[derive(Debug, Clone, Serialize, Deserialize)]
1111#[serde(untagged)]
1112pub enum GetRecommendationsError {
1113 UnknownValue(serde_json::Value),
1114}
1115
1116#[derive(Debug, Clone, Serialize, Deserialize)]
1118#[serde(untagged)]
1119pub enum GetRevenueEstimateError {
1120 UnknownValue(serde_json::Value),
1121}
1122
1123
1124pub async fn get_analyst_ratings_light(configuration: &configuration::Configuration, params: GetAnalystRatingsLightParams) -> Result<models::GetAnalystRatingsLight200Response, Error<GetAnalystRatingsLightError>> {
1126 let p_query_symbol = params.symbol;
1128 let p_query_figi = params.figi;
1129 let p_query_isin = params.isin;
1130 let p_query_cusip = params.cusip;
1131 let p_query_exchange = params.exchange;
1132 let p_query_rating_change = params.rating_change;
1133 let p_query_outputsize = params.outputsize;
1134 let p_query_country = params.country;
1135
1136 let uri_str = format!("{}/analyst_ratings/light", configuration.base_path);
1137 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1138
1139 if let Some(ref param_value) = p_query_symbol {
1140 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1141 }
1142 if let Some(ref param_value) = p_query_figi {
1143 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1144 }
1145 if let Some(ref param_value) = p_query_isin {
1146 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1147 }
1148 if let Some(ref param_value) = p_query_cusip {
1149 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1150 }
1151 if let Some(ref param_value) = p_query_exchange {
1152 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1153 }
1154 if let Some(ref param_value) = p_query_rating_change {
1155 req_builder = req_builder.query(&[("rating_change", &serde_json::to_string(param_value)?)]);
1156 }
1157 if let Some(ref param_value) = p_query_outputsize {
1158 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1159 }
1160 if let Some(ref param_value) = p_query_country {
1161 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1162 }
1163 if let Some(ref user_agent) = configuration.user_agent {
1164 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1165 }
1166 if let Some(ref apikey) = configuration.api_key {
1167 let key = apikey.key.clone();
1168 let value = match apikey.prefix {
1169 Some(ref prefix) => format!("{} {}", prefix, key),
1170 None => key,
1171 };
1172 req_builder = req_builder.header("Authorization", value);
1173 };
1174
1175 let req = req_builder.build()?;
1176 let resp = configuration.client.execute(req).await?;
1177
1178 let status = resp.status();
1179 let content_type = resp
1180 .headers()
1181 .get("content-type")
1182 .and_then(|v| v.to_str().ok())
1183 .unwrap_or("application/octet-stream");
1184 let content_type = super::ContentType::from(content_type);
1185
1186 if !status.is_client_error() && !status.is_server_error() {
1187 let content = resp.text().await?;
1188 match content_type {
1189 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1190 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsLight200Response`"))),
1191 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::GetAnalystRatingsLight200Response`")))),
1192 }
1193 } else {
1194 let content = resp.text().await?;
1195 let entity: Option<GetAnalystRatingsLightError> = serde_json::from_str(&content).ok();
1196 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1197 }
1198}
1199
1200pub async fn get_analyst_ratings_us_equities(configuration: &configuration::Configuration, params: GetAnalystRatingsUsEquitiesParams) -> Result<models::GetAnalystRatingsUsEquities200Response, Error<GetAnalystRatingsUsEquitiesError>> {
1202 let p_query_symbol = params.symbol;
1204 let p_query_figi = params.figi;
1205 let p_query_isin = params.isin;
1206 let p_query_cusip = params.cusip;
1207 let p_query_exchange = params.exchange;
1208 let p_query_rating_change = params.rating_change;
1209 let p_query_outputsize = params.outputsize;
1210
1211 let uri_str = format!("{}/analyst_ratings/us_equities", configuration.base_path);
1212 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1213
1214 if let Some(ref param_value) = p_query_symbol {
1215 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1216 }
1217 if let Some(ref param_value) = p_query_figi {
1218 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1219 }
1220 if let Some(ref param_value) = p_query_isin {
1221 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1222 }
1223 if let Some(ref param_value) = p_query_cusip {
1224 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1225 }
1226 if let Some(ref param_value) = p_query_exchange {
1227 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1228 }
1229 if let Some(ref param_value) = p_query_rating_change {
1230 req_builder = req_builder.query(&[("rating_change", &serde_json::to_string(param_value)?)]);
1231 }
1232 if let Some(ref param_value) = p_query_outputsize {
1233 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1234 }
1235 if let Some(ref user_agent) = configuration.user_agent {
1236 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1237 }
1238 if let Some(ref apikey) = configuration.api_key {
1239 let key = apikey.key.clone();
1240 let value = match apikey.prefix {
1241 Some(ref prefix) => format!("{} {}", prefix, key),
1242 None => key,
1243 };
1244 req_builder = req_builder.header("Authorization", value);
1245 };
1246
1247 let req = req_builder.build()?;
1248 let resp = configuration.client.execute(req).await?;
1249
1250 let status = resp.status();
1251 let content_type = resp
1252 .headers()
1253 .get("content-type")
1254 .and_then(|v| v.to_str().ok())
1255 .unwrap_or("application/octet-stream");
1256 let content_type = super::ContentType::from(content_type);
1257
1258 if !status.is_client_error() && !status.is_server_error() {
1259 let content = resp.text().await?;
1260 match content_type {
1261 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1262 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAnalystRatingsUsEquities200Response`"))),
1263 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::GetAnalystRatingsUsEquities200Response`")))),
1264 }
1265 } else {
1266 let content = resp.text().await?;
1267 let entity: Option<GetAnalystRatingsUsEquitiesError> = serde_json::from_str(&content).ok();
1268 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1269 }
1270}
1271
1272pub async fn get_earnings_estimate(configuration: &configuration::Configuration, params: GetEarningsEstimateParams) -> Result<models::GetEarningsEstimate200Response, Error<GetEarningsEstimateError>> {
1274 let p_query_symbol = params.symbol;
1276 let p_query_figi = params.figi;
1277 let p_query_isin = params.isin;
1278 let p_query_cusip = params.cusip;
1279 let p_query_country = params.country;
1280 let p_query_exchange = params.exchange;
1281
1282 let uri_str = format!("{}/earnings_estimate", configuration.base_path);
1283 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1284
1285 if let Some(ref param_value) = p_query_symbol {
1286 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1287 }
1288 if let Some(ref param_value) = p_query_figi {
1289 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1290 }
1291 if let Some(ref param_value) = p_query_isin {
1292 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1293 }
1294 if let Some(ref param_value) = p_query_cusip {
1295 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1296 }
1297 if let Some(ref param_value) = p_query_country {
1298 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1299 }
1300 if let Some(ref param_value) = p_query_exchange {
1301 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1302 }
1303 if let Some(ref user_agent) = configuration.user_agent {
1304 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1305 }
1306 if let Some(ref apikey) = configuration.api_key {
1307 let key = apikey.key.clone();
1308 let value = match apikey.prefix {
1309 Some(ref prefix) => format!("{} {}", prefix, key),
1310 None => key,
1311 };
1312 req_builder = req_builder.header("Authorization", value);
1313 };
1314
1315 let req = req_builder.build()?;
1316 let resp = configuration.client.execute(req).await?;
1317
1318 let status = resp.status();
1319 let content_type = resp
1320 .headers()
1321 .get("content-type")
1322 .and_then(|v| v.to_str().ok())
1323 .unwrap_or("application/octet-stream");
1324 let content_type = super::ContentType::from(content_type);
1325
1326 if !status.is_client_error() && !status.is_server_error() {
1327 let content = resp.text().await?;
1328 match content_type {
1329 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1330 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEarningsEstimate200Response`"))),
1331 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::GetEarningsEstimate200Response`")))),
1332 }
1333 } else {
1334 let content = resp.text().await?;
1335 let entity: Option<GetEarningsEstimateError> = serde_json::from_str(&content).ok();
1336 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1337 }
1338}
1339
1340pub async fn get_edgar_filings_archive(configuration: &configuration::Configuration, params: GetEdgarFilingsArchiveParams) -> Result<models::GetEdgarFilingsArchive200Response, Error<GetEdgarFilingsArchiveError>> {
1342 let p_query_symbol = params.symbol;
1344 let p_query_figi = params.figi;
1345 let p_query_isin = params.isin;
1346 let p_query_cusip = params.cusip;
1347 let p_query_exchange = params.exchange;
1348 let p_query_mic_code = params.mic_code;
1349 let p_query_country = params.country;
1350 let p_query_form_type = params.form_type;
1351 let p_query_filled_from = params.filled_from;
1352 let p_query_filled_to = params.filled_to;
1353 let p_query_page = params.page;
1354 let p_query_page_size = params.page_size;
1355
1356 let uri_str = format!("{}/edgar_filings/archive", configuration.base_path);
1357 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1358
1359 if let Some(ref param_value) = p_query_symbol {
1360 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1361 }
1362 if let Some(ref param_value) = p_query_figi {
1363 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1364 }
1365 if let Some(ref param_value) = p_query_isin {
1366 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1367 }
1368 if let Some(ref param_value) = p_query_cusip {
1369 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1370 }
1371 if let Some(ref param_value) = p_query_exchange {
1372 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1373 }
1374 if let Some(ref param_value) = p_query_mic_code {
1375 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1376 }
1377 if let Some(ref param_value) = p_query_country {
1378 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1379 }
1380 if let Some(ref param_value) = p_query_form_type {
1381 req_builder = req_builder.query(&[("form_type", ¶m_value.to_string())]);
1382 }
1383 if let Some(ref param_value) = p_query_filled_from {
1384 req_builder = req_builder.query(&[("filled_from", ¶m_value.to_string())]);
1385 }
1386 if let Some(ref param_value) = p_query_filled_to {
1387 req_builder = req_builder.query(&[("filled_to", ¶m_value.to_string())]);
1388 }
1389 if let Some(ref param_value) = p_query_page {
1390 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1391 }
1392 if let Some(ref param_value) = p_query_page_size {
1393 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1394 }
1395 if let Some(ref user_agent) = configuration.user_agent {
1396 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1397 }
1398 if let Some(ref apikey) = configuration.api_key {
1399 let key = apikey.key.clone();
1400 let value = match apikey.prefix {
1401 Some(ref prefix) => format!("{} {}", prefix, key),
1402 None => key,
1403 };
1404 req_builder = req_builder.header("Authorization", value);
1405 };
1406
1407 let req = req_builder.build()?;
1408 let resp = configuration.client.execute(req).await?;
1409
1410 let status = resp.status();
1411 let content_type = resp
1412 .headers()
1413 .get("content-type")
1414 .and_then(|v| v.to_str().ok())
1415 .unwrap_or("application/octet-stream");
1416 let content_type = super::ContentType::from(content_type);
1417
1418 if !status.is_client_error() && !status.is_server_error() {
1419 let content = resp.text().await?;
1420 match content_type {
1421 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1422 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEdgarFilingsArchive200Response`"))),
1423 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::GetEdgarFilingsArchive200Response`")))),
1424 }
1425 } else {
1426 let content = resp.text().await?;
1427 let entity: Option<GetEdgarFilingsArchiveError> = serde_json::from_str(&content).ok();
1428 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1429 }
1430}
1431
1432pub async fn get_eps_revisions(configuration: &configuration::Configuration, params: GetEpsRevisionsParams) -> Result<models::GetEpsRevisions200Response, Error<GetEpsRevisionsError>> {
1434 let p_query_symbol = params.symbol;
1436 let p_query_figi = params.figi;
1437 let p_query_isin = params.isin;
1438 let p_query_cusip = params.cusip;
1439 let p_query_country = params.country;
1440 let p_query_exchange = params.exchange;
1441
1442 let uri_str = format!("{}/eps_revisions", configuration.base_path);
1443 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1444
1445 if let Some(ref param_value) = p_query_symbol {
1446 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1447 }
1448 if let Some(ref param_value) = p_query_figi {
1449 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1450 }
1451 if let Some(ref param_value) = p_query_isin {
1452 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1453 }
1454 if let Some(ref param_value) = p_query_cusip {
1455 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1456 }
1457 if let Some(ref param_value) = p_query_country {
1458 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1459 }
1460 if let Some(ref param_value) = p_query_exchange {
1461 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1462 }
1463 if let Some(ref user_agent) = configuration.user_agent {
1464 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1465 }
1466 if let Some(ref apikey) = configuration.api_key {
1467 let key = apikey.key.clone();
1468 let value = match apikey.prefix {
1469 Some(ref prefix) => format!("{} {}", prefix, key),
1470 None => key,
1471 };
1472 req_builder = req_builder.header("Authorization", value);
1473 };
1474
1475 let req = req_builder.build()?;
1476 let resp = configuration.client.execute(req).await?;
1477
1478 let status = resp.status();
1479 let content_type = resp
1480 .headers()
1481 .get("content-type")
1482 .and_then(|v| v.to_str().ok())
1483 .unwrap_or("application/octet-stream");
1484 let content_type = super::ContentType::from(content_type);
1485
1486 if !status.is_client_error() && !status.is_server_error() {
1487 let content = resp.text().await?;
1488 match content_type {
1489 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1490 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsRevisions200Response`"))),
1491 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::GetEpsRevisions200Response`")))),
1492 }
1493 } else {
1494 let content = resp.text().await?;
1495 let entity: Option<GetEpsRevisionsError> = serde_json::from_str(&content).ok();
1496 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1497 }
1498}
1499
1500pub async fn get_eps_trend(configuration: &configuration::Configuration, params: GetEpsTrendParams) -> Result<models::GetEpsTrend200Response, Error<GetEpsTrendError>> {
1502 let p_query_symbol = params.symbol;
1504 let p_query_figi = params.figi;
1505 let p_query_isin = params.isin;
1506 let p_query_cusip = params.cusip;
1507 let p_query_country = params.country;
1508 let p_query_exchange = params.exchange;
1509
1510 let uri_str = format!("{}/eps_trend", configuration.base_path);
1511 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1512
1513 if let Some(ref param_value) = p_query_symbol {
1514 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1515 }
1516 if let Some(ref param_value) = p_query_figi {
1517 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1518 }
1519 if let Some(ref param_value) = p_query_isin {
1520 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1521 }
1522 if let Some(ref param_value) = p_query_cusip {
1523 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1524 }
1525 if let Some(ref param_value) = p_query_country {
1526 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1527 }
1528 if let Some(ref param_value) = p_query_exchange {
1529 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1530 }
1531 if let Some(ref user_agent) = configuration.user_agent {
1532 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1533 }
1534 if let Some(ref apikey) = configuration.api_key {
1535 let key = apikey.key.clone();
1536 let value = match apikey.prefix {
1537 Some(ref prefix) => format!("{} {}", prefix, key),
1538 None => key,
1539 };
1540 req_builder = req_builder.header("Authorization", value);
1541 };
1542
1543 let req = req_builder.build()?;
1544 let resp = configuration.client.execute(req).await?;
1545
1546 let status = resp.status();
1547 let content_type = resp
1548 .headers()
1549 .get("content-type")
1550 .and_then(|v| v.to_str().ok())
1551 .unwrap_or("application/octet-stream");
1552 let content_type = super::ContentType::from(content_type);
1553
1554 if !status.is_client_error() && !status.is_server_error() {
1555 let content = resp.text().await?;
1556 match content_type {
1557 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1558 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEpsTrend200Response`"))),
1559 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::GetEpsTrend200Response`")))),
1560 }
1561 } else {
1562 let content = resp.text().await?;
1563 let entity: Option<GetEpsTrendError> = serde_json::from_str(&content).ok();
1564 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1565 }
1566}
1567
1568pub async fn get_growth_estimates(configuration: &configuration::Configuration, params: GetGrowthEstimatesParams) -> Result<models::GetGrowthEstimates200Response, Error<GetGrowthEstimatesError>> {
1570 let p_query_symbol = params.symbol;
1572 let p_query_figi = params.figi;
1573 let p_query_isin = params.isin;
1574 let p_query_cusip = params.cusip;
1575 let p_query_country = params.country;
1576 let p_query_exchange = params.exchange;
1577
1578 let uri_str = format!("{}/growth_estimates", configuration.base_path);
1579 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1580
1581 if let Some(ref param_value) = p_query_symbol {
1582 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1583 }
1584 if let Some(ref param_value) = p_query_figi {
1585 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1586 }
1587 if let Some(ref param_value) = p_query_isin {
1588 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1589 }
1590 if let Some(ref param_value) = p_query_cusip {
1591 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1592 }
1593 if let Some(ref param_value) = p_query_country {
1594 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1595 }
1596 if let Some(ref param_value) = p_query_exchange {
1597 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1598 }
1599 if let Some(ref user_agent) = configuration.user_agent {
1600 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1601 }
1602 if let Some(ref apikey) = configuration.api_key {
1603 let key = apikey.key.clone();
1604 let value = match apikey.prefix {
1605 Some(ref prefix) => format!("{} {}", prefix, key),
1606 None => key,
1607 };
1608 req_builder = req_builder.header("Authorization", value);
1609 };
1610
1611 let req = req_builder.build()?;
1612 let resp = configuration.client.execute(req).await?;
1613
1614 let status = resp.status();
1615 let content_type = resp
1616 .headers()
1617 .get("content-type")
1618 .and_then(|v| v.to_str().ok())
1619 .unwrap_or("application/octet-stream");
1620 let content_type = super::ContentType::from(content_type);
1621
1622 if !status.is_client_error() && !status.is_server_error() {
1623 let content = resp.text().await?;
1624 match content_type {
1625 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1626 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetGrowthEstimates200Response`"))),
1627 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::GetGrowthEstimates200Response`")))),
1628 }
1629 } else {
1630 let content = resp.text().await?;
1631 let entity: Option<GetGrowthEstimatesError> = serde_json::from_str(&content).ok();
1632 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1633 }
1634}
1635
1636pub async fn get_price_target(configuration: &configuration::Configuration, params: GetPriceTargetParams) -> Result<models::GetPriceTarget200Response, Error<GetPriceTargetError>> {
1638 let p_query_symbol = params.symbol;
1640 let p_query_figi = params.figi;
1641 let p_query_isin = params.isin;
1642 let p_query_cusip = params.cusip;
1643 let p_query_country = params.country;
1644 let p_query_exchange = params.exchange;
1645
1646 let uri_str = format!("{}/price_target", configuration.base_path);
1647 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1648
1649 if let Some(ref param_value) = p_query_symbol {
1650 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1651 }
1652 if let Some(ref param_value) = p_query_figi {
1653 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1654 }
1655 if let Some(ref param_value) = p_query_isin {
1656 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1657 }
1658 if let Some(ref param_value) = p_query_cusip {
1659 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1660 }
1661 if let Some(ref param_value) = p_query_country {
1662 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1663 }
1664 if let Some(ref param_value) = p_query_exchange {
1665 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1666 }
1667 if let Some(ref user_agent) = configuration.user_agent {
1668 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1669 }
1670 if let Some(ref apikey) = configuration.api_key {
1671 let key = apikey.key.clone();
1672 let value = match apikey.prefix {
1673 Some(ref prefix) => format!("{} {}", prefix, key),
1674 None => key,
1675 };
1676 req_builder = req_builder.header("Authorization", value);
1677 };
1678
1679 let req = req_builder.build()?;
1680 let resp = configuration.client.execute(req).await?;
1681
1682 let status = resp.status();
1683 let content_type = resp
1684 .headers()
1685 .get("content-type")
1686 .and_then(|v| v.to_str().ok())
1687 .unwrap_or("application/octet-stream");
1688 let content_type = super::ContentType::from(content_type);
1689
1690 if !status.is_client_error() && !status.is_server_error() {
1691 let content = resp.text().await?;
1692 match content_type {
1693 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1694 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPriceTarget200Response`"))),
1695 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::GetPriceTarget200Response`")))),
1696 }
1697 } else {
1698 let content = resp.text().await?;
1699 let entity: Option<GetPriceTargetError> = serde_json::from_str(&content).ok();
1700 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1701 }
1702}
1703
1704pub async fn get_recommendations(configuration: &configuration::Configuration, params: GetRecommendationsParams) -> Result<models::GetRecommendations200Response, Error<GetRecommendationsError>> {
1706 let p_query_symbol = params.symbol;
1708 let p_query_figi = params.figi;
1709 let p_query_isin = params.isin;
1710 let p_query_cusip = params.cusip;
1711 let p_query_country = params.country;
1712 let p_query_exchange = params.exchange;
1713
1714 let uri_str = format!("{}/recommendations", configuration.base_path);
1715 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1716
1717 if let Some(ref param_value) = p_query_symbol {
1718 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1719 }
1720 if let Some(ref param_value) = p_query_figi {
1721 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1722 }
1723 if let Some(ref param_value) = p_query_isin {
1724 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1725 }
1726 if let Some(ref param_value) = p_query_cusip {
1727 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1728 }
1729 if let Some(ref param_value) = p_query_country {
1730 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1731 }
1732 if let Some(ref param_value) = p_query_exchange {
1733 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1734 }
1735 if let Some(ref user_agent) = configuration.user_agent {
1736 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1737 }
1738 if let Some(ref apikey) = configuration.api_key {
1739 let key = apikey.key.clone();
1740 let value = match apikey.prefix {
1741 Some(ref prefix) => format!("{} {}", prefix, key),
1742 None => key,
1743 };
1744 req_builder = req_builder.header("Authorization", value);
1745 };
1746
1747 let req = req_builder.build()?;
1748 let resp = configuration.client.execute(req).await?;
1749
1750 let status = resp.status();
1751 let content_type = resp
1752 .headers()
1753 .get("content-type")
1754 .and_then(|v| v.to_str().ok())
1755 .unwrap_or("application/octet-stream");
1756 let content_type = super::ContentType::from(content_type);
1757
1758 if !status.is_client_error() && !status.is_server_error() {
1759 let content = resp.text().await?;
1760 match content_type {
1761 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1762 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRecommendations200Response`"))),
1763 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::GetRecommendations200Response`")))),
1764 }
1765 } else {
1766 let content = resp.text().await?;
1767 let entity: Option<GetRecommendationsError> = serde_json::from_str(&content).ok();
1768 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1769 }
1770}
1771
1772pub async fn get_revenue_estimate(configuration: &configuration::Configuration, params: GetRevenueEstimateParams) -> Result<models::GetRevenueEstimate200Response, Error<GetRevenueEstimateError>> {
1774 let p_query_symbol = params.symbol;
1776 let p_query_figi = params.figi;
1777 let p_query_isin = params.isin;
1778 let p_query_cusip = params.cusip;
1779 let p_query_country = params.country;
1780 let p_query_exchange = params.exchange;
1781 let p_query_dp = params.dp;
1782
1783 let uri_str = format!("{}/revenue_estimate", configuration.base_path);
1784 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1785
1786 if let Some(ref param_value) = p_query_symbol {
1787 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1788 }
1789 if let Some(ref param_value) = p_query_figi {
1790 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1791 }
1792 if let Some(ref param_value) = p_query_isin {
1793 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1794 }
1795 if let Some(ref param_value) = p_query_cusip {
1796 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1797 }
1798 if let Some(ref param_value) = p_query_country {
1799 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1800 }
1801 if let Some(ref param_value) = p_query_exchange {
1802 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1803 }
1804 if let Some(ref param_value) = p_query_dp {
1805 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1806 }
1807 if let Some(ref user_agent) = configuration.user_agent {
1808 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1809 }
1810 if let Some(ref apikey) = configuration.api_key {
1811 let key = apikey.key.clone();
1812 let value = match apikey.prefix {
1813 Some(ref prefix) => format!("{} {}", prefix, key),
1814 None => key,
1815 };
1816 req_builder = req_builder.header("Authorization", value);
1817 };
1818
1819 let req = req_builder.build()?;
1820 let resp = configuration.client.execute(req).await?;
1821
1822 let status = resp.status();
1823 let content_type = resp
1824 .headers()
1825 .get("content-type")
1826 .and_then(|v| v.to_str().ok())
1827 .unwrap_or("application/octet-stream");
1828 let content_type = super::ContentType::from(content_type);
1829
1830 if !status.is_client_error() && !status.is_server_error() {
1831 let content = resp.text().await?;
1832 match content_type {
1833 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1834 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRevenueEstimate200Response`"))),
1835 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::GetRevenueEstimate200Response`")))),
1836 }
1837 } else {
1838 let content = resp.text().await?;
1839 let entity: Option<GetRevenueEstimateError> = serde_json::from_str(&content).ok();
1840 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1841 }
1842}
1843