Smartsheet.Api.Internal.FolderResourcesImpl.GetFolder C# (CSharp) Method

GetFolder() public method

Gets the specified Folder (and lists its contents).

It mirrors To the following Smartsheet REST API method: GET /folders/{folderId}

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public GetFolder ( long folderId, IEnumerable include ) : Folder
folderId long the folder Id
include IEnumerable (optional) – comma-separated list of elements to include in the respons
return Folder
        public virtual Folder GetFolder(long folderId, IEnumerable<FolderInclusion> include)
        {
            StringBuilder path = new StringBuilder("folders/" + folderId);
            if (include != null)
            {
                path.Append("?include=" + QueryUtil.GenerateCommaSeparatedList(include));
            }
            return this.GetResource<Folder>(path.ToString(), typeof(Folder));
        }

Usage Example

Example #1
0
        public virtual void TestGetFolder()
        {
            // Set a fake response
            server.setResponseBody("../../../TestSDK/resources/getFolder.json");

            //server.getClass().getClassLoader().getResourceAsStream(
            //		"com/smartsheet/api/internal/getFolder.json"

            // Send the request for a folder

            //folderResource.getSmartsheet().getHttpClient().close();

            Folder folder = folderResource.GetFolder(123L);

            //		folder.setTemplates(new ArrayList<Template>());
            //		folder.setWorkspaces(new ArrayList<Workspace>());
            folderResource.GetFolder(123L);

            // Verify results
            Assert.AreEqual("Personal", folder.Name);
            Assert.AreEqual(2, folder.Sheets.Count);
            Assert.AreEqual(0, folder.Folders.Count);
        }
All Usage Examples Of Smartsheet.Api.Internal.FolderResourcesImpl::GetFolder