From a9421d7195ff0e7b0cd8082ba179c0003a72e568 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Wed, 18 Jan 2023 23:34:58 -0500 Subject: [PATCH] Beta Servicer created. --- src/internal/connector/graph/service.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/internal/connector/graph/service.go b/src/internal/connector/graph/service.go index 7780e7941..02ac7eb1e 100644 --- a/src/internal/connector/graph/service.go +++ b/src/internal/connector/graph/service.go @@ -4,6 +4,7 @@ import ( "context" absser "github.com/microsoft/kiota-abstractions-go/serialization" + beta "github.com/microsoftgraph/msgraph-beta-sdk-go" msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" "github.com/pkg/errors" @@ -45,6 +46,28 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient { return s.client } +// BetaService provides access to API Calls that are present solely in the Beta library. +// Does not fulfill the interface as the base libraries vary. +type BetaService struct { + adapter *beta.GraphRequestAdapter + client *beta.GraphBaseServiceClient +} + +func (bs BetaService) Adapter() *beta.GraphRequestAdapter { + return bs.adapter +} + +func (bs BetaService) Client() *beta.GraphBaseServiceClient { + return bs.client +} + +func NewBetaService(adapter *beta.GraphRequestAdapter) *BetaService { + return &BetaService{ + adapter: adapter, + client: beta.NewGraphBaseServiceClient(adapter), + } +} + // Seraialize writes an M365 parsable object into a byte array using the built-in // application/json writer within the adapter. func (s Service) Serialize(object absser.Parsable) ([]byte, error) {