SearchSheet() public method

Searches a Sheet for the specified text.

It mirrors To the following Smartsheet REST API method: GET /search/sheets/{sheetId}

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 SearchSheet ( long sheetId, string query ) : Api.Models.SearchResult
sheetId long the sheet Id
query string the query Text
return Api.Models.SearchResult
Example #1
0
        public virtual void TestSearchSheet()
        {
            server.setResponseBody("../../../TestSDK/resources/searchSheet.json");

            SearchResult searchSheet = searchResources.SearchSheet(1234L, "java");

            Assert.NotNull(searchSheet);
            IList <SearchResultItem> results = searchSheet.Results;

            Assert.AreEqual(100, results.Count);
            Assert.AreEqual(130, (int)searchSheet.TotalCount);
            Assert.AreEqual("HomeResources.java", results[0].Text);
            Assert.IsTrue(SearchObjectType.ROW == results[0].ObjectType);
            Assert.AreEqual(7243572589160324L, (long)results[0].ObjectId);
            Assert.AreEqual("Row 12", results[0].ContextData[0]);
            Assert.IsTrue(ObjectType.SHEET == results[0].ParentObjectType);
            Assert.AreEqual(2630121841551236L, (long)results[0].ParentObjectId);
            Assert.AreEqual("SDK Code Checklist", results[0].ParentObjectName);
        }