Example #1
0
        /// <summary>
        /// Revoke App access for a given User
        /// </summary>
        /// <param name="userUrl"></param>
        /// <param name="appid"></param>
        /// <returns>
        /// no data on success
        /// </returns>
        public IQuery DeleteByUser(Uri userUrl, string appid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("Apps");
            sfApiQuery.Uri(userUrl);
            sfApiQuery.ActionIds(appid);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
Example #2
0
        /// <summary>
        /// Delete Metadata
        /// </summary>
        /// <remarks>
        /// Deletes a single Metadata entry that has a specified Name for a given Item. Fails if an entry with the given name doesn't exist for this Item.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="metadataId"></param>
        /// <returns>
        /// (no data)
        /// </returns>
        public IQuery DeleteByItem(Uri url, string metadataId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("Metadata");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(metadataId);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
        public IQuery DeleteByUser(Uri url, string itemId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("FavoriteFolders");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(itemId);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
        /// <summary>
        /// Removes a Connector Group Access Control object
        /// </summary>
        /// <remarks>
        /// Removes an Access Control object from the Connector Group ACL. This removes the permissions of
        /// the affected principal to use the Connector Group.
        /// </remarks>
        /// <param name="serviceUrl"></param>
        /// <param name="zoneid"></param>
        public IQuery DeleteAccessControls(Uri serviceUrl, string zoneid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(serviceUrl);
            sfApiQuery.ActionIds(zoneid);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
Example #5
0
        /// <summary>
        /// Revoke Two Factor Auth App by ID
        /// </summary>
        /// <param name="userUrl"></param>
        /// <param name="tfaAppId"></param>
        /// <returns>
        /// no data on success
        /// </returns>
        public IQuery DeleteTFA(Uri userUrl, string tfaAppId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("TFA");
            sfApiQuery.Uri(userUrl);
            sfApiQuery.ActionIds(tfaAppId);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
Example #6
0
        /// <summary>
        /// Delete specific Device for given User
        /// </summary>
        /// <param name="parentUrl"></param>
        /// <param name="id"></param>
        /// <returns>
        /// No content
        /// </returns>
        public IQuery DeleteByUser(Uri parentUrl, string id)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("Devices");
            sfApiQuery.Uri(parentUrl);
            sfApiQuery.ActionIds(id);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
Example #7
0
        /// <summary>
        /// Delete StorageCenter
        /// </summary>
        /// <remarks>
        /// Removes an existing storage center
        /// </remarks>
        /// <param name="zUrl"></param>
        /// <param name="scid"></param>
        public IQuery DeleteByZone(Uri zUrl, string scid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("StorageCenters");
            sfApiQuery.Uri(zUrl);
            sfApiQuery.ActionIds(scid);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
        /// <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);
        }
Example #9
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);
        }
Example #10
0
        /// <summary>
        /// Remove a tenant from a multi-tenant zone
        /// </summary>
        /// <param name="parentUrl"></param>
        /// <param name="id"></param>
        /// <param name="newDefaultZoneId"></param>
        /// <param name="expireItems"></param>
        public IQuery DeleteTenants(Uri parentUrl, string id, string newDefaultZoneId, bool expireItems = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);

            sfApiQuery.Action("Tenants");
            sfApiQuery.Uri(parentUrl);
            sfApiQuery.ActionIds(id);
            sfApiQuery.QueryString("newDefaultZoneId", newDefaultZoneId);
            sfApiQuery.QueryString("expireItems", expireItems);
            sfApiQuery.HttpMethod = "DELETE";
            return(sfApiQuery);
        }
Example #11
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);
        }
Example #12
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);
        }
Example #13
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;
 }
        /// <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;
        }
        /// <summary>
        /// Delete StorageCenter
        /// </summary>
        /// <remarks>
        /// Removes an existing storage center
        /// </remarks>
        /// <param name="zUrl"></param>
        /// <param name="scid"></param>
        public IQuery DeleteByZone(Uri zUrl, string scid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("StorageCenters");
            sfApiQuery.Uri(zUrl);
            sfApiQuery.ActionIds(scid);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }
Example #16
0
        /// <summary>
        /// Remove a tenant from a multi-tenant zone
        /// </summary>
        /// <param name="parentUrl"></param>
        /// <param name="id"></param>
        /// <param name="newDefaultZoneId"></param>
        /// <param name="expireItems"></param>
        public IQuery DeleteTenants(Uri parentUrl, string id, string newDefaultZoneId, bool expireItems = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("Tenants");
            sfApiQuery.Uri(parentUrl);
            sfApiQuery.ActionIds(id);
            sfApiQuery.QueryString("newDefaultZoneId", newDefaultZoneId);
            sfApiQuery.QueryString("expireItems", expireItems);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }
        public IQuery DeleteByUser(Uri url, string itemId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("FavoriteFolders");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(itemId);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }
        /// <summary>
        /// Removes a Connector Group Access Control object
        /// </summary>
        /// <remarks>
        /// Removes an Access Control object from the Connector Group ACL. This removes the permissions of
        /// the affected principal to use the Connector Group.
        /// </remarks>
        /// <param name="serviceUrl"></param>
        /// <param name="zoneid"></param>
        public IQuery DeleteAccessControls(Uri serviceUrl, string zoneid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("AccessControls");
            sfApiQuery.Uri(serviceUrl);
            sfApiQuery.ActionIds(zoneid);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }
Example #19
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;
        }
Example #20
0
        /// <summary>
        /// Delete Metadata
        /// </summary>
        /// <remarks>
        /// Deletes a single Metadata entry that has a specified Name for a given Item. Fails if an entry with the given name doesn't exist for this Item.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="metadataId"></param>
        /// <returns>
        /// (no data)
        /// </returns>
        public IQuery DeleteByItem(Uri url, string metadataId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client);
		    sfApiQuery.Action("Metadata");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(metadataId);
            sfApiQuery.HttpMethod = "DELETE";	
		    return sfApiQuery;
        }