Smartsheet.Api.Internal.SheetColumnResourcesImpl.GetColumn C# (CSharp) Method

GetColumn() public method

Gets the Column specified in the URL.

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

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 GetColumn ( long sheetId, long columnId, IEnumerable include ) : Api.Models.Column
sheetId long the sheet Id
columnId long the columnId
include IEnumerable elements to include in response
return Api.Models.Column
        public virtual Column GetColumn(long sheetId, long columnId, IEnumerable<ColumnInclusion> include)
        {
            StringBuilder path = new StringBuilder("sheets/" + sheetId + "/columns/" + columnId);
            if (include != null)
            {
                path.Append("?include=" + QueryUtil.GenerateCommaSeparatedList(include));
            }
            return this.GetResource<Column>(path.ToString(), typeof(Column));
        }

Usage Example

Example #1
0
        public virtual void TestGetColumn()
        {
            server.setResponseBody("../../../TestSDK/resources/getColumn.json");

            Column newCol = sheetColumnResourcesImpl.GetColumn(123, 1234L, null);

            Assert.IsTrue(newCol.Type == ColumnType.CHECKBOX);
            Assert.IsTrue(newCol.Index == 2);
            Assert.IsTrue(newCol.Id == 7960873114331012);
            Assert.IsTrue(newCol.Title == "Favorite");
        }