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 GetAnalystRatingsLightParams {
19 pub symbol: Option<String>,
21 pub figi: Option<String>,
23 pub isin: Option<String>,
25 pub cusip: Option<String>,
27 pub exchange: Option<String>,
29 pub rating_change: Option<String>,
31 pub outputsize: Option<i64>,
33 pub country: Option<String>,
35}
36
37impl GetAnalystRatingsLightParams {
38 pub fn builder() -> GetAnalystRatingsLightParamsBuilder {
40 GetAnalystRatingsLightParamsBuilder::default()
41 }
42}
43
44#[derive(Clone, Debug, Default)]
46pub struct GetAnalystRatingsLightParamsBuilder {
47 symbol: Option<String>,
49 figi: Option<String>,
51 isin: Option<String>,
53 cusip: Option<String>,
55 exchange: Option<String>,
57 rating_change: Option<String>,
59 outputsize: Option<i64>,
61 country: Option<String>,
63}
64
65impl GetAnalystRatingsLightParamsBuilder {
66 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
68 self.symbol = Some(symbol.into());
69 self
70 }
71 pub fn figi(mut self, figi: impl Into<String>) -> Self {
73 self.figi = Some(figi.into());
74 self
75 }
76 pub fn isin(mut self, isin: impl Into<String>) -> Self {
78 self.isin = Some(isin.into());
79 self
80 }
81 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
83 self.cusip = Some(cusip.into());
84 self
85 }
86 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
88 self.exchange = Some(exchange.into());
89 self
90 }
91 pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
93 self.rating_change = Some(rating_change.into());
94 self
95 }
96 pub fn outputsize(mut self, outputsize: i64) -> Self {
98 self.outputsize = Some(outputsize);
99 self
100 }
101 pub fn country(mut self, country: impl Into<String>) -> Self {
103 self.country = Some(country.into());
104 self
105 }
106
107 pub fn build(self) -> GetAnalystRatingsLightParams {
109 GetAnalystRatingsLightParams {
110 symbol: self.symbol,
111 figi: self.figi,
112 isin: self.isin,
113 cusip: self.cusip,
114 exchange: self.exchange,
115 rating_change: self.rating_change,
116 outputsize: self.outputsize,
117 country: self.country,
118 }
119 }
120}
121
122#[derive(Clone, Debug, Default, Serialize, Deserialize)]
124pub struct GetAnalystRatingsUsEquitiesParams {
125 pub symbol: Option<String>,
127 pub figi: Option<String>,
129 pub isin: Option<String>,
131 pub cusip: Option<String>,
133 pub exchange: Option<String>,
135 pub rating_change: Option<String>,
137 pub outputsize: Option<i64>,
139}
140
141impl GetAnalystRatingsUsEquitiesParams {
142 pub fn builder() -> GetAnalystRatingsUsEquitiesParamsBuilder {
144 GetAnalystRatingsUsEquitiesParamsBuilder::default()
145 }
146}
147
148#[derive(Clone, Debug, Default)]
150pub struct GetAnalystRatingsUsEquitiesParamsBuilder {
151 symbol: Option<String>,
153 figi: Option<String>,
155 isin: Option<String>,
157 cusip: Option<String>,
159 exchange: Option<String>,
161 rating_change: Option<String>,
163 outputsize: Option<i64>,
165}
166
167impl GetAnalystRatingsUsEquitiesParamsBuilder {
168 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
170 self.symbol = Some(symbol.into());
171 self
172 }
173 pub fn figi(mut self, figi: impl Into<String>) -> Self {
175 self.figi = Some(figi.into());
176 self
177 }
178 pub fn isin(mut self, isin: impl Into<String>) -> Self {
180 self.isin = Some(isin.into());
181 self
182 }
183 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
185 self.cusip = Some(cusip.into());
186 self
187 }
188 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
190 self.exchange = Some(exchange.into());
191 self
192 }
193 pub fn rating_change(mut self, rating_change: impl Into<String>) -> Self {
195 self.rating_change = Some(rating_change.into());
196 self
197 }
198 pub fn outputsize(mut self, outputsize: i64) -> Self {
200 self.outputsize = Some(outputsize);
201 self
202 }
203
204 pub fn build(self) -> GetAnalystRatingsUsEquitiesParams {
206 GetAnalystRatingsUsEquitiesParams {
207 symbol: self.symbol,
208 figi: self.figi,
209 isin: self.isin,
210 cusip: self.cusip,
211 exchange: self.exchange,
212 rating_change: self.rating_change,
213 outputsize: self.outputsize,
214 }
215 }
216}
217
218#[derive(Clone, Debug, Default, Serialize, Deserialize)]
220pub struct GetEarningsEstimateParams {
221 pub symbol: Option<String>,
223 pub figi: Option<String>,
225 pub isin: Option<String>,
227 pub cusip: Option<String>,
229 pub country: Option<String>,
231 pub exchange: Option<String>,
233}
234
235impl GetEarningsEstimateParams {
236 pub fn builder() -> GetEarningsEstimateParamsBuilder {
238 GetEarningsEstimateParamsBuilder::default()
239 }
240}
241
242#[derive(Clone, Debug, Default)]
244pub struct GetEarningsEstimateParamsBuilder {
245 symbol: Option<String>,
247 figi: Option<String>,
249 isin: Option<String>,
251 cusip: Option<String>,
253 country: Option<String>,
255 exchange: Option<String>,
257}
258
259impl GetEarningsEstimateParamsBuilder {
260 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
262 self.symbol = Some(symbol.into());
263 self
264 }
265 pub fn figi(mut self, figi: impl Into<String>) -> Self {
267 self.figi = Some(figi.into());
268 self
269 }
270 pub fn isin(mut self, isin: impl Into<String>) -> Self {
272 self.isin = Some(isin.into());
273 self
274 }
275 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
277 self.cusip = Some(cusip.into());
278 self
279 }
280 pub fn country(mut self, country: impl Into<String>) -> Self {
282 self.country = Some(country.into());
283 self
284 }
285 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
287 self.exchange = Some(exchange.into());
288 self
289 }
290
291 pub fn build(self) -> GetEarningsEstimateParams {
293 GetEarningsEstimateParams {
294 symbol: self.symbol,
295 figi: self.figi,
296 isin: self.isin,
297 cusip: self.cusip,
298 country: self.country,
299 exchange: self.exchange,
300 }
301 }
302}
303
304#[derive(Clone, Debug, Default, Serialize, Deserialize)]
306pub struct GetEdgarFilingsArchiveParams {
307 pub symbol: Option<String>,
309 pub figi: Option<String>,
311 pub isin: Option<String>,
313 pub cusip: Option<String>,
315 pub exchange: Option<String>,
317 pub mic_code: Option<String>,
319 pub country: Option<String>,
321 pub form_type: Option<String>,
323 pub filled_from: Option<String>,
325 pub filled_to: Option<String>,
327 pub page: Option<i64>,
329 pub page_size: Option<i64>,
331}
332
333impl GetEdgarFilingsArchiveParams {
334 pub fn builder() -> GetEdgarFilingsArchiveParamsBuilder {
336 GetEdgarFilingsArchiveParamsBuilder::default()
337 }
338}
339
340#[derive(Clone, Debug, Default)]
342pub struct GetEdgarFilingsArchiveParamsBuilder {
343 symbol: Option<String>,
345 figi: Option<String>,
347 isin: Option<String>,
349 cusip: Option<String>,
351 exchange: Option<String>,
353 mic_code: Option<String>,
355 country: Option<String>,
357 form_type: Option<String>,
359 filled_from: Option<String>,
361 filled_to: Option<String>,
363 page: Option<i64>,
365 page_size: Option<i64>,
367}
368
369impl GetEdgarFilingsArchiveParamsBuilder {
370 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
372 self.symbol = Some(symbol.into());
373 self
374 }
375 pub fn figi(mut self, figi: impl Into<String>) -> Self {
377 self.figi = Some(figi.into());
378 self
379 }
380 pub fn isin(mut self, isin: impl Into<String>) -> Self {
382 self.isin = Some(isin.into());
383 self
384 }
385 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
387 self.cusip = Some(cusip.into());
388 self
389 }
390 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
392 self.exchange = Some(exchange.into());
393 self
394 }
395 pub fn mic_code(mut self, mic_code: impl Into<String>) -> Self {
397 self.mic_code = Some(mic_code.into());
398 self
399 }
400 pub fn country(mut self, country: impl Into<String>) -> Self {
402 self.country = Some(country.into());
403 self
404 }
405 pub fn form_type(mut self, form_type: impl Into<String>) -> Self {
407 self.form_type = Some(form_type.into());
408 self
409 }
410 pub fn filled_from(mut self, filled_from: impl Into<String>) -> Self {
412 self.filled_from = Some(filled_from.into());
413 self
414 }
415 pub fn filled_to(mut self, filled_to: impl Into<String>) -> Self {
417 self.filled_to = Some(filled_to.into());
418 self
419 }
420 pub fn page(mut self, page: i64) -> Self {
422 self.page = Some(page);
423 self
424 }
425 pub fn page_size(mut self, page_size: i64) -> Self {
427 self.page_size = Some(page_size);
428 self
429 }
430
431 pub fn build(self) -> GetEdgarFilingsArchiveParams {
433 GetEdgarFilingsArchiveParams {
434 symbol: self.symbol,
435 figi: self.figi,
436 isin: self.isin,
437 cusip: self.cusip,
438 exchange: self.exchange,
439 mic_code: self.mic_code,
440 country: self.country,
441 form_type: self.form_type,
442 filled_from: self.filled_from,
443 filled_to: self.filled_to,
444 page: self.page,
445 page_size: self.page_size,
446 }
447 }
448}
449
450#[derive(Clone, Debug, Default, Serialize, Deserialize)]
452pub struct GetEpsRevisionsParams {
453 pub symbol: Option<String>,
455 pub figi: Option<String>,
457 pub isin: Option<String>,
459 pub cusip: Option<String>,
461 pub country: Option<String>,
463 pub exchange: Option<String>,
465}
466
467impl GetEpsRevisionsParams {
468 pub fn builder() -> GetEpsRevisionsParamsBuilder {
470 GetEpsRevisionsParamsBuilder::default()
471 }
472}
473
474#[derive(Clone, Debug, Default)]
476pub struct GetEpsRevisionsParamsBuilder {
477 symbol: Option<String>,
479 figi: Option<String>,
481 isin: Option<String>,
483 cusip: Option<String>,
485 country: Option<String>,
487 exchange: Option<String>,
489}
490
491impl GetEpsRevisionsParamsBuilder {
492 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
494 self.symbol = Some(symbol.into());
495 self
496 }
497 pub fn figi(mut self, figi: impl Into<String>) -> Self {
499 self.figi = Some(figi.into());
500 self
501 }
502 pub fn isin(mut self, isin: impl Into<String>) -> Self {
504 self.isin = Some(isin.into());
505 self
506 }
507 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
509 self.cusip = Some(cusip.into());
510 self
511 }
512 pub fn country(mut self, country: impl Into<String>) -> Self {
514 self.country = Some(country.into());
515 self
516 }
517 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
519 self.exchange = Some(exchange.into());
520 self
521 }
522
523 pub fn build(self) -> GetEpsRevisionsParams {
525 GetEpsRevisionsParams {
526 symbol: self.symbol,
527 figi: self.figi,
528 isin: self.isin,
529 cusip: self.cusip,
530 country: self.country,
531 exchange: self.exchange,
532 }
533 }
534}
535
536#[derive(Clone, Debug, Default, Serialize, Deserialize)]
538pub struct GetEpsTrendParams {
539 pub symbol: Option<String>,
541 pub figi: Option<String>,
543 pub isin: Option<String>,
545 pub cusip: Option<String>,
547 pub country: Option<String>,
549 pub exchange: Option<String>,
551}
552
553impl GetEpsTrendParams {
554 pub fn builder() -> GetEpsTrendParamsBuilder {
556 GetEpsTrendParamsBuilder::default()
557 }
558}
559
560#[derive(Clone, Debug, Default)]
562pub struct GetEpsTrendParamsBuilder {
563 symbol: Option<String>,
565 figi: Option<String>,
567 isin: Option<String>,
569 cusip: Option<String>,
571 country: Option<String>,
573 exchange: Option<String>,
575}
576
577impl GetEpsTrendParamsBuilder {
578 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
580 self.symbol = Some(symbol.into());
581 self
582 }
583 pub fn figi(mut self, figi: impl Into<String>) -> Self {
585 self.figi = Some(figi.into());
586 self
587 }
588 pub fn isin(mut self, isin: impl Into<String>) -> Self {
590 self.isin = Some(isin.into());
591 self
592 }
593 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
595 self.cusip = Some(cusip.into());
596 self
597 }
598 pub fn country(mut self, country: impl Into<String>) -> Self {
600 self.country = Some(country.into());
601 self
602 }
603 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
605 self.exchange = Some(exchange.into());
606 self
607 }
608
609 pub fn build(self) -> GetEpsTrendParams {
611 GetEpsTrendParams {
612 symbol: self.symbol,
613 figi: self.figi,
614 isin: self.isin,
615 cusip: self.cusip,
616 country: self.country,
617 exchange: self.exchange,
618 }
619 }
620}
621
622#[derive(Clone, Debug, Default, Serialize, Deserialize)]
624pub struct GetGrowthEstimatesParams {
625 pub symbol: Option<String>,
627 pub figi: Option<String>,
629 pub isin: Option<String>,
631 pub cusip: Option<String>,
633 pub country: Option<String>,
635 pub exchange: Option<String>,
637}
638
639impl GetGrowthEstimatesParams {
640 pub fn builder() -> GetGrowthEstimatesParamsBuilder {
642 GetGrowthEstimatesParamsBuilder::default()
643 }
644}
645
646#[derive(Clone, Debug, Default)]
648pub struct GetGrowthEstimatesParamsBuilder {
649 symbol: Option<String>,
651 figi: Option<String>,
653 isin: Option<String>,
655 cusip: Option<String>,
657 country: Option<String>,
659 exchange: Option<String>,
661}
662
663impl GetGrowthEstimatesParamsBuilder {
664 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
666 self.symbol = Some(symbol.into());
667 self
668 }
669 pub fn figi(mut self, figi: impl Into<String>) -> Self {
671 self.figi = Some(figi.into());
672 self
673 }
674 pub fn isin(mut self, isin: impl Into<String>) -> Self {
676 self.isin = Some(isin.into());
677 self
678 }
679 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
681 self.cusip = Some(cusip.into());
682 self
683 }
684 pub fn country(mut self, country: impl Into<String>) -> Self {
686 self.country = Some(country.into());
687 self
688 }
689 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
691 self.exchange = Some(exchange.into());
692 self
693 }
694
695 pub fn build(self) -> GetGrowthEstimatesParams {
697 GetGrowthEstimatesParams {
698 symbol: self.symbol,
699 figi: self.figi,
700 isin: self.isin,
701 cusip: self.cusip,
702 country: self.country,
703 exchange: self.exchange,
704 }
705 }
706}
707
708#[derive(Clone, Debug, Default, Serialize, Deserialize)]
710pub struct GetPriceTargetParams {
711 pub symbol: Option<String>,
713 pub figi: Option<String>,
715 pub isin: Option<String>,
717 pub cusip: Option<String>,
719 pub country: Option<String>,
721 pub exchange: Option<String>,
723}
724
725impl GetPriceTargetParams {
726 pub fn builder() -> GetPriceTargetParamsBuilder {
728 GetPriceTargetParamsBuilder::default()
729 }
730}
731
732#[derive(Clone, Debug, Default)]
734pub struct GetPriceTargetParamsBuilder {
735 symbol: Option<String>,
737 figi: Option<String>,
739 isin: Option<String>,
741 cusip: Option<String>,
743 country: Option<String>,
745 exchange: Option<String>,
747}
748
749impl GetPriceTargetParamsBuilder {
750 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
752 self.symbol = Some(symbol.into());
753 self
754 }
755 pub fn figi(mut self, figi: impl Into<String>) -> Self {
757 self.figi = Some(figi.into());
758 self
759 }
760 pub fn isin(mut self, isin: impl Into<String>) -> Self {
762 self.isin = Some(isin.into());
763 self
764 }
765 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
767 self.cusip = Some(cusip.into());
768 self
769 }
770 pub fn country(mut self, country: impl Into<String>) -> Self {
772 self.country = Some(country.into());
773 self
774 }
775 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
777 self.exchange = Some(exchange.into());
778 self
779 }
780
781 pub fn build(self) -> GetPriceTargetParams {
783 GetPriceTargetParams {
784 symbol: self.symbol,
785 figi: self.figi,
786 isin: self.isin,
787 cusip: self.cusip,
788 country: self.country,
789 exchange: self.exchange,
790 }
791 }
792}
793
794#[derive(Clone, Debug, Default, Serialize, Deserialize)]
796pub struct GetRecommendationsParams {
797 pub symbol: Option<String>,
799 pub figi: Option<String>,
801 pub isin: Option<String>,
803 pub cusip: Option<String>,
805 pub country: Option<String>,
807 pub exchange: Option<String>,
809}
810
811impl GetRecommendationsParams {
812 pub fn builder() -> GetRecommendationsParamsBuilder {
814 GetRecommendationsParamsBuilder::default()
815 }
816}
817
818#[derive(Clone, Debug, Default)]
820pub struct GetRecommendationsParamsBuilder {
821 symbol: Option<String>,
823 figi: Option<String>,
825 isin: Option<String>,
827 cusip: Option<String>,
829 country: Option<String>,
831 exchange: Option<String>,
833}
834
835impl GetRecommendationsParamsBuilder {
836 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
838 self.symbol = Some(symbol.into());
839 self
840 }
841 pub fn figi(mut self, figi: impl Into<String>) -> Self {
843 self.figi = Some(figi.into());
844 self
845 }
846 pub fn isin(mut self, isin: impl Into<String>) -> Self {
848 self.isin = Some(isin.into());
849 self
850 }
851 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
853 self.cusip = Some(cusip.into());
854 self
855 }
856 pub fn country(mut self, country: impl Into<String>) -> Self {
858 self.country = Some(country.into());
859 self
860 }
861 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
863 self.exchange = Some(exchange.into());
864 self
865 }
866
867 pub fn build(self) -> GetRecommendationsParams {
869 GetRecommendationsParams {
870 symbol: self.symbol,
871 figi: self.figi,
872 isin: self.isin,
873 cusip: self.cusip,
874 country: self.country,
875 exchange: self.exchange,
876 }
877 }
878}
879
880#[derive(Clone, Debug, Default, Serialize, Deserialize)]
882pub struct GetRevenueEstimateParams {
883 pub symbol: Option<String>,
885 pub figi: Option<String>,
887 pub isin: Option<String>,
889 pub cusip: Option<String>,
891 pub country: Option<String>,
893 pub exchange: Option<String>,
895 pub dp: Option<i64>,
897}
898
899impl GetRevenueEstimateParams {
900 pub fn builder() -> GetRevenueEstimateParamsBuilder {
902 GetRevenueEstimateParamsBuilder::default()
903 }
904}
905
906#[derive(Clone, Debug, Default)]
908pub struct GetRevenueEstimateParamsBuilder {
909 symbol: Option<String>,
911 figi: Option<String>,
913 isin: Option<String>,
915 cusip: Option<String>,
917 country: Option<String>,
919 exchange: Option<String>,
921 dp: Option<i64>,
923}
924
925impl GetRevenueEstimateParamsBuilder {
926 pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
928 self.symbol = Some(symbol.into());
929 self
930 }
931 pub fn figi(mut self, figi: impl Into<String>) -> Self {
933 self.figi = Some(figi.into());
934 self
935 }
936 pub fn isin(mut self, isin: impl Into<String>) -> Self {
938 self.isin = Some(isin.into());
939 self
940 }
941 pub fn cusip(mut self, cusip: impl Into<String>) -> Self {
943 self.cusip = Some(cusip.into());
944 self
945 }
946 pub fn country(mut self, country: impl Into<String>) -> Self {
948 self.country = Some(country.into());
949 self
950 }
951 pub fn exchange(mut self, exchange: impl Into<String>) -> Self {
953 self.exchange = Some(exchange.into());
954 self
955 }
956 pub fn dp(mut self, dp: i64) -> Self {
958 self.dp = Some(dp);
959 self
960 }
961
962 pub fn build(self) -> GetRevenueEstimateParams {
964 GetRevenueEstimateParams {
965 symbol: self.symbol,
966 figi: self.figi,
967 isin: self.isin,
968 cusip: self.cusip,
969 country: self.country,
970 exchange: self.exchange,
971 dp: self.dp,
972 }
973 }
974}
975
976#[derive(Debug, Clone, Serialize, Deserialize)]
978#[serde(untagged)]
979pub enum GetAnalystRatingsLightError {
980 UnknownValue(serde_json::Value),
981}
982
983#[derive(Debug, Clone, Serialize, Deserialize)]
985#[serde(untagged)]
986pub enum GetAnalystRatingsUsEquitiesError {
987 UnknownValue(serde_json::Value),
988}
989
990#[derive(Debug, Clone, Serialize, Deserialize)]
992#[serde(untagged)]
993pub enum GetEarningsEstimateError {
994 UnknownValue(serde_json::Value),
995}
996
997#[derive(Debug, Clone, Serialize, Deserialize)]
999#[serde(untagged)]
1000pub enum GetEdgarFilingsArchiveError {
1001 UnknownValue(serde_json::Value),
1002}
1003
1004#[derive(Debug, Clone, Serialize, Deserialize)]
1006#[serde(untagged)]
1007pub enum GetEpsRevisionsError {
1008 UnknownValue(serde_json::Value),
1009}
1010
1011#[derive(Debug, Clone, Serialize, Deserialize)]
1013#[serde(untagged)]
1014pub enum GetEpsTrendError {
1015 UnknownValue(serde_json::Value),
1016}
1017
1018#[derive(Debug, Clone, Serialize, Deserialize)]
1020#[serde(untagged)]
1021pub enum GetGrowthEstimatesError {
1022 UnknownValue(serde_json::Value),
1023}
1024
1025#[derive(Debug, Clone, Serialize, Deserialize)]
1027#[serde(untagged)]
1028pub enum GetPriceTargetError {
1029 UnknownValue(serde_json::Value),
1030}
1031
1032#[derive(Debug, Clone, Serialize, Deserialize)]
1034#[serde(untagged)]
1035pub enum GetRecommendationsError {
1036 UnknownValue(serde_json::Value),
1037}
1038
1039#[derive(Debug, Clone, Serialize, Deserialize)]
1041#[serde(untagged)]
1042pub enum GetRevenueEstimateError {
1043 UnknownValue(serde_json::Value),
1044}
1045
1046pub async fn get_analyst_ratings_light(
1048 configuration: &configuration::Configuration,
1049 params: GetAnalystRatingsLightParams,
1050) -> Result<models::GetAnalystRatingsLight200ResponseEnum, Error<GetAnalystRatingsLightError>> {
1051 let p_query_symbol = params.symbol;
1053 let p_query_figi = params.figi;
1054 let p_query_isin = params.isin;
1055 let p_query_cusip = params.cusip;
1056 let p_query_exchange = params.exchange;
1057 let p_query_rating_change = params.rating_change;
1058 let p_query_outputsize = params.outputsize;
1059 let p_query_country = params.country;
1060
1061 let uri_str = format!("{}/analyst_ratings/light", configuration.base_path);
1062 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1063
1064 if let Some(ref param_value) = p_query_symbol {
1065 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1066 }
1067 if let Some(ref param_value) = p_query_figi {
1068 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1069 }
1070 if let Some(ref param_value) = p_query_isin {
1071 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1072 }
1073 if let Some(ref param_value) = p_query_cusip {
1074 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1075 }
1076 if let Some(ref param_value) = p_query_exchange {
1077 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1078 }
1079 if let Some(ref param_value) = p_query_rating_change {
1080 req_builder = req_builder.query(&[("rating_change", ¶m_value.to_string())]);
1081 }
1082 if let Some(ref param_value) = p_query_outputsize {
1083 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1084 }
1085 if let Some(ref param_value) = p_query_country {
1086 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1087 }
1088 if let Some(ref user_agent) = configuration.user_agent {
1089 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1090 }
1091 if let Some(ref apikey) = configuration.api_key {
1092 let key = apikey.key.clone();
1093 let value = match apikey.prefix {
1094 Some(ref prefix) => format!("{} {}", prefix, key),
1095 None => key,
1096 };
1097 req_builder = req_builder.header("Authorization", value);
1098 };
1099
1100 let req = req_builder.build()?;
1101 let resp = configuration.client.execute(req).await?;
1102
1103 let status = resp.status();
1104 let content_type = resp
1105 .headers()
1106 .get("content-type")
1107 .and_then(|v| v.to_str().ok())
1108 .unwrap_or("application/octet-stream");
1109 let content_type = super::ContentType::from(content_type);
1110
1111 if !status.is_client_error() && !status.is_server_error() {
1112 let content = resp.text().await?;
1113 match content_type {
1114 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1115 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetAnalystRatingsLight200ResponseEnum`"))),
1116 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::GetAnalystRatingsLight200ResponseEnum`")))),
1117 }
1118 } else {
1119 let content = resp.text().await?;
1120 let entity: Option<GetAnalystRatingsLightError> = serde_json::from_str(&content).ok();
1121 Err(Error::ResponseError(ResponseContent {
1122 status,
1123 content,
1124 entity,
1125 }))
1126 }
1127}
1128
1129pub async fn get_analyst_ratings_us_equities(
1131 configuration: &configuration::Configuration,
1132 params: GetAnalystRatingsUsEquitiesParams,
1133) -> Result<
1134 models::GetAnalystRatingsUsEquities200ResponseEnum,
1135 Error<GetAnalystRatingsUsEquitiesError>,
1136> {
1137 let p_query_symbol = params.symbol;
1139 let p_query_figi = params.figi;
1140 let p_query_isin = params.isin;
1141 let p_query_cusip = params.cusip;
1142 let p_query_exchange = params.exchange;
1143 let p_query_rating_change = params.rating_change;
1144 let p_query_outputsize = params.outputsize;
1145
1146 let uri_str = format!("{}/analyst_ratings/us_equities", configuration.base_path);
1147 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1148
1149 if let Some(ref param_value) = p_query_symbol {
1150 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1151 }
1152 if let Some(ref param_value) = p_query_figi {
1153 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1154 }
1155 if let Some(ref param_value) = p_query_isin {
1156 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1157 }
1158 if let Some(ref param_value) = p_query_cusip {
1159 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1160 }
1161 if let Some(ref param_value) = p_query_exchange {
1162 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1163 }
1164 if let Some(ref param_value) = p_query_rating_change {
1165 req_builder = req_builder.query(&[("rating_change", ¶m_value.to_string())]);
1166 }
1167 if let Some(ref param_value) = p_query_outputsize {
1168 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1169 }
1170 if let Some(ref user_agent) = configuration.user_agent {
1171 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1172 }
1173 if let Some(ref apikey) = configuration.api_key {
1174 let key = apikey.key.clone();
1175 let value = match apikey.prefix {
1176 Some(ref prefix) => format!("{} {}", prefix, key),
1177 None => key,
1178 };
1179 req_builder = req_builder.header("Authorization", value);
1180 };
1181
1182 let req = req_builder.build()?;
1183 let resp = configuration.client.execute(req).await?;
1184
1185 let status = resp.status();
1186 let content_type = resp
1187 .headers()
1188 .get("content-type")
1189 .and_then(|v| v.to_str().ok())
1190 .unwrap_or("application/octet-stream");
1191 let content_type = super::ContentType::from(content_type);
1192
1193 if !status.is_client_error() && !status.is_server_error() {
1194 let content = resp.text().await?;
1195 match content_type {
1196 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1197 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetAnalystRatingsUsEquities200ResponseEnum`"))),
1198 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::GetAnalystRatingsUsEquities200ResponseEnum`")))),
1199 }
1200 } else {
1201 let content = resp.text().await?;
1202 let entity: Option<GetAnalystRatingsUsEquitiesError> = serde_json::from_str(&content).ok();
1203 Err(Error::ResponseError(ResponseContent {
1204 status,
1205 content,
1206 entity,
1207 }))
1208 }
1209}
1210
1211pub async fn get_earnings_estimate(
1213 configuration: &configuration::Configuration,
1214 params: GetEarningsEstimateParams,
1215) -> Result<models::GetEarningsEstimate200ResponseEnum, Error<GetEarningsEstimateError>> {
1216 let p_query_symbol = params.symbol;
1218 let p_query_figi = params.figi;
1219 let p_query_isin = params.isin;
1220 let p_query_cusip = params.cusip;
1221 let p_query_country = params.country;
1222 let p_query_exchange = params.exchange;
1223
1224 let uri_str = format!("{}/earnings_estimate", configuration.base_path);
1225 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1226
1227 if let Some(ref param_value) = p_query_symbol {
1228 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1229 }
1230 if let Some(ref param_value) = p_query_figi {
1231 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1232 }
1233 if let Some(ref param_value) = p_query_isin {
1234 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1235 }
1236 if let Some(ref param_value) = p_query_cusip {
1237 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1238 }
1239 if let Some(ref param_value) = p_query_country {
1240 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1241 }
1242 if let Some(ref param_value) = p_query_exchange {
1243 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1244 }
1245 if let Some(ref user_agent) = configuration.user_agent {
1246 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1247 }
1248 if let Some(ref apikey) = configuration.api_key {
1249 let key = apikey.key.clone();
1250 let value = match apikey.prefix {
1251 Some(ref prefix) => format!("{} {}", prefix, key),
1252 None => key,
1253 };
1254 req_builder = req_builder.header("Authorization", value);
1255 };
1256
1257 let req = req_builder.build()?;
1258 let resp = configuration.client.execute(req).await?;
1259
1260 let status = resp.status();
1261 let content_type = resp
1262 .headers()
1263 .get("content-type")
1264 .and_then(|v| v.to_str().ok())
1265 .unwrap_or("application/octet-stream");
1266 let content_type = super::ContentType::from(content_type);
1267
1268 if !status.is_client_error() && !status.is_server_error() {
1269 let content = resp.text().await?;
1270 match content_type {
1271 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1272 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEarningsEstimate200ResponseEnum`"))),
1273 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::GetEarningsEstimate200ResponseEnum`")))),
1274 }
1275 } else {
1276 let content = resp.text().await?;
1277 let entity: Option<GetEarningsEstimateError> = serde_json::from_str(&content).ok();
1278 Err(Error::ResponseError(ResponseContent {
1279 status,
1280 content,
1281 entity,
1282 }))
1283 }
1284}
1285
1286pub async fn get_edgar_filings_archive(
1288 configuration: &configuration::Configuration,
1289 params: GetEdgarFilingsArchiveParams,
1290) -> Result<models::GetEdgarFilingsArchive200ResponseEnum, Error<GetEdgarFilingsArchiveError>> {
1291 let p_query_symbol = params.symbol;
1293 let p_query_figi = params.figi;
1294 let p_query_isin = params.isin;
1295 let p_query_cusip = params.cusip;
1296 let p_query_exchange = params.exchange;
1297 let p_query_mic_code = params.mic_code;
1298 let p_query_country = params.country;
1299 let p_query_form_type = params.form_type;
1300 let p_query_filled_from = params.filled_from;
1301 let p_query_filled_to = params.filled_to;
1302 let p_query_page = params.page;
1303 let p_query_page_size = params.page_size;
1304
1305 let uri_str = format!("{}/edgar_filings/archive", configuration.base_path);
1306 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1307
1308 if let Some(ref param_value) = p_query_symbol {
1309 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1310 }
1311 if let Some(ref param_value) = p_query_figi {
1312 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1313 }
1314 if let Some(ref param_value) = p_query_isin {
1315 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1316 }
1317 if let Some(ref param_value) = p_query_cusip {
1318 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1319 }
1320 if let Some(ref param_value) = p_query_exchange {
1321 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1322 }
1323 if let Some(ref param_value) = p_query_mic_code {
1324 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1325 }
1326 if let Some(ref param_value) = p_query_country {
1327 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1328 }
1329 if let Some(ref param_value) = p_query_form_type {
1330 req_builder = req_builder.query(&[("form_type", ¶m_value.to_string())]);
1331 }
1332 if let Some(ref param_value) = p_query_filled_from {
1333 req_builder = req_builder.query(&[("filled_from", ¶m_value.to_string())]);
1334 }
1335 if let Some(ref param_value) = p_query_filled_to {
1336 req_builder = req_builder.query(&[("filled_to", ¶m_value.to_string())]);
1337 }
1338 if let Some(ref param_value) = p_query_page {
1339 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1340 }
1341 if let Some(ref param_value) = p_query_page_size {
1342 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1343 }
1344 if let Some(ref user_agent) = configuration.user_agent {
1345 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1346 }
1347 if let Some(ref apikey) = configuration.api_key {
1348 let key = apikey.key.clone();
1349 let value = match apikey.prefix {
1350 Some(ref prefix) => format!("{} {}", prefix, key),
1351 None => key,
1352 };
1353 req_builder = req_builder.header("Authorization", value);
1354 };
1355
1356 let req = req_builder.build()?;
1357 let resp = configuration.client.execute(req).await?;
1358
1359 let status = resp.status();
1360 let content_type = resp
1361 .headers()
1362 .get("content-type")
1363 .and_then(|v| v.to_str().ok())
1364 .unwrap_or("application/octet-stream");
1365 let content_type = super::ContentType::from(content_type);
1366
1367 if !status.is_client_error() && !status.is_server_error() {
1368 let content = resp.text().await?;
1369 match content_type {
1370 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1371 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEdgarFilingsArchive200ResponseEnum`"))),
1372 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::GetEdgarFilingsArchive200ResponseEnum`")))),
1373 }
1374 } else {
1375 let content = resp.text().await?;
1376 let entity: Option<GetEdgarFilingsArchiveError> = serde_json::from_str(&content).ok();
1377 Err(Error::ResponseError(ResponseContent {
1378 status,
1379 content,
1380 entity,
1381 }))
1382 }
1383}
1384
1385pub async fn get_eps_revisions(
1387 configuration: &configuration::Configuration,
1388 params: GetEpsRevisionsParams,
1389) -> Result<models::GetEpsRevisions200ResponseEnum, Error<GetEpsRevisionsError>> {
1390 let p_query_symbol = params.symbol;
1392 let p_query_figi = params.figi;
1393 let p_query_isin = params.isin;
1394 let p_query_cusip = params.cusip;
1395 let p_query_country = params.country;
1396 let p_query_exchange = params.exchange;
1397
1398 let uri_str = format!("{}/eps_revisions", configuration.base_path);
1399 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1400
1401 if let Some(ref param_value) = p_query_symbol {
1402 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1403 }
1404 if let Some(ref param_value) = p_query_figi {
1405 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1406 }
1407 if let Some(ref param_value) = p_query_isin {
1408 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1409 }
1410 if let Some(ref param_value) = p_query_cusip {
1411 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1412 }
1413 if let Some(ref param_value) = p_query_country {
1414 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1415 }
1416 if let Some(ref param_value) = p_query_exchange {
1417 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1418 }
1419 if let Some(ref user_agent) = configuration.user_agent {
1420 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1421 }
1422 if let Some(ref apikey) = configuration.api_key {
1423 let key = apikey.key.clone();
1424 let value = match apikey.prefix {
1425 Some(ref prefix) => format!("{} {}", prefix, key),
1426 None => key,
1427 };
1428 req_builder = req_builder.header("Authorization", value);
1429 };
1430
1431 let req = req_builder.build()?;
1432 let resp = configuration.client.execute(req).await?;
1433
1434 let status = resp.status();
1435 let content_type = resp
1436 .headers()
1437 .get("content-type")
1438 .and_then(|v| v.to_str().ok())
1439 .unwrap_or("application/octet-stream");
1440 let content_type = super::ContentType::from(content_type);
1441
1442 if !status.is_client_error() && !status.is_server_error() {
1443 let content = resp.text().await?;
1444 match content_type {
1445 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1446 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEpsRevisions200ResponseEnum`"))),
1447 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::GetEpsRevisions200ResponseEnum`")))),
1448 }
1449 } else {
1450 let content = resp.text().await?;
1451 let entity: Option<GetEpsRevisionsError> = serde_json::from_str(&content).ok();
1452 Err(Error::ResponseError(ResponseContent {
1453 status,
1454 content,
1455 entity,
1456 }))
1457 }
1458}
1459
1460pub async fn get_eps_trend(
1462 configuration: &configuration::Configuration,
1463 params: GetEpsTrendParams,
1464) -> Result<models::GetEpsTrend200ResponseEnum, Error<GetEpsTrendError>> {
1465 let p_query_symbol = params.symbol;
1467 let p_query_figi = params.figi;
1468 let p_query_isin = params.isin;
1469 let p_query_cusip = params.cusip;
1470 let p_query_country = params.country;
1471 let p_query_exchange = params.exchange;
1472
1473 let uri_str = format!("{}/eps_trend", configuration.base_path);
1474 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1475
1476 if let Some(ref param_value) = p_query_symbol {
1477 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1478 }
1479 if let Some(ref param_value) = p_query_figi {
1480 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1481 }
1482 if let Some(ref param_value) = p_query_isin {
1483 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1484 }
1485 if let Some(ref param_value) = p_query_cusip {
1486 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1487 }
1488 if let Some(ref param_value) = p_query_country {
1489 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1490 }
1491 if let Some(ref param_value) = p_query_exchange {
1492 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1493 }
1494 if let Some(ref user_agent) = configuration.user_agent {
1495 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1496 }
1497 if let Some(ref apikey) = configuration.api_key {
1498 let key = apikey.key.clone();
1499 let value = match apikey.prefix {
1500 Some(ref prefix) => format!("{} {}", prefix, key),
1501 None => key,
1502 };
1503 req_builder = req_builder.header("Authorization", value);
1504 };
1505
1506 let req = req_builder.build()?;
1507 let resp = configuration.client.execute(req).await?;
1508
1509 let status = resp.status();
1510 let content_type = resp
1511 .headers()
1512 .get("content-type")
1513 .and_then(|v| v.to_str().ok())
1514 .unwrap_or("application/octet-stream");
1515 let content_type = super::ContentType::from(content_type);
1516
1517 if !status.is_client_error() && !status.is_server_error() {
1518 let content = resp.text().await?;
1519 match content_type {
1520 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1521 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEpsTrend200ResponseEnum`"))),
1522 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::GetEpsTrend200ResponseEnum`")))),
1523 }
1524 } else {
1525 let content = resp.text().await?;
1526 let entity: Option<GetEpsTrendError> = serde_json::from_str(&content).ok();
1527 Err(Error::ResponseError(ResponseContent {
1528 status,
1529 content,
1530 entity,
1531 }))
1532 }
1533}
1534
1535pub async fn get_growth_estimates(
1537 configuration: &configuration::Configuration,
1538 params: GetGrowthEstimatesParams,
1539) -> Result<models::GetGrowthEstimates200ResponseEnum, Error<GetGrowthEstimatesError>> {
1540 let p_query_symbol = params.symbol;
1542 let p_query_figi = params.figi;
1543 let p_query_isin = params.isin;
1544 let p_query_cusip = params.cusip;
1545 let p_query_country = params.country;
1546 let p_query_exchange = params.exchange;
1547
1548 let uri_str = format!("{}/growth_estimates", configuration.base_path);
1549 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1550
1551 if let Some(ref param_value) = p_query_symbol {
1552 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1553 }
1554 if let Some(ref param_value) = p_query_figi {
1555 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1556 }
1557 if let Some(ref param_value) = p_query_isin {
1558 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1559 }
1560 if let Some(ref param_value) = p_query_cusip {
1561 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1562 }
1563 if let Some(ref param_value) = p_query_country {
1564 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1565 }
1566 if let Some(ref param_value) = p_query_exchange {
1567 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1568 }
1569 if let Some(ref user_agent) = configuration.user_agent {
1570 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1571 }
1572 if let Some(ref apikey) = configuration.api_key {
1573 let key = apikey.key.clone();
1574 let value = match apikey.prefix {
1575 Some(ref prefix) => format!("{} {}", prefix, key),
1576 None => key,
1577 };
1578 req_builder = req_builder.header("Authorization", value);
1579 };
1580
1581 let req = req_builder.build()?;
1582 let resp = configuration.client.execute(req).await?;
1583
1584 let status = resp.status();
1585 let content_type = resp
1586 .headers()
1587 .get("content-type")
1588 .and_then(|v| v.to_str().ok())
1589 .unwrap_or("application/octet-stream");
1590 let content_type = super::ContentType::from(content_type);
1591
1592 if !status.is_client_error() && !status.is_server_error() {
1593 let content = resp.text().await?;
1594 match content_type {
1595 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1596 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetGrowthEstimates200ResponseEnum`"))),
1597 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::GetGrowthEstimates200ResponseEnum`")))),
1598 }
1599 } else {
1600 let content = resp.text().await?;
1601 let entity: Option<GetGrowthEstimatesError> = serde_json::from_str(&content).ok();
1602 Err(Error::ResponseError(ResponseContent {
1603 status,
1604 content,
1605 entity,
1606 }))
1607 }
1608}
1609
1610pub async fn get_price_target(
1612 configuration: &configuration::Configuration,
1613 params: GetPriceTargetParams,
1614) -> Result<models::GetPriceTarget200ResponseEnum, Error<GetPriceTargetError>> {
1615 let p_query_symbol = params.symbol;
1617 let p_query_figi = params.figi;
1618 let p_query_isin = params.isin;
1619 let p_query_cusip = params.cusip;
1620 let p_query_country = params.country;
1621 let p_query_exchange = params.exchange;
1622
1623 let uri_str = format!("{}/price_target", configuration.base_path);
1624 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1625
1626 if let Some(ref param_value) = p_query_symbol {
1627 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1628 }
1629 if let Some(ref param_value) = p_query_figi {
1630 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1631 }
1632 if let Some(ref param_value) = p_query_isin {
1633 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1634 }
1635 if let Some(ref param_value) = p_query_cusip {
1636 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1637 }
1638 if let Some(ref param_value) = p_query_country {
1639 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1640 }
1641 if let Some(ref param_value) = p_query_exchange {
1642 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1643 }
1644 if let Some(ref user_agent) = configuration.user_agent {
1645 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1646 }
1647 if let Some(ref apikey) = configuration.api_key {
1648 let key = apikey.key.clone();
1649 let value = match apikey.prefix {
1650 Some(ref prefix) => format!("{} {}", prefix, key),
1651 None => key,
1652 };
1653 req_builder = req_builder.header("Authorization", value);
1654 };
1655
1656 let req = req_builder.build()?;
1657 let resp = configuration.client.execute(req).await?;
1658
1659 let status = resp.status();
1660 let content_type = resp
1661 .headers()
1662 .get("content-type")
1663 .and_then(|v| v.to_str().ok())
1664 .unwrap_or("application/octet-stream");
1665 let content_type = super::ContentType::from(content_type);
1666
1667 if !status.is_client_error() && !status.is_server_error() {
1668 let content = resp.text().await?;
1669 match content_type {
1670 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1671 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetPriceTarget200ResponseEnum`"))),
1672 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::GetPriceTarget200ResponseEnum`")))),
1673 }
1674 } else {
1675 let content = resp.text().await?;
1676 let entity: Option<GetPriceTargetError> = serde_json::from_str(&content).ok();
1677 Err(Error::ResponseError(ResponseContent {
1678 status,
1679 content,
1680 entity,
1681 }))
1682 }
1683}
1684
1685pub async fn get_recommendations(
1687 configuration: &configuration::Configuration,
1688 params: GetRecommendationsParams,
1689) -> Result<models::GetRecommendations200ResponseEnum, Error<GetRecommendationsError>> {
1690 let p_query_symbol = params.symbol;
1692 let p_query_figi = params.figi;
1693 let p_query_isin = params.isin;
1694 let p_query_cusip = params.cusip;
1695 let p_query_country = params.country;
1696 let p_query_exchange = params.exchange;
1697
1698 let uri_str = format!("{}/recommendations", configuration.base_path);
1699 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1700
1701 if let Some(ref param_value) = p_query_symbol {
1702 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1703 }
1704 if let Some(ref param_value) = p_query_figi {
1705 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1706 }
1707 if let Some(ref param_value) = p_query_isin {
1708 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1709 }
1710 if let Some(ref param_value) = p_query_cusip {
1711 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1712 }
1713 if let Some(ref param_value) = p_query_country {
1714 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1715 }
1716 if let Some(ref param_value) = p_query_exchange {
1717 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1718 }
1719 if let Some(ref user_agent) = configuration.user_agent {
1720 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1721 }
1722 if let Some(ref apikey) = configuration.api_key {
1723 let key = apikey.key.clone();
1724 let value = match apikey.prefix {
1725 Some(ref prefix) => format!("{} {}", prefix, key),
1726 None => key,
1727 };
1728 req_builder = req_builder.header("Authorization", value);
1729 };
1730
1731 let req = req_builder.build()?;
1732 let resp = configuration.client.execute(req).await?;
1733
1734 let status = resp.status();
1735 let content_type = resp
1736 .headers()
1737 .get("content-type")
1738 .and_then(|v| v.to_str().ok())
1739 .unwrap_or("application/octet-stream");
1740 let content_type = super::ContentType::from(content_type);
1741
1742 if !status.is_client_error() && !status.is_server_error() {
1743 let content = resp.text().await?;
1744 match content_type {
1745 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1746 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetRecommendations200ResponseEnum`"))),
1747 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::GetRecommendations200ResponseEnum`")))),
1748 }
1749 } else {
1750 let content = resp.text().await?;
1751 let entity: Option<GetRecommendationsError> = serde_json::from_str(&content).ok();
1752 Err(Error::ResponseError(ResponseContent {
1753 status,
1754 content,
1755 entity,
1756 }))
1757 }
1758}
1759
1760pub async fn get_revenue_estimate(
1762 configuration: &configuration::Configuration,
1763 params: GetRevenueEstimateParams,
1764) -> Result<models::GetRevenueEstimate200ResponseEnum, Error<GetRevenueEstimateError>> {
1765 let p_query_symbol = params.symbol;
1767 let p_query_figi = params.figi;
1768 let p_query_isin = params.isin;
1769 let p_query_cusip = params.cusip;
1770 let p_query_country = params.country;
1771 let p_query_exchange = params.exchange;
1772 let p_query_dp = params.dp;
1773
1774 let uri_str = format!("{}/revenue_estimate", configuration.base_path);
1775 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1776
1777 if let Some(ref param_value) = p_query_symbol {
1778 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1779 }
1780 if let Some(ref param_value) = p_query_figi {
1781 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1782 }
1783 if let Some(ref param_value) = p_query_isin {
1784 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1785 }
1786 if let Some(ref param_value) = p_query_cusip {
1787 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1788 }
1789 if let Some(ref param_value) = p_query_country {
1790 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1791 }
1792 if let Some(ref param_value) = p_query_exchange {
1793 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1794 }
1795 if let Some(ref param_value) = p_query_dp {
1796 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1797 }
1798 if let Some(ref user_agent) = configuration.user_agent {
1799 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1800 }
1801 if let Some(ref apikey) = configuration.api_key {
1802 let key = apikey.key.clone();
1803 let value = match apikey.prefix {
1804 Some(ref prefix) => format!("{} {}", prefix, key),
1805 None => key,
1806 };
1807 req_builder = req_builder.header("Authorization", value);
1808 };
1809
1810 let req = req_builder.build()?;
1811 let resp = configuration.client.execute(req).await?;
1812
1813 let status = resp.status();
1814 let content_type = resp
1815 .headers()
1816 .get("content-type")
1817 .and_then(|v| v.to_str().ok())
1818 .unwrap_or("application/octet-stream");
1819 let content_type = super::ContentType::from(content_type);
1820
1821 if !status.is_client_error() && !status.is_server_error() {
1822 let content = resp.text().await?;
1823 match content_type {
1824 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1825 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetRevenueEstimate200ResponseEnum`"))),
1826 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::GetRevenueEstimate200ResponseEnum`")))),
1827 }
1828 } else {
1829 let content = resp.text().await?;
1830 let entity: Option<GetRevenueEstimateError> = serde_json::from_str(&content).ok();
1831 Err(Error::ResponseError(ResponseContent {
1832 status,
1833 content,
1834 entity,
1835 }))
1836 }
1837}