@@ -6,7 +6,9 @@ use crate::codegen::PARAM_RE;
6
6
use crate :: Result ;
7
7
use crate :: { codegen:: parse_path_params, identifier:: SnakeCaseIdent } ;
8
8
9
- use super :: { new_request_code:: NewRequestCode , response_code:: ResponseCode , set_request_code:: SetRequestCode } ;
9
+ use super :: {
10
+ new_request_code:: NewRequestCode , response_code:: ResponseCode , set_request_code:: SetRequestCode ,
11
+ } ;
10
12
/// The `send` function of the request builder.
11
13
pub struct RequestBuilderSendCode {
12
14
new_request_code : NewRequestCode ,
@@ -16,7 +18,11 @@ pub struct RequestBuilderSendCode {
16
18
}
17
19
18
20
impl RequestBuilderSendCode {
19
- pub fn new ( new_request_code : NewRequestCode , request_builder : SetRequestCode , response_code : ResponseCode ) -> Result < Self > {
21
+ pub fn new (
22
+ new_request_code : NewRequestCode ,
23
+ request_builder : SetRequestCode ,
24
+ response_code : ResponseCode ,
25
+ ) -> Result < Self > {
20
26
let params = parse_path_params ( & new_request_code. path ) ;
21
27
let url_args: Result < Vec < _ > > = params. iter ( ) . map ( |s| s. to_snake_case_ident ( ) ) . collect ( ) ;
22
28
let url_args = url_args?;
@@ -121,12 +127,17 @@ impl ToTokens for RequestBuilderSendCode {
121
127
req. insert_header( azure_core:: headers:: VERSION , #api_version) ;
122
128
} ) ;
123
129
}
124
- let response_type = self . response_code . response_type ( ) . expect ( "pageable response has a body" ) ;
130
+ let response_type = self
131
+ . response_code
132
+ . response_type ( )
133
+ . expect ( "pageable response has a body" ) ;
125
134
126
135
// some of the pageable requests specify the continuation token
127
136
// as a parameter. In this case, use the basic request builder,
128
137
// but insert the continuation parameter
129
- if let Some ( continuable_param) = get_continuable_param ( next_link_name, request_builder) {
138
+ if let Some ( continuable_param) =
139
+ get_continuable_param ( next_link_name, request_builder)
140
+ {
130
141
quote ! {
131
142
pub fn into_stream( self ) -> azure_core:: Pageable <#response_type, azure_core:: error:: Error > {
132
143
let make_request = move |continuation: Option <String >| {
@@ -144,7 +155,7 @@ impl ToTokens for RequestBuilderSendCode {
144
155
match rsp. status( ) {
145
156
#match_status
146
157
} ;
147
- rsp?. into_body ( ) . await
158
+ rsp?. into_raw_body ( ) . await
148
159
}
149
160
} ;
150
161
0 commit comments