From 8a919ead958b4613703715bbaacb2718790947f8 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Fri, 6 Jan 2023 16:06:10 -0500 Subject: [PATCH] Move Serialize function to interface. --- src/internal/connector/graph/service.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal/connector/graph/service.go b/src/internal/connector/graph/service.go index 40595b015..07aff76dc 100644 --- a/src/internal/connector/graph/service.go +++ b/src/internal/connector/graph/service.go @@ -45,8 +45,6 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient { return s.client } -// 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) { writer, err := s.adapter.GetSerializationWriterFactory().GetSerializationWriter("application/json") defer writer.Close() @@ -70,6 +68,10 @@ type Servicer interface { // Adapter() returns GraphRequest adapter used to process large requests, create batches // and page iterators Adapter() *msgraphsdk.GraphRequestAdapter + + // Seraialize writes an M365 parsable object into a byte array using the built-in + // application/json writer within the adapter. + Serialize(object absser.Parsable) ([]byte, error) } // Idable represents objects that implement msgraph-sdk-go/models.entityable