public static async Task <HttpResponseMessage> SetParentFolder(this OsdrWebClient client, Guid fileId, int version, Guid folderId)
        {
            var url  = $"/api/entities/files/{fileId}?version={version}";
            var data = $"[{{'op':'replace','path':'ParentId','value':'{folderId}'}}]";

            return(await client.PatchData(url, data));
        }
        public static async Task <HttpResponseMessage> SetFileName(this OsdrWebClient client, Guid fileId, int version, string name)
        {
            var url  = $"/api/entities/files/{fileId}?version={version}";
            var data = $"[{{'op':'replace','path':'Name','value':'{name}'}}]";

            return(await client.PatchData(url, data));
        }
        public static async Task <HttpResponseMessage> SetPublicFileEntity(this OsdrWebClient client, Guid fileId, int version, bool isPublic)
        {
            var url  = $"/api/entities/files/{fileId}?version={version}";
            var data = $"[{{'op':'replace','path':'/Permissions/IsPublic','value':{isPublic.ToString().ToLower()}}}]";

            return(await client.PatchData(url, data));
        }
 public static async Task <HttpResponseMessage> RenameFolder(this OsdrWebClient client, Guid id, string newName)
 {
     return(await client.PatchData($"api/entities/folders/{id}?version=1", $"[{{op: 'replace', path: '/name', value: '{newName}'}}]"));
 }
Beispiel #5
0
 public static async Task <HttpResponseMessage> DeleteFolder(this OsdrWebClient client, Guid id, int version)
 {
     return(await client.PatchData("api/nodecollections", $@"[{{'op': 'add','path':'/deleted','value':[{{'id':'{id}','version':{version},'type':'Folder'}}]}}]"));
 }
Beispiel #6
0
 public static async Task <HttpResponseMessage> MoveFolder(this OsdrWebClient client, Guid idFolder, int versionFolder, Guid folderTo)
 {
     return(await client.PatchData($"api/nodecollections",
                                   $"[{{'op':'add','path':'/moved','value':[{{'id':'{idFolder}','version':{versionFolder},'type':'Folder'}}]}},{{'op':'replace','path':'/parentid','value':'{folderTo}'}}]"));
 }