Example #1
0
        public GetFileSystemEntriesResponse GetFileSystemEntries(string folderPath, int?offset = null,
                                                                 int?limit      = null, SortBy sortBy = SortBy.ctime, SortDirection sortDirection     = SortDirection.asc,
                                                                 string pattern = null, FileTypeFilter fileType = FileTypeFilter.all, string gotoPath = null,
                                                                 FileListAddtionalOptions additional = null)
        {
            dynamic requiredParams = new
            {
                api         = "SYNO.FileStation.List",
                version     = 1,
                method      = "list",
                folder_path = folderPath,
                offset,
                limit,
                sort_by        = sortBy,
                sort_direction = sortDirection,
                pattern,
                filetype  = fileType,
                goto_path = gotoPath
            };

            var proc = new FuncProcessor <GetFileSystemEntriesResponse>("/entry.cgi", _session.sid,
                                                                        requiredParams, new
            {
                additional = TrueBooleanValuesFromObjectToCommaSeparatedList(additional)
            });

            return(proc.Run());
        }
Example #2
0
        public GetSharesResponse GetShares(int?offset = null, int?limit = null, SortBy sortBy = SortBy.ctime,
                                           SortDirection sortDirection         = SortDirection.asc, bool onlywritable = false,
                                           FileListAddtionalOptions additional = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.List",
                version = 1,
                method  = "list_share",
                offset,
                limit,
                sort_by        = sortBy,
                sort_direction = sortDirection,
                onlywritable
            };

            var proc = new FuncProcessor <GetSharesResponse>("/entry.cgi", _session.sid, requiredParams,
                                                             new
            {
                additional = TrueBooleanValuesFromObjectToCommaSeparatedList(additional)
            });

            return(proc.Run());
        }