public FileStationAPI() { Authentication = APIAuthentication.CreateAPIAuthentication(Session); List <string> FileStationAPIs = new List <string> { FileStationList, FileStationSearch, FileStationUpload }; ApiCollection apiCollection = ApiCollection.GetApiCollection(); APIVersions = apiCollection.RetrieveLatestVersions(FileStationAPIs); SharedFoldersTopLevelData = new TopLevelSharedFolderListInfo(); SharedFolders = new List <FileStationSharedFolder>(); }
public TopLevelSharedFolderListInfo RetrieveListOfSharedFolders() { Query = new Query(); Query.SetPath("webapi/entry.cgi"); NameValueCollection collection = new NameValueCollection(); collection["_sid"] = SID; Query.BuildQueryWithParameters(FileStationList, APIVersions[FileStationList], "list_share", collection); NetworkRequest = new NetworkGetRequest(Query.GetUri()); string jsonResponse = NetworkRequest.SendGetRequest(); if (NetworkRequest.GetResponseStatusCode()) { APITopLevelSharedFoldersNetworkResponse networkResponse = APIResult.RetrieveResultsOfSharedFoldersInfoNetworkResponse(jsonResponse); SharedFoldersTopLevelData = networkResponse.Data; PopulateSharedFolderCollection(SharedFoldersTopLevelData); } return(SharedFoldersTopLevelData); }
private void PopulateSharedFolderCollection(TopLevelSharedFolderListInfo data) { SharedFolders = data.Shares.Select(a => new FileStationSharedFolder(a)).ToList(); }