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::GetAnalystRatingsLightResponse, 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::GetAnalystRatingsLightResponse`"))),
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::GetAnalystRatingsLightResponse`")))),
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<models::GetAnalystRatingsUsEquitiesResponse, Error<GetAnalystRatingsUsEquitiesError>> {
1134 let p_query_symbol = params.symbol;
1136 let p_query_figi = params.figi;
1137 let p_query_isin = params.isin;
1138 let p_query_cusip = params.cusip;
1139 let p_query_exchange = params.exchange;
1140 let p_query_rating_change = params.rating_change;
1141 let p_query_outputsize = params.outputsize;
1142
1143 let uri_str = format!("{}/analyst_ratings/us_equities", configuration.base_path);
1144 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1145
1146 if let Some(ref param_value) = p_query_symbol {
1147 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1148 }
1149 if let Some(ref param_value) = p_query_figi {
1150 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1151 }
1152 if let Some(ref param_value) = p_query_isin {
1153 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1154 }
1155 if let Some(ref param_value) = p_query_cusip {
1156 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1157 }
1158 if let Some(ref param_value) = p_query_exchange {
1159 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1160 }
1161 if let Some(ref param_value) = p_query_rating_change {
1162 req_builder = req_builder.query(&[("rating_change", ¶m_value.to_string())]);
1163 }
1164 if let Some(ref param_value) = p_query_outputsize {
1165 req_builder = req_builder.query(&[("outputsize", ¶m_value.to_string())]);
1166 }
1167 if let Some(ref user_agent) = configuration.user_agent {
1168 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1169 }
1170 if let Some(ref apikey) = configuration.api_key {
1171 let key = apikey.key.clone();
1172 let value = match apikey.prefix {
1173 Some(ref prefix) => format!("{} {}", prefix, key),
1174 None => key,
1175 };
1176 req_builder = req_builder.header("Authorization", value);
1177 };
1178
1179 let req = req_builder.build()?;
1180 let resp = configuration.client.execute(req).await?;
1181
1182 let status = resp.status();
1183 let content_type = resp
1184 .headers()
1185 .get("content-type")
1186 .and_then(|v| v.to_str().ok())
1187 .unwrap_or("application/octet-stream");
1188 let content_type = super::ContentType::from(content_type);
1189
1190 if !status.is_client_error() && !status.is_server_error() {
1191 let content = resp.text().await?;
1192 match content_type {
1193 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1194 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetAnalystRatingsUsEquitiesResponse`"))),
1195 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::GetAnalystRatingsUsEquitiesResponse`")))),
1196 }
1197 } else {
1198 let content = resp.text().await?;
1199 let entity: Option<GetAnalystRatingsUsEquitiesError> = serde_json::from_str(&content).ok();
1200 Err(Error::ResponseError(ResponseContent {
1201 status,
1202 content,
1203 entity,
1204 }))
1205 }
1206}
1207
1208pub async fn get_earnings_estimate(
1210 configuration: &configuration::Configuration,
1211 params: GetEarningsEstimateParams,
1212) -> Result<models::GetEarningsEstimateResponse, Error<GetEarningsEstimateError>> {
1213 let p_query_symbol = params.symbol;
1215 let p_query_figi = params.figi;
1216 let p_query_isin = params.isin;
1217 let p_query_cusip = params.cusip;
1218 let p_query_country = params.country;
1219 let p_query_exchange = params.exchange;
1220
1221 let uri_str = format!("{}/earnings_estimate", configuration.base_path);
1222 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1223
1224 if let Some(ref param_value) = p_query_symbol {
1225 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1226 }
1227 if let Some(ref param_value) = p_query_figi {
1228 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1229 }
1230 if let Some(ref param_value) = p_query_isin {
1231 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1232 }
1233 if let Some(ref param_value) = p_query_cusip {
1234 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1235 }
1236 if let Some(ref param_value) = p_query_country {
1237 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1238 }
1239 if let Some(ref param_value) = p_query_exchange {
1240 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1241 }
1242 if let Some(ref user_agent) = configuration.user_agent {
1243 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1244 }
1245 if let Some(ref apikey) = configuration.api_key {
1246 let key = apikey.key.clone();
1247 let value = match apikey.prefix {
1248 Some(ref prefix) => format!("{} {}", prefix, key),
1249 None => key,
1250 };
1251 req_builder = req_builder.header("Authorization", value);
1252 };
1253
1254 let req = req_builder.build()?;
1255 let resp = configuration.client.execute(req).await?;
1256
1257 let status = resp.status();
1258 let content_type = resp
1259 .headers()
1260 .get("content-type")
1261 .and_then(|v| v.to_str().ok())
1262 .unwrap_or("application/octet-stream");
1263 let content_type = super::ContentType::from(content_type);
1264
1265 if !status.is_client_error() && !status.is_server_error() {
1266 let content = resp.text().await?;
1267 match content_type {
1268 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1269 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEarningsEstimateResponse`"))),
1270 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::GetEarningsEstimateResponse`")))),
1271 }
1272 } else {
1273 let content = resp.text().await?;
1274 let entity: Option<GetEarningsEstimateError> = serde_json::from_str(&content).ok();
1275 Err(Error::ResponseError(ResponseContent {
1276 status,
1277 content,
1278 entity,
1279 }))
1280 }
1281}
1282
1283pub async fn get_edgar_filings_archive(
1285 configuration: &configuration::Configuration,
1286 params: GetEdgarFilingsArchiveParams,
1287) -> Result<models::GetEdgarFilingsArchiveResponse, Error<GetEdgarFilingsArchiveError>> {
1288 let p_query_symbol = params.symbol;
1290 let p_query_figi = params.figi;
1291 let p_query_isin = params.isin;
1292 let p_query_cusip = params.cusip;
1293 let p_query_exchange = params.exchange;
1294 let p_query_mic_code = params.mic_code;
1295 let p_query_country = params.country;
1296 let p_query_form_type = params.form_type;
1297 let p_query_filled_from = params.filled_from;
1298 let p_query_filled_to = params.filled_to;
1299 let p_query_page = params.page;
1300 let p_query_page_size = params.page_size;
1301
1302 let uri_str = format!("{}/edgar_filings/archive", configuration.base_path);
1303 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1304
1305 if let Some(ref param_value) = p_query_symbol {
1306 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1307 }
1308 if let Some(ref param_value) = p_query_figi {
1309 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1310 }
1311 if let Some(ref param_value) = p_query_isin {
1312 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1313 }
1314 if let Some(ref param_value) = p_query_cusip {
1315 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1316 }
1317 if let Some(ref param_value) = p_query_exchange {
1318 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1319 }
1320 if let Some(ref param_value) = p_query_mic_code {
1321 req_builder = req_builder.query(&[("mic_code", ¶m_value.to_string())]);
1322 }
1323 if let Some(ref param_value) = p_query_country {
1324 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1325 }
1326 if let Some(ref param_value) = p_query_form_type {
1327 req_builder = req_builder.query(&[("form_type", ¶m_value.to_string())]);
1328 }
1329 if let Some(ref param_value) = p_query_filled_from {
1330 req_builder = req_builder.query(&[("filled_from", ¶m_value.to_string())]);
1331 }
1332 if let Some(ref param_value) = p_query_filled_to {
1333 req_builder = req_builder.query(&[("filled_to", ¶m_value.to_string())]);
1334 }
1335 if let Some(ref param_value) = p_query_page {
1336 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1337 }
1338 if let Some(ref param_value) = p_query_page_size {
1339 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1340 }
1341 if let Some(ref user_agent) = configuration.user_agent {
1342 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1343 }
1344 if let Some(ref apikey) = configuration.api_key {
1345 let key = apikey.key.clone();
1346 let value = match apikey.prefix {
1347 Some(ref prefix) => format!("{} {}", prefix, key),
1348 None => key,
1349 };
1350 req_builder = req_builder.header("Authorization", value);
1351 };
1352
1353 let req = req_builder.build()?;
1354 let resp = configuration.client.execute(req).await?;
1355
1356 let status = resp.status();
1357 let content_type = resp
1358 .headers()
1359 .get("content-type")
1360 .and_then(|v| v.to_str().ok())
1361 .unwrap_or("application/octet-stream");
1362 let content_type = super::ContentType::from(content_type);
1363
1364 if !status.is_client_error() && !status.is_server_error() {
1365 let content = resp.text().await?;
1366 match content_type {
1367 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1368 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEdgarFilingsArchiveResponse`"))),
1369 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::GetEdgarFilingsArchiveResponse`")))),
1370 }
1371 } else {
1372 let content = resp.text().await?;
1373 let entity: Option<GetEdgarFilingsArchiveError> = serde_json::from_str(&content).ok();
1374 Err(Error::ResponseError(ResponseContent {
1375 status,
1376 content,
1377 entity,
1378 }))
1379 }
1380}
1381
1382pub async fn get_eps_revisions(
1384 configuration: &configuration::Configuration,
1385 params: GetEpsRevisionsParams,
1386) -> Result<models::GetEpsRevisionsResponse, Error<GetEpsRevisionsError>> {
1387 let p_query_symbol = params.symbol;
1389 let p_query_figi = params.figi;
1390 let p_query_isin = params.isin;
1391 let p_query_cusip = params.cusip;
1392 let p_query_country = params.country;
1393 let p_query_exchange = params.exchange;
1394
1395 let uri_str = format!("{}/eps_revisions", configuration.base_path);
1396 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1397
1398 if let Some(ref param_value) = p_query_symbol {
1399 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1400 }
1401 if let Some(ref param_value) = p_query_figi {
1402 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1403 }
1404 if let Some(ref param_value) = p_query_isin {
1405 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1406 }
1407 if let Some(ref param_value) = p_query_cusip {
1408 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1409 }
1410 if let Some(ref param_value) = p_query_country {
1411 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1412 }
1413 if let Some(ref param_value) = p_query_exchange {
1414 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1415 }
1416 if let Some(ref user_agent) = configuration.user_agent {
1417 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1418 }
1419 if let Some(ref apikey) = configuration.api_key {
1420 let key = apikey.key.clone();
1421 let value = match apikey.prefix {
1422 Some(ref prefix) => format!("{} {}", prefix, key),
1423 None => key,
1424 };
1425 req_builder = req_builder.header("Authorization", value);
1426 };
1427
1428 let req = req_builder.build()?;
1429 let resp = configuration.client.execute(req).await?;
1430
1431 let status = resp.status();
1432 let content_type = resp
1433 .headers()
1434 .get("content-type")
1435 .and_then(|v| v.to_str().ok())
1436 .unwrap_or("application/octet-stream");
1437 let content_type = super::ContentType::from(content_type);
1438
1439 if !status.is_client_error() && !status.is_server_error() {
1440 let content = resp.text().await?;
1441 match content_type {
1442 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1443 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEpsRevisionsResponse`"))),
1444 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::GetEpsRevisionsResponse`")))),
1445 }
1446 } else {
1447 let content = resp.text().await?;
1448 let entity: Option<GetEpsRevisionsError> = serde_json::from_str(&content).ok();
1449 Err(Error::ResponseError(ResponseContent {
1450 status,
1451 content,
1452 entity,
1453 }))
1454 }
1455}
1456
1457pub async fn get_eps_trend(
1459 configuration: &configuration::Configuration,
1460 params: GetEpsTrendParams,
1461) -> Result<models::GetEpsTrendResponse, Error<GetEpsTrendError>> {
1462 let p_query_symbol = params.symbol;
1464 let p_query_figi = params.figi;
1465 let p_query_isin = params.isin;
1466 let p_query_cusip = params.cusip;
1467 let p_query_country = params.country;
1468 let p_query_exchange = params.exchange;
1469
1470 let uri_str = format!("{}/eps_trend", configuration.base_path);
1471 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1472
1473 if let Some(ref param_value) = p_query_symbol {
1474 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1475 }
1476 if let Some(ref param_value) = p_query_figi {
1477 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1478 }
1479 if let Some(ref param_value) = p_query_isin {
1480 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1481 }
1482 if let Some(ref param_value) = p_query_cusip {
1483 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1484 }
1485 if let Some(ref param_value) = p_query_country {
1486 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1487 }
1488 if let Some(ref param_value) = p_query_exchange {
1489 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1490 }
1491 if let Some(ref user_agent) = configuration.user_agent {
1492 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1493 }
1494 if let Some(ref apikey) = configuration.api_key {
1495 let key = apikey.key.clone();
1496 let value = match apikey.prefix {
1497 Some(ref prefix) => format!("{} {}", prefix, key),
1498 None => key,
1499 };
1500 req_builder = req_builder.header("Authorization", value);
1501 };
1502
1503 let req = req_builder.build()?;
1504 let resp = configuration.client.execute(req).await?;
1505
1506 let status = resp.status();
1507 let content_type = resp
1508 .headers()
1509 .get("content-type")
1510 .and_then(|v| v.to_str().ok())
1511 .unwrap_or("application/octet-stream");
1512 let content_type = super::ContentType::from(content_type);
1513
1514 if !status.is_client_error() && !status.is_server_error() {
1515 let content = resp.text().await?;
1516 match content_type {
1517 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1518 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetEpsTrendResponse`"))),
1519 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::GetEpsTrendResponse`")))),
1520 }
1521 } else {
1522 let content = resp.text().await?;
1523 let entity: Option<GetEpsTrendError> = serde_json::from_str(&content).ok();
1524 Err(Error::ResponseError(ResponseContent {
1525 status,
1526 content,
1527 entity,
1528 }))
1529 }
1530}
1531
1532pub async fn get_growth_estimates(
1534 configuration: &configuration::Configuration,
1535 params: GetGrowthEstimatesParams,
1536) -> Result<models::GetGrowthEstimatesResponse, Error<GetGrowthEstimatesError>> {
1537 let p_query_symbol = params.symbol;
1539 let p_query_figi = params.figi;
1540 let p_query_isin = params.isin;
1541 let p_query_cusip = params.cusip;
1542 let p_query_country = params.country;
1543 let p_query_exchange = params.exchange;
1544
1545 let uri_str = format!("{}/growth_estimates", configuration.base_path);
1546 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1547
1548 if let Some(ref param_value) = p_query_symbol {
1549 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1550 }
1551 if let Some(ref param_value) = p_query_figi {
1552 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1553 }
1554 if let Some(ref param_value) = p_query_isin {
1555 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1556 }
1557 if let Some(ref param_value) = p_query_cusip {
1558 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1559 }
1560 if let Some(ref param_value) = p_query_country {
1561 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1562 }
1563 if let Some(ref param_value) = p_query_exchange {
1564 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1565 }
1566 if let Some(ref user_agent) = configuration.user_agent {
1567 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1568 }
1569 if let Some(ref apikey) = configuration.api_key {
1570 let key = apikey.key.clone();
1571 let value = match apikey.prefix {
1572 Some(ref prefix) => format!("{} {}", prefix, key),
1573 None => key,
1574 };
1575 req_builder = req_builder.header("Authorization", value);
1576 };
1577
1578 let req = req_builder.build()?;
1579 let resp = configuration.client.execute(req).await?;
1580
1581 let status = resp.status();
1582 let content_type = resp
1583 .headers()
1584 .get("content-type")
1585 .and_then(|v| v.to_str().ok())
1586 .unwrap_or("application/octet-stream");
1587 let content_type = super::ContentType::from(content_type);
1588
1589 if !status.is_client_error() && !status.is_server_error() {
1590 let content = resp.text().await?;
1591 match content_type {
1592 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1593 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetGrowthEstimatesResponse`"))),
1594 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::GetGrowthEstimatesResponse`")))),
1595 }
1596 } else {
1597 let content = resp.text().await?;
1598 let entity: Option<GetGrowthEstimatesError> = serde_json::from_str(&content).ok();
1599 Err(Error::ResponseError(ResponseContent {
1600 status,
1601 content,
1602 entity,
1603 }))
1604 }
1605}
1606
1607pub async fn get_price_target(
1609 configuration: &configuration::Configuration,
1610 params: GetPriceTargetParams,
1611) -> Result<models::GetPriceTargetResponse, Error<GetPriceTargetError>> {
1612 let p_query_symbol = params.symbol;
1614 let p_query_figi = params.figi;
1615 let p_query_isin = params.isin;
1616 let p_query_cusip = params.cusip;
1617 let p_query_country = params.country;
1618 let p_query_exchange = params.exchange;
1619
1620 let uri_str = format!("{}/price_target", configuration.base_path);
1621 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1622
1623 if let Some(ref param_value) = p_query_symbol {
1624 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1625 }
1626 if let Some(ref param_value) = p_query_figi {
1627 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1628 }
1629 if let Some(ref param_value) = p_query_isin {
1630 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1631 }
1632 if let Some(ref param_value) = p_query_cusip {
1633 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1634 }
1635 if let Some(ref param_value) = p_query_country {
1636 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1637 }
1638 if let Some(ref param_value) = p_query_exchange {
1639 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1640 }
1641 if let Some(ref user_agent) = configuration.user_agent {
1642 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1643 }
1644 if let Some(ref apikey) = configuration.api_key {
1645 let key = apikey.key.clone();
1646 let value = match apikey.prefix {
1647 Some(ref prefix) => format!("{} {}", prefix, key),
1648 None => key,
1649 };
1650 req_builder = req_builder.header("Authorization", value);
1651 };
1652
1653 let req = req_builder.build()?;
1654 let resp = configuration.client.execute(req).await?;
1655
1656 let status = resp.status();
1657 let content_type = resp
1658 .headers()
1659 .get("content-type")
1660 .and_then(|v| v.to_str().ok())
1661 .unwrap_or("application/octet-stream");
1662 let content_type = super::ContentType::from(content_type);
1663
1664 if !status.is_client_error() && !status.is_server_error() {
1665 let content = resp.text().await?;
1666 match content_type {
1667 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1668 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetPriceTargetResponse`"))),
1669 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::GetPriceTargetResponse`")))),
1670 }
1671 } else {
1672 let content = resp.text().await?;
1673 let entity: Option<GetPriceTargetError> = serde_json::from_str(&content).ok();
1674 Err(Error::ResponseError(ResponseContent {
1675 status,
1676 content,
1677 entity,
1678 }))
1679 }
1680}
1681
1682pub async fn get_recommendations(
1684 configuration: &configuration::Configuration,
1685 params: GetRecommendationsParams,
1686) -> Result<models::GetRecommendationsResponse, Error<GetRecommendationsError>> {
1687 let p_query_symbol = params.symbol;
1689 let p_query_figi = params.figi;
1690 let p_query_isin = params.isin;
1691 let p_query_cusip = params.cusip;
1692 let p_query_country = params.country;
1693 let p_query_exchange = params.exchange;
1694
1695 let uri_str = format!("{}/recommendations", configuration.base_path);
1696 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1697
1698 if let Some(ref param_value) = p_query_symbol {
1699 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1700 }
1701 if let Some(ref param_value) = p_query_figi {
1702 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1703 }
1704 if let Some(ref param_value) = p_query_isin {
1705 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1706 }
1707 if let Some(ref param_value) = p_query_cusip {
1708 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1709 }
1710 if let Some(ref param_value) = p_query_country {
1711 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1712 }
1713 if let Some(ref param_value) = p_query_exchange {
1714 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1715 }
1716 if let Some(ref user_agent) = configuration.user_agent {
1717 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1718 }
1719 if let Some(ref apikey) = configuration.api_key {
1720 let key = apikey.key.clone();
1721 let value = match apikey.prefix {
1722 Some(ref prefix) => format!("{} {}", prefix, key),
1723 None => key,
1724 };
1725 req_builder = req_builder.header("Authorization", value);
1726 };
1727
1728 let req = req_builder.build()?;
1729 let resp = configuration.client.execute(req).await?;
1730
1731 let status = resp.status();
1732 let content_type = resp
1733 .headers()
1734 .get("content-type")
1735 .and_then(|v| v.to_str().ok())
1736 .unwrap_or("application/octet-stream");
1737 let content_type = super::ContentType::from(content_type);
1738
1739 if !status.is_client_error() && !status.is_server_error() {
1740 let content = resp.text().await?;
1741 match content_type {
1742 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1743 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetRecommendationsResponse`"))),
1744 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::GetRecommendationsResponse`")))),
1745 }
1746 } else {
1747 let content = resp.text().await?;
1748 let entity: Option<GetRecommendationsError> = serde_json::from_str(&content).ok();
1749 Err(Error::ResponseError(ResponseContent {
1750 status,
1751 content,
1752 entity,
1753 }))
1754 }
1755}
1756
1757pub async fn get_revenue_estimate(
1759 configuration: &configuration::Configuration,
1760 params: GetRevenueEstimateParams,
1761) -> Result<models::GetRevenueEstimateResponse, Error<GetRevenueEstimateError>> {
1762 let p_query_symbol = params.symbol;
1764 let p_query_figi = params.figi;
1765 let p_query_isin = params.isin;
1766 let p_query_cusip = params.cusip;
1767 let p_query_country = params.country;
1768 let p_query_exchange = params.exchange;
1769 let p_query_dp = params.dp;
1770
1771 let uri_str = format!("{}/revenue_estimate", configuration.base_path);
1772 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1773
1774 if let Some(ref param_value) = p_query_symbol {
1775 req_builder = req_builder.query(&[("symbol", ¶m_value.to_string())]);
1776 }
1777 if let Some(ref param_value) = p_query_figi {
1778 req_builder = req_builder.query(&[("figi", ¶m_value.to_string())]);
1779 }
1780 if let Some(ref param_value) = p_query_isin {
1781 req_builder = req_builder.query(&[("isin", ¶m_value.to_string())]);
1782 }
1783 if let Some(ref param_value) = p_query_cusip {
1784 req_builder = req_builder.query(&[("cusip", ¶m_value.to_string())]);
1785 }
1786 if let Some(ref param_value) = p_query_country {
1787 req_builder = req_builder.query(&[("country", ¶m_value.to_string())]);
1788 }
1789 if let Some(ref param_value) = p_query_exchange {
1790 req_builder = req_builder.query(&[("exchange", ¶m_value.to_string())]);
1791 }
1792 if let Some(ref param_value) = p_query_dp {
1793 req_builder = req_builder.query(&[("dp", ¶m_value.to_string())]);
1794 }
1795 if let Some(ref user_agent) = configuration.user_agent {
1796 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1797 }
1798 if let Some(ref apikey) = configuration.api_key {
1799 let key = apikey.key.clone();
1800 let value = match apikey.prefix {
1801 Some(ref prefix) => format!("{} {}", prefix, key),
1802 None => key,
1803 };
1804 req_builder = req_builder.header("Authorization", value);
1805 };
1806
1807 let req = req_builder.build()?;
1808 let resp = configuration.client.execute(req).await?;
1809
1810 let status = resp.status();
1811 let content_type = resp
1812 .headers()
1813 .get("content-type")
1814 .and_then(|v| v.to_str().ok())
1815 .unwrap_or("application/octet-stream");
1816 let content_type = super::ContentType::from(content_type);
1817
1818 if !status.is_client_error() && !status.is_server_error() {
1819 let content = resp.text().await?;
1820 match content_type {
1821 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1822 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/*` content type response that cannot be converted to `models::GetRevenueEstimateResponse`"))),
1823 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::GetRevenueEstimateResponse`")))),
1824 }
1825 } else {
1826 let content = resp.text().await?;
1827 let entity: Option<GetRevenueEstimateError> = serde_json::from_str(&content).ok();
1828 Err(Error::ResponseError(ResponseContent {
1829 status,
1830 content,
1831 entity,
1832 }))
1833 }
1834}