@@ -22,6 +22,21 @@ use std::collections::HashMap;
2222
2323use super :: types:: * ;
2424
25+ use crate :: types:: generated:: generated:: {
26+ create_new_locates_response:: CreateNewLocatesResponse as GeneratedCreateNewLocatesResponse ,
27+ get_buying_power_response:: GetBuyingPowerResponse as GeneratedGetBuyingPowerResponse ,
28+ get_existing_locates_response:: GetExistingLocatesResponse as GeneratedGetExistingLocatesResponse ,
29+ get_interest_accruals_response:: GetInterestAccrualsResponse as GeneratedGetInterestAccrualsResponse ,
30+ get_locate_availabilities_response:: GetLocateAvailabilitiesResponse as GeneratedGetLocateAvailabilitiesResponse ,
31+ get_margin_conversions_response:: GetMarginConversionsResponse as GeneratedGetMarginConversionsResponse ,
32+ get_margin_information_response:: GetMarginInformationResponse as GeneratedGetMarginInformationResponse ,
33+ get_margin_summaries_response:: GetMarginSummariesResponse as GeneratedGetMarginSummariesResponse ,
34+ get_portfolio_interest_accruals_response:: GetPortfolioInterestAccrualsResponse as GeneratedGetPortfolioInterestAccrualsResponse ,
35+ get_post_trade_credit_response:: GetPostTradeCreditResponse as GeneratedGetPostTradeCreditResponse ,
36+ get_tf_tiered_pricing_fees_response:: GetTfTieredPricingFeesResponse as GeneratedGetTfTieredPricingFeesResponse ,
37+ get_withdrawal_power_response:: GetWithdrawalPowerResponse as GeneratedGetWithdrawalPowerResponse ,
38+ } ;
39+
2540/// Service for interacting with financing-related endpoints
2641pub struct FinancingService {
2742 client : Box < dyn HttpClient > ,
@@ -57,7 +72,7 @@ impl FinancingService {
5772 req = req. with_query_params ( query_params) ;
5873 }
5974 let resp = self . client . execute ( req) . await ?;
60- let response: crate :: types :: generated :: generated :: get_interest_accruals_response :: GetInterestAccrualsResponse = resp. json ( ) . await ?;
75+ let response: GeneratedGetInterestAccrualsResponse = resp. json ( ) . await ?;
6176 Ok ( response. into ( ) )
6277 }
6378
@@ -80,7 +95,7 @@ impl FinancingService {
8095 req = req. with_query_params ( query_params) ;
8196 }
8297 let resp = self . client . execute ( req) . await ?;
83- let response: crate :: types :: generated :: generated :: get_portfolio_interest_accruals_response :: GetPortfolioInterestAccrualsResponse = resp. json ( ) . await ?;
98+ let response: GeneratedGetPortfolioInterestAccrualsResponse = resp. json ( ) . await ?;
8499 Ok ( response. into ( ) )
85100 }
86101
@@ -103,7 +118,7 @@ impl FinancingService {
103118 req = req. with_query_params ( query_params) ;
104119 }
105120 let resp = self . client . execute ( req) . await ?;
106- let response: crate :: types :: generated :: generated :: get_margin_summaries_response :: GetMarginSummariesResponse = resp. json ( ) . await ?;
121+ let response: GeneratedGetMarginSummariesResponse = resp. json ( ) . await ?;
107122 Ok ( response. into ( ) )
108123 }
109124
@@ -126,7 +141,7 @@ impl FinancingService {
126141 req = req. with_query_params ( query_params) ;
127142 }
128143 let resp = self . client . execute ( req) . await ?;
129- let response: crate :: types :: generated :: generated :: get_locate_availabilities_response :: GetLocateAvailabilitiesResponse = resp. json ( ) . await ?;
144+ let response: GeneratedGetLocateAvailabilitiesResponse = resp. json ( ) . await ?;
130145 Ok ( response. into ( ) )
131146 }
132147
@@ -146,7 +161,7 @@ impl FinancingService {
146161 req = req. with_query_params ( query_params) ;
147162 }
148163 let resp = self . client . execute ( req) . await ?;
149- let response: crate :: types :: generated :: generated :: get_tf_tiered_pricing_fees_response :: GetTfTieredPricingFeesResponse = resp. json ( ) . await ?;
164+ let response: GeneratedGetTfTieredPricingFeesResponse = resp. json ( ) . await ?;
150165 Ok ( response. into ( ) )
151166 }
152167
@@ -159,7 +174,7 @@ impl FinancingService {
159174 let req = HttpRequest :: new ( HttpMethod :: Get , & path)
160175 . map_err ( |e| crate :: error:: HttpError :: Custom ( e. to_string ( ) ) ) ?;
161176 let resp = self . client . execute ( req) . await ?;
162- let response: crate :: types :: generated :: generated :: get_margin_information_response :: GetMarginInformationResponse = resp. json ( ) . await ?;
177+ let response: GeneratedGetMarginInformationResponse = resp. json ( ) . await ?;
163178 Ok ( response. into ( ) )
164179 }
165180
@@ -176,7 +191,7 @@ impl FinancingService {
176191 query_params. insert ( "quote_currency" . to_string ( ) , request. quote_currency . clone ( ) ) ;
177192 req = req. with_query_params ( query_params) ;
178193 let resp = self . client . execute ( req) . await ?;
179- let response: crate :: types :: generated :: generated :: get_buying_power_response :: GetBuyingPowerResponse = resp. json ( ) . await ?;
194+ let response: GeneratedGetBuyingPowerResponse = resp. json ( ) . await ?;
180195 Ok ( response. into ( ) )
181196 }
182197
@@ -189,7 +204,7 @@ impl FinancingService {
189204 let req = HttpRequest :: new ( HttpMethod :: Get , & path)
190205 . map_err ( |e| crate :: error:: HttpError :: Custom ( e. to_string ( ) ) ) ?;
191206 let resp = self . client . execute ( req) . await ?;
192- let response: crate :: types :: generated :: generated :: get_post_trade_credit_response :: GetPostTradeCreditResponse = resp. json ( ) . await ?;
207+ let response: GeneratedGetPostTradeCreditResponse = resp. json ( ) . await ?;
193208 Ok ( response. into ( ) )
194209 }
195210
@@ -205,7 +220,7 @@ impl FinancingService {
205220 query_params. insert ( "symbol" . to_string ( ) , request. symbol . clone ( ) ) ;
206221 req = req. with_query_params ( query_params) ;
207222 let resp = self . client . execute ( req) . await ?;
208- let response: crate :: types :: generated :: generated :: get_withdrawal_power_response :: GetWithdrawalPowerResponse = resp. json ( ) . await ?;
223+ let response: GeneratedGetWithdrawalPowerResponse = resp. json ( ) . await ?;
209224 Ok ( response. into ( ) )
210225 }
211226
@@ -230,7 +245,7 @@ impl FinancingService {
230245 req = req. with_query_params ( query_params) ;
231246 }
232247 let resp = self . client . execute ( req) . await ?;
233- let response: crate :: types :: generated :: generated :: get_existing_locates_response :: GetExistingLocatesResponse = resp. json ( ) . await ?;
248+ let response: GeneratedGetExistingLocatesResponse = resp. json ( ) . await ?;
234249 Ok ( response. into ( ) )
235250 }
236251
@@ -253,7 +268,7 @@ impl FinancingService {
253268 req = req. with_query_params ( query_params) ;
254269 }
255270 let resp = self . client . execute ( req) . await ?;
256- let response: crate :: types :: generated :: generated :: get_margin_conversions_response :: GetMarginConversionsResponse = resp. json ( ) . await ?;
271+ let response: GeneratedGetMarginConversionsResponse = resp. json ( ) . await ?;
257272 Ok ( response. into ( ) )
258273 }
259274
@@ -270,7 +285,7 @@ impl FinancingService {
270285 . map_err ( |e| crate :: error:: HttpError :: Custom ( e. to_string ( ) ) ) ?
271286 . with_json_body ( json_body) ;
272287 let resp = self . client . execute ( req) . await ?;
273- let response: crate :: types :: generated :: generated :: create_new_locates_response :: CreateNewLocatesResponse = resp. json ( ) . await ?;
288+ let response: GeneratedCreateNewLocatesResponse = resp. json ( ) . await ?;
274289 Ok ( response. into ( ) )
275290 }
276291}
0 commit comments