Skip to content

Commit 2191ba4

Browse files
committed
- reverts to a private variable and adds a getter method
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
1 parent 3cf0683 commit 2191ba4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

graph_request_adapter.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ import (
88
core "github.com/microsoftgraph/msgraph-sdk-go-core"
99
)
1010

11-
// ClientOptions is used by the telemetry handler.
12-
var ClientOptions = core.GraphClientOptions{
11+
var clientOptions = core.GraphClientOptions{
1312
GraphServiceVersion: "", //v1 doesn't include the service version in the telemetry header
1413
GraphServiceLibraryVersion: "0.2.0",
1514
}
1615

16+
// GetDefaultClientOptions returns the default client options used by the GraphRequestAdapterBase and the middleware.
17+
func GetDefaultClientOptions() core.GraphClientOptions {
18+
return clientOptions
19+
}
20+
1721
// GraphRequestAdapter is the core service used by GraphServiceClient to make requests to Microsoft Graph.
1822
type GraphRequestAdapter struct {
1923
core.GraphRequestAdapterBase
@@ -58,7 +62,7 @@ func NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactory(aut
5862
// Returns:
5963
// a new GraphRequestAdapter
6064
func NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider absauth.AuthenticationProvider, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory, httpClient *nethttp.Client) (*GraphRequestAdapter, error) {
61-
baseAdapter, err := core.NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider, ClientOptions, parseNodeFactory, serializationWriterFactory, httpClient)
65+
baseAdapter, err := core.NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider, clientOptions, parseNodeFactory, serializationWriterFactory, httpClient)
6266
if err != nil {
6367
return nil, err
6468
}
@@ -68,5 +72,3 @@ func NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndH
6872

6973
return result, nil
7074
}
71-
72-

0 commit comments

Comments
 (0)