@@ -5,6 +5,7 @@ import type {
5
5
PrimitiveTypesForDeserialization ,
6
6
PrimitiveTypesForDeserializationType ,
7
7
RequestAdapter ,
8
+ SendMethods ,
8
9
} from "./requestAdapter" ;
9
10
import type { RequestConfiguration } from "./requestConfiguration" ;
10
11
import {
@@ -125,53 +126,53 @@ function getRequestConfigurationValue(args: any[]) {
125
126
}
126
127
return undefined ;
127
128
}
128
- function sendAsync (
129
+ function send (
129
130
requestAdapter : RequestAdapter ,
130
131
requestInfo : RequestInformation ,
131
132
metadata : RequestMetadata ,
132
133
) {
133
134
switch ( metadata . adapterMethodName ) {
134
- case "sendAsync " :
135
+ case "send " :
135
136
if ( ! metadata . responseBodyFactory ) {
136
137
throw new Error ( "couldn't find response body factory" ) ;
137
138
}
138
- return requestAdapter . sendAsync (
139
+ return requestAdapter . send (
139
140
requestInfo ,
140
141
metadata . responseBodyFactory as ParsableFactory < Parsable > ,
141
142
metadata . errorMappings ,
142
143
) ;
143
- case "sendCollectionAsync " :
144
+ case "sendCollection " :
144
145
if ( ! metadata . responseBodyFactory ) {
145
146
throw new Error ( "couldn't find response body factory" ) ;
146
147
}
147
- return requestAdapter . sendCollectionAsync (
148
+ return requestAdapter . sendCollection (
148
149
requestInfo ,
149
150
metadata . responseBodyFactory as ParsableFactory < Parsable > ,
150
151
metadata . errorMappings ,
151
152
) ;
152
- case "sendCollectionOfPrimitiveAsync " :
153
+ case "sendCollectionOfPrimitive " :
153
154
if ( ! metadata . responseBodyFactory ) {
154
155
throw new Error ( "couldn't find response body factory" ) ;
155
156
}
156
- return requestAdapter . sendCollectionOfPrimitiveAsync (
157
+ return requestAdapter . sendCollectionOfPrimitive (
157
158
requestInfo ,
158
159
metadata . responseBodyFactory as Exclude <
159
160
PrimitiveTypesForDeserialization ,
160
161
"ArrayBuffer"
161
162
> ,
162
163
metadata . errorMappings ,
163
164
) ;
164
- case "sendPrimitiveAsync " :
165
+ case "sendPrimitive " :
165
166
if ( ! metadata . responseBodyFactory ) {
166
167
throw new Error ( "couldn't find response body factory" ) ;
167
168
}
168
- return requestAdapter . sendPrimitiveAsync (
169
+ return requestAdapter . sendPrimitive (
169
170
requestInfo ,
170
171
metadata . responseBodyFactory as PrimitiveTypesForDeserialization ,
171
172
metadata . errorMappings ,
172
173
) ;
173
- case "sendNoResponseContentAsync " :
174
- return requestAdapter . sendNoResponseContentAsync (
174
+ case "sendNoResponseContent " :
175
+ return requestAdapter . sendNoResponseContent (
175
176
requestInfo ,
176
177
metadata . errorMappings ,
177
178
) ;
@@ -223,7 +224,7 @@ export function apiClientProxifier<T extends object>(
223
224
undefined ,
224
225
requestConfiguration ,
225
226
) ;
226
- return sendAsync ( requestAdapter , requestInfo , metadata ) ;
227
+ return send ( requestAdapter , requestInfo , metadata ) ;
227
228
} ;
228
229
case "patch" :
229
230
return ( ...args : any [ ] ) => {
@@ -237,7 +238,7 @@ export function apiClientProxifier<T extends object>(
237
238
getRequestMediaTypeUserDefinedValue ( metadata , args ) ,
238
239
getRequestConfigurationValue ( args ) ,
239
240
) ;
240
- return sendAsync ( requestAdapter , requestInfo , metadata ) ;
241
+ return send ( requestAdapter , requestInfo , metadata ) ;
241
242
} ;
242
243
case "put" :
243
244
return ( ...args : any [ ] ) => {
@@ -251,7 +252,7 @@ export function apiClientProxifier<T extends object>(
251
252
getRequestMediaTypeUserDefinedValue ( metadata , args ) ,
252
253
getRequestConfigurationValue ( args ) ,
253
254
) ;
254
- return sendAsync ( requestAdapter , requestInfo , metadata ) ;
255
+ return send ( requestAdapter , requestInfo , metadata ) ;
255
256
} ;
256
257
case "delete" :
257
258
return ( ...args : any [ ] ) => {
@@ -265,7 +266,7 @@ export function apiClientProxifier<T extends object>(
265
266
getRequestMediaTypeUserDefinedValue ( metadata , args ) ,
266
267
getRequestConfigurationValue ( args ) ,
267
268
) ;
268
- return sendAsync ( requestAdapter , requestInfo , metadata ) ;
269
+ return send ( requestAdapter , requestInfo , metadata ) ;
269
270
} ;
270
271
case "post" :
271
272
return ( ...args : any [ ] ) => {
@@ -279,7 +280,7 @@ export function apiClientProxifier<T extends object>(
279
280
getRequestMediaTypeUserDefinedValue ( metadata , args ) ,
280
281
getRequestConfigurationValue ( args ) ,
281
282
) ;
282
- return sendAsync ( requestAdapter , requestInfo , metadata ) ;
283
+ return send ( requestAdapter , requestInfo , metadata ) ;
283
284
} ;
284
285
case "toGetRequestInformation" :
285
286
return (
@@ -405,7 +406,7 @@ export interface RequestMetadata {
405
406
requestBodyContentType ?: string ;
406
407
responseBodyContentType ?: string ;
407
408
errorMappings ?: ErrorMappings ;
408
- adapterMethodName ?: keyof RequestAdapter ;
409
+ adapterMethodName ?: SendMethods ;
409
410
responseBodyFactory ?:
410
411
| ParsableFactory < Parsable >
411
412
| PrimitiveTypesForDeserialization ;
0 commit comments