Example #1
0
		/// <summary>
		/// Get files from Trash folder
		/// </summary>
		/// <param name="type">The type of the files to retrieve</param>
		/// <param name="sortBy">Specifies how the list of folders is sorted</param>
		/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
		/// <param name="pag">Pagination object.</param>
		/// <returns>Returns a collection of MyLibraryFile objects.</returns>
		public ResultSet<MyLibraryFile> GetLibraryTrashFiles(FileTypes? type, TrashSortBy? sortBy, int? limit, Pagination pag)
		{
			return MyLibraryService.GetLibraryTrashFiles(this.AccessToken, this.APIKey, type, sortBy, limit, pag);
		}
Example #2
0
		/// <summary>
		/// Get files from Trash folder
		/// </summary>
		/// <param name="accessToken">Access token.</param>
        /// <param name="apiKey">The API key for the application</param>
		/// <param name="type">The type of the files to retrieve</param>
		/// <param name="sortBy">Specifies how the list of folders is sorted</param>
		/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
		/// <param name="pag">Pagination object.</param>
		/// <returns>Returns a collection of MyLibraryFile objects.</returns>
		public ResultSet<MyLibraryFile> GetLibraryTrashFiles(string accessToken, string apiKey, FileTypes? type, TrashSortBy? sortBy, int? limit, Pagination pag)
		{
			ResultSet<MyLibraryFile> results = null;
            string url = (pag == null) ? String.Concat(Config.Endpoints.BaseUrl, Config.Endpoints.MyLibraryTrash, GetQueryParameters(new object[] { "type", type, "sort_by", sortBy, "limit", limit})) : pag.GetNextUrl();
            CUrlResponse response = RestClient.Get(url, accessToken, apiKey);

            if (response.IsError)
            {
                throw new CtctException(response.GetErrorMessage());
            }

            if (response.HasData)
            {
                results = response.Get<ResultSet<MyLibraryFile>>();
            }

            return results;
		}
Example #3
0
		/// <summary>
		/// Get files from Trash folder
		/// </summary>
		/// <param name="type">The type of the files to retrieve</param>
		/// <param name="sortBy">Specifies how the list of folders is sorted</param>
		/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
		/// <returns>Returns a collection of MyLibraryFile objects.</returns>
		public ResultSet<MyLibraryFile> GetLibraryTrashFiles(FileTypes? type, TrashSortBy? sortBy, int? limit)
		{
			return this.GetLibraryTrashFiles(type, sortBy, limit, null);
		}
Example #4
0
		/// <summary>
		/// Get files from Trash folder
		/// </summary>
		/// <param name="type">The type of the files to retrieve</param>
		/// <param name="sortBy">Specifies how the list of folders is sorted</param>
		/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
		/// <param name="pag">Pagination object.</param>
		/// <returns>Returns a collection of MyLibraryFile objects.</returns>
		public ResultSet<MyLibraryFile> GetLibraryTrashFiles(FileTypes? type, TrashSortBy? sortBy, int? limit, Pagination pag)
		{
            string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.MyLibraryTrash, GetQueryParameters(new object[] { "type", type, "sort_by", sortBy, "limit", limit})) : pag.GetNextUrl();
            RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
            try
            {
                var results = response.Get<ResultSet<MyLibraryFile>>();
                return results;
            }
            catch (Exception ex)
            {
                throw new CtctException(ex.Message, ex);
            }
		}