Exemplo n.º 1
0
 /// <summary>
 /// Requests to change specified parent id to another. 
 /// Nodes can have multiple parents, method will change only specified one.
 /// </summary>
 /// <param name="id">Node id to move</param>
 /// <param name="oldDirId">Existing parent node id to remove</param>
 /// <param name="newDirId">Another Folder node id to add as parent</param>
 /// <returns></returns>
 public async Task<AmazonNode> Move(string id, string oldDirId, string newDirId)
 {
     var url = "{0}nodes/{1}/children";
     var data = new
     {
         fromParent = oldDirId,
         childId = id
     };
     return await http.Post<object, AmazonNode>(string.Format(url, await amazon.GetMetadataUrl().ConfigureAwait(false), newDirId), data).ConfigureAwait(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Requests to change name of node, file or folder.
 /// </summary>
 /// <param name="id">Node id to rename</param>
 /// <param name="newName">New name</param>
 /// <returns>Node info with new name</returns>
 public async Task<AmazonNode> Rename(string id, string newName)
 {
     var url = "{0}nodes/{1}";
     var data = new
     {
         name = newName
     };
     return await http.Patch<object, AmazonNode>(string.Format(url, await amazon.GetMetadataUrl().ConfigureAwait(false), id), data).ConfigureAwait(false);
 }