示例#1
0
        /// <summary>
        /// Notify users that they have access to the parent folder
        /// </summary>
        /// <example>
        /// {
        /// UserIds: ["id1", "id2"],
        /// CustomMessage: "Message content goes here"
        /// }
        /// </example>
        /// <remarks>
        /// All users should have access to the parent folder
        /// </remarks>
        /// <param name="folderUrl"></param>
        /// <param name="notifyUsersParams"></param>
        public IQuery NotifyUsers(Uri folderUrl, NotifyUsersParams notifyUsersParams)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(folderUrl);
            sfApiQuery.SubAction("NotifyUsers");
            sfApiQuery.Body       = notifyUsersParams;
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
示例#2
0
        /// <summary>
        /// Delete multiple access controls
        /// </summary>
        /// <example>
        /// ["id1","id2"]
        /// </example>
        /// <param name="folderUrl"></param>
        /// <param name="principalIds"></param>
        public IQuery BulkDelete(Uri folderUrl, IEnumerable <string> principalIds)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(folderUrl);
            sfApiQuery.SubAction("BulkDelete");
            sfApiQuery.Body       = principalIds;
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
示例#3
0
        /// <summary>
        /// Get JSON Data
        /// </summary>
        /// <remarks>
        /// Get the JSON data for a report
        /// </remarks>
        /// <param name="id"></param>
        /// <returns>
        /// JSON Formatted Report Results
        /// </returns>
        public IQuery GetJsonData(string id)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.From("Reports");
            sfApiQuery.Action("Records");
            sfApiQuery.ActionIds(id);
            sfApiQuery.SubAction("JsonData");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
示例#4
0
        /// <summary>
        /// Discard checkout on a File
        /// </summary>
        /// <remarks>
        /// Discard a checkout on a file
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="lockid"></param>
        public IQuery Discard(Uri url, string lockid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("FileLock");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(lockid);
            sfApiQuery.SubAction("Discard");
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
示例#5
0
        /// <summary>
        /// Delete StorageCenter Metadata
        /// </summary>
        /// <remarks>
        /// Delete the Metadata entry associated with the specified storage center
        /// </remarks>
        /// <param name="zUrl"></param>
        /// <param name="scid"></param>
        /// <param name="name"></param>
        /// <returns>
        /// no data on success
        /// </returns>
        public IQuery DeleteMetadata(Uri zUrl, string scid, string name)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("StorageCenters");
            sfApiQuery.Uri(zUrl);
            sfApiQuery.ActionIds(scid);
            sfApiQuery.SubAction("Metadata");
            sfApiQuery.QueryString("name", name);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
示例#6
0
        /// <summary>
        /// Download Multiple Items from a Share for a Recipient
        /// </summary>
        /// <example>
        /// ["id1","id2",...]
        /// </example>
        /// <remarks>
        /// Download Multiple Items from a Share for a Recipient. The download will contain a ZIP archive containing all
        /// files and folders in the share, named Files.zip.To download Shares that require user informaion ( Email, First Name, Last Name and Company), make sure
        /// to create an Recipient (alias) and pass in the alaisId.To download Shares that require authentication, make sure this request is authenticated.
        /// Anyone can download files from anonymous shares.
        /// </remarks>
        /// <param name="shareUrl"></param>
        /// <param name="aliasid"></param>
        /// <param name="ids"></param>
        /// <param name="redirect"></param>
        /// <returns>
        /// Redirects the caller (302) to the download address for the share contents.
        /// </returns>
        public IQuery BulkDownload(Uri shareUrl, string aliasid, IEnumerable <string> ids, bool redirect = true)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("Recipients");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(aliasid);
            sfApiQuery.SubAction("BulkDownload");
            sfApiQuery.QueryString("redirect", redirect);
            sfApiQuery.Body       = ids;
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
示例#7
0
        /// <summary>
        /// Get spreadsheet data
        /// </summary>
        /// <remarks>
        /// Get the spreadsheet data for a report
        /// </remarks>
        /// <param name="id"></param>
        /// <returns>
        /// Excel Formatted Report Results
        /// </returns>
        public IQuery DownloadData(string id)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.From("Reports");
		    sfApiQuery.Action("Records");
            sfApiQuery.ActionIds(id);
            sfApiQuery.SubAction("DownloadData");
            sfApiQuery.HttpMethod = "GET";	
		    return sfApiQuery;
        }
        /// <summary>
        /// Notify users that they have access to the parent folder
        /// </summary>
        /// <example>
        /// [
        /// {
        /// UserIds: ["id1", "id2"],
        /// CustomMessage: "Message content goes here"
        /// }
        /// ]
        /// </example>
        /// <remarks>
        /// All users should have access to the parent folder
        /// </remarks>
        /// <param name="folderUrl"></param>
        /// <param name="notifyUsersParams"></param>
        public IQuery NotifyUsers(Uri folderUrl, NotifyUsersParams notifyUsersParams)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(folderUrl);
            sfApiQuery.SubAction("NotifyUsers");
            sfApiQuery.Body = notifyUsersParams;
            sfApiQuery.HttpMethod = "POST";	
		    return sfApiQuery;
        }
        /// <summary>
        /// Delete multiple access controls
        /// </summary>
        /// <example>
        /// ["id1","id2",...]
        /// </example>
        /// <param name="folderUrl"></param>
        /// <param name="principalIds"></param>
        public IQuery BulkDelete(Uri folderUrl, IEnumerable<string> principalIds)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(folderUrl);
            sfApiQuery.SubAction("BulkDelete");
            sfApiQuery.Body = principalIds;
            sfApiQuery.HttpMethod = "POST";	
		    return sfApiQuery;
        }
        /// <summary>
        /// Delete StorageCenter Metadata
        /// </summary>
        /// <remarks>
        /// Delete the Metadata entry associated with the specified storage center
        /// </remarks>
        /// <param name="zUrl"></param>
        /// <param name="scid"></param>
        /// <param name="name"></param>
        /// <returns>
        /// no data on success
        /// </returns>
        public IQuery DeleteMetadata(Uri zUrl, string scid, string name)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("StorageCenters");
            sfApiQuery.Uri(zUrl);
            sfApiQuery.ActionIds(scid);
            sfApiQuery.SubAction("Metadata");
            sfApiQuery.QueryString("name", name);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }
示例#11
0
 /// <summary>
 /// Download Multiple Items from a Share for a Recipient
 /// </summary>
 /// <example>
 /// ["id1","id2",...]
 /// </example>
 /// <remarks>
 /// Download Multiple Items from a Share for a Recipient. The download will contain a ZIP archive containing all
 /// files and folders in the share, named Files.zip.To download Shares that require user informaion ( Email, First Name, Last Name and Company), make sure
 /// to create an Recipient (alias) and pass in the alaisId.To download Shares that require authentication, make sure this request is authenticated.
 /// Anyone can download files from anonymous shares.
 /// </remarks>
 /// <param name="shareUrl"></param>
 /// <param name="aliasid"></param>
 /// <param name="ids"></param>
 /// <param name="redirect"></param>
 /// <returns>
 /// Redirects the caller (302) to the download address for the share contents.
 /// </returns>
 public IQuery BulkDownload(Uri shareUrl, string aliasid, IEnumerable<string> ids, bool redirect = true)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
     sfApiQuery.Action("Recipients");
     sfApiQuery.Uri(shareUrl);
     sfApiQuery.ActionIds(aliasid);
     sfApiQuery.SubAction("BulkDownload");
     sfApiQuery.QueryString("redirect", redirect);
     sfApiQuery.Body = ids;
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }