예제 #1
0
 /// <summary>
 /// Gets the contents of a built-in view.
 /// </summary>
 /// <param name="builtInView">An enumeration of the built-in view to retrieve.</param>
 /// <param name="token">A cancellation token for the request.</param>
 /// <returns>The favorited items.</returns>
 public List <FolderContentItems> GetFolderContents(MFBuiltInView builtInView, CancellationToken token = default(CancellationToken))
 {
     // Execute the async method.
     return(this.GetFolderContentsAsync(builtInView, token)
            .ConfigureAwait(false)
            .GetAwaiter()
            .GetResult());
 }
예제 #2
0
        /// <summary>
        /// Gets the contents of a built-in view.
        /// </summary>
        /// <param name="builtInView">An enumeration of the built-in view to retrieve.</param>
        /// <param name="token">A cancellation token for the request.</param>
        /// <returns>The favorited items.</returns>
        public async Task <List <FolderContentItems> > GetFolderContentsAsync(MFBuiltInView builtInView, CancellationToken token = default(CancellationToken))
        {
            // Create the request.
            var request = new RestRequest($"/REST/views/v{(int)builtInView}/items");

            // Make the request and get the response.
            var response = await this.MFWSClient.Get <List <FolderContentItems> >(request, token)
                           .ConfigureAwait(false);

            // Return the data.
            return(response.Data);
        }