@@ -60,17 +60,17 @@ export class FetchRequestAdapter implements RequestAdapter {
60
60
return responseHandlerOption ?. responseHandler ;
61
61
} ;
62
62
private static readonly responseTypeAttributeKey = "com.microsoft.kiota.response.type" ;
63
- public sendCollectionOfPrimitiveAsync = < ResponseType extends Exclude < PrimitiveTypesForDeserializationType , ArrayBuffer > > ( requestInfo : RequestInformation , responseType : Exclude < PrimitiveTypesForDeserialization , "ArrayBuffer" > , errorMappings : ErrorMappings | undefined ) : Promise < ResponseType [ ] | undefined > => {
63
+ public sendCollectionOfPrimitive = < ResponseType extends Exclude < PrimitiveTypesForDeserializationType , ArrayBuffer > > ( requestInfo : RequestInformation , responseType : Exclude < PrimitiveTypesForDeserialization , "ArrayBuffer" > , errorMappings : ErrorMappings | undefined ) : Promise < ResponseType [ ] | undefined > => {
64
64
if ( ! requestInfo ) {
65
65
throw new Error ( "requestInfo cannot be null" ) ;
66
66
}
67
- return this . startTracingSpan ( requestInfo , "sendCollectionOfPrimitiveAsync " , async ( span ) => {
67
+ return this . startTracingSpan ( requestInfo , "sendCollectionOfPrimitive " , async ( span ) => {
68
68
try {
69
69
const response = await this . getHttpResponseMessage ( requestInfo , span ) ;
70
70
const responseHandler = this . getResponseHandler ( requestInfo ) ;
71
71
if ( responseHandler ) {
72
72
span . addEvent ( FetchRequestAdapter . eventResponseHandlerInvokedKey ) ;
73
- return await responseHandler . handleResponseAsync ( response , errorMappings ) ;
73
+ return await responseHandler . handleResponse ( response , errorMappings ) ;
74
74
} else {
75
75
try {
76
76
await this . throwIfFailedResponse ( response , errorMappings , span ) ;
@@ -116,17 +116,17 @@ export class FetchRequestAdapter implements RequestAdapter {
116
116
}
117
117
} ) ;
118
118
} ;
119
- public sendCollectionAsync = < ModelType extends Parsable > ( requestInfo : RequestInformation , deserialization : ParsableFactory < ModelType > , errorMappings : ErrorMappings | undefined ) : Promise < ModelType [ ] | undefined > => {
119
+ public sendCollection = < ModelType extends Parsable > ( requestInfo : RequestInformation , deserialization : ParsableFactory < ModelType > , errorMappings : ErrorMappings | undefined ) : Promise < ModelType [ ] | undefined > => {
120
120
if ( ! requestInfo ) {
121
121
throw new Error ( "requestInfo cannot be null" ) ;
122
122
}
123
- return this . startTracingSpan ( requestInfo , "sendCollectionAsync " , async ( span ) => {
123
+ return this . startTracingSpan ( requestInfo , "sendCollection " , async ( span ) => {
124
124
try {
125
125
const response = await this . getHttpResponseMessage ( requestInfo , span ) ;
126
126
const responseHandler = this . getResponseHandler ( requestInfo ) ;
127
127
if ( responseHandler ) {
128
128
span . addEvent ( FetchRequestAdapter . eventResponseHandlerInvokedKey ) ;
129
- return await responseHandler . handleResponseAsync ( response , errorMappings ) ;
129
+ return await responseHandler . handleResponse ( response , errorMappings ) ;
130
130
} else {
131
131
try {
132
132
await this . throwIfFailedResponse ( response , errorMappings , span ) ;
@@ -163,17 +163,17 @@ export class FetchRequestAdapter implements RequestAdapter {
163
163
} ) ;
164
164
} ;
165
165
public static readonly eventResponseHandlerInvokedKey = "com.microsoft.kiota.response_handler_invoked" ;
166
- public sendAsync = < ModelType extends Parsable > ( requestInfo : RequestInformation , deserializer : ParsableFactory < ModelType > , errorMappings : ErrorMappings | undefined ) : Promise < ModelType | undefined > => {
166
+ public send = < ModelType extends Parsable > ( requestInfo : RequestInformation , deserializer : ParsableFactory < ModelType > , errorMappings : ErrorMappings | undefined ) : Promise < ModelType | undefined > => {
167
167
if ( ! requestInfo ) {
168
168
throw new Error ( "requestInfo cannot be null" ) ;
169
169
}
170
- return this . startTracingSpan ( requestInfo , "sendAsync " , async ( span ) => {
170
+ return this . startTracingSpan ( requestInfo , "send " , async ( span ) => {
171
171
try {
172
172
const response = await this . getHttpResponseMessage ( requestInfo , span ) ;
173
173
const responseHandler = this . getResponseHandler ( requestInfo ) ;
174
174
if ( responseHandler ) {
175
175
span . addEvent ( FetchRequestAdapter . eventResponseHandlerInvokedKey ) ;
176
- return await responseHandler . handleResponseAsync ( response , errorMappings ) ;
176
+ return await responseHandler . handleResponse ( response , errorMappings ) ;
177
177
} else {
178
178
try {
179
179
await this . throwIfFailedResponse ( response , errorMappings , span ) ;
@@ -197,17 +197,17 @@ export class FetchRequestAdapter implements RequestAdapter {
197
197
}
198
198
} ) as Promise < ModelType > ;
199
199
} ;
200
- public sendPrimitiveAsync = < ResponseType extends PrimitiveTypesForDeserializationType > ( requestInfo : RequestInformation , responseType : PrimitiveTypesForDeserialization , errorMappings : ErrorMappings | undefined ) : Promise < ResponseType | undefined > => {
200
+ public sendPrimitive = < ResponseType extends PrimitiveTypesForDeserializationType > ( requestInfo : RequestInformation , responseType : PrimitiveTypesForDeserialization , errorMappings : ErrorMappings | undefined ) : Promise < ResponseType | undefined > => {
201
201
if ( ! requestInfo ) {
202
202
throw new Error ( "requestInfo cannot be null" ) ;
203
203
}
204
- return this . startTracingSpan ( requestInfo , "sendPrimitiveAsync " , async ( span ) => {
204
+ return this . startTracingSpan ( requestInfo , "sendPrimitive " , async ( span ) => {
205
205
try {
206
206
const response = await this . getHttpResponseMessage ( requestInfo , span ) ;
207
207
const responseHandler = this . getResponseHandler ( requestInfo ) ;
208
208
if ( responseHandler ) {
209
209
span . addEvent ( FetchRequestAdapter . eventResponseHandlerInvokedKey ) ;
210
- return await responseHandler . handleResponseAsync ( response , errorMappings ) ;
210
+ return await responseHandler . handleResponse ( response , errorMappings ) ;
211
211
} else {
212
212
try {
213
213
await this . throwIfFailedResponse ( response , errorMappings , span ) ;
@@ -259,17 +259,17 @@ export class FetchRequestAdapter implements RequestAdapter {
259
259
}
260
260
} ) as Promise < ResponseType | undefined > ;
261
261
} ;
262
- public sendNoResponseContentAsync = ( requestInfo : RequestInformation , errorMappings : ErrorMappings | undefined ) : Promise < void > => {
262
+ public sendNoResponseContent = ( requestInfo : RequestInformation , errorMappings : ErrorMappings | undefined ) : Promise < void > => {
263
263
if ( ! requestInfo ) {
264
264
throw new Error ( "requestInfo cannot be null" ) ;
265
265
}
266
- return this . startTracingSpan ( requestInfo , "sendNoResponseContentAsync " , async ( span ) => {
266
+ return this . startTracingSpan ( requestInfo , "sendNoResponseContent " , async ( span ) => {
267
267
try {
268
268
const response = await this . getHttpResponseMessage ( requestInfo , span ) ;
269
269
const responseHandler = this . getResponseHandler ( requestInfo ) ;
270
270
if ( responseHandler ) {
271
271
span . addEvent ( FetchRequestAdapter . eventResponseHandlerInvokedKey ) ;
272
- return await responseHandler . handleResponseAsync ( response , errorMappings ) ;
272
+ return await responseHandler . handleResponse ( response , errorMappings ) ;
273
273
}
274
274
try {
275
275
await this . throwIfFailedResponse ( response , errorMappings , span ) ;
@@ -482,13 +482,13 @@ export class FetchRequestAdapter implements RequestAdapter {
482
482
/**
483
483
* @inheritdoc
484
484
*/
485
- public convertToNativeRequestAsync = async < T > ( requestInfo : RequestInformation ) : Promise < T > => {
485
+ public convertToNativeRequest = async < T > ( requestInfo : RequestInformation ) : Promise < T > => {
486
486
if ( ! requestInfo ) {
487
487
throw new Error ( "requestInfo cannot be null" ) ;
488
488
}
489
489
await this . authenticationProvider . authenticateRequest ( requestInfo , undefined ) ;
490
490
491
- return this . startTracingSpan ( requestInfo , "convertToNativeRequestAsync " , async ( span ) => {
491
+ return this . startTracingSpan ( requestInfo , "convertToNativeRequest " , async ( span ) => {
492
492
const request = await this . getRequestFromRequestInformation ( requestInfo , span ) ;
493
493
return request as any as T ;
494
494
} ) ;
0 commit comments