GetFolder() public méthode

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
Résultat Folder
Exemple #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);
        }
Exemple #2
0
        public virtual void TestGetFolder()
        {
            // Test will fail unless Sheet is implemented to API2.0 because of Sheet.Source
            // Set a fake response
            server.setResponseBody("../../../TestSDK/resources/getFolder.json");

            // User can get Folder by specifying a list of FolderInclude enum values or specifying null.
            Folder folder = folderResource.GetFolder(123L, new List <FolderInclusion> {
                FolderInclusion.SOURCE
            });

            // Verify results
            Assert.AreEqual("Projects", folder.Name);
            Assert.AreEqual(9, folder.Sheets.Count);
            Assert.AreEqual(1, folder.Folders.Count);
            //Uncomment below once Sheet is implemented with Source object to test whether Source test validates.
            //Assert.AreEqual(6075276170946436, folder.Sheets[0].Source.ID);
        }