protected override OneDriveBaseResult ExecuteStep(GraphServiceClient connection, StepStartData data)
        {
            var folderId = (string)data.Data[FILE_OR_FOLDER_ID];
            OneDriveShareType  shareType  = (OneDriveShareType)data.Data[TYPE_OF_LINK];
            OneDriveShareScope shareScope = (OneDriveShareScope)data.Data[SCOPE_OF_LINK];

            return(OneDriveUtility.CreateShareLink(connection, folderId, shareType, shareScope));
        }
示例#2
0
        public static OneDriveResultWithData <OneDrivePermission> CreateShareLink(GraphServiceClient connection, string resourceId, OneDriveShareType shareType, OneDriveShareScope shareScope)
        {
            CheckConnectionOrException(connection);

            OneDriveResultWithData <OneDrivePermission> result = ProcessRequest <OneDrivePermission>(() =>
            {
                string type  = Enum.GetName(typeof(OneDriveShareType), shareType).ToLower();
                string scope = Enum.GetName(typeof(OneDriveShareScope), shareScope).ToLower();
                var perm     = CreateShareLinkById(connection, resourceId, type, scope);
                return(CreateOneDrivePermission(perm));
            });

            return(result);
        }