forked from microsoftgraph/msgraph-sdk-typescript-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbaseGraphRequestAdapter.ts
33 lines (32 loc) · 1.83 KB
/
baseGraphRequestAdapter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { AuthenticationProvider, ParseNodeFactory, ParseNodeFactoryRegistry, SerializationWriterFactory, SerializationWriterFactoryRegistry } from "@microsoft/kiota-abstractions";
import { FetchRequestAdapter, HttpClient, type ObservabilityOptions, ObservabilityOptionsImpl } from "@microsoft/kiota-http-fetchlibrary";
import { GraphHttpClient } from "./graphHttpClient";
/**
* Base request adapter for graph clients. Bootstraps telemetry and other aspects.
*/
export class BaseGraphRequestAdapter extends FetchRequestAdapter {
/**
* Instantiates a new request adapter.
* @param graphServiceTargetVersion the target version of the api endpoint we are targeting ("" or beta).
* @param graphServiceLibraryClientVersion the version of the service library in use. Should be in the format `x.x.x` (Semantic version).
* @param authenticationProvider the authentication provider to use.
* @param parseNodeFactory the parse node factory to deserialize responses.
* @param serializationWriterFactory the serialization writer factory to use to serialize request bodies.
* @param httpClient the http client to use to execute requests.
* @param observabilityOptions the observability options to use.
*/
public constructor(
graphServiceTargetVersion: string,
graphServiceLibraryClientVersion: string,
authenticationProvider: AuthenticationProvider,
parseNodeFactory: ParseNodeFactory = ParseNodeFactoryRegistry.defaultInstance,
serializationWriterFactory: SerializationWriterFactory = SerializationWriterFactoryRegistry.defaultInstance,
httpClient: HttpClient = new GraphHttpClient({
graphServiceTargetVersion,
graphServiceLibraryClientVersion
}),
observabilityOptions: ObservabilityOptions = new ObservabilityOptionsImpl()
) {
super(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, observabilityOptions);
}
}