UpdateShare() public method

Updates the access level of a User or Group for the specified Object.

It mirrors To the following Smartsheet REST API method:
PUT /workspaces/{workspaceId}/shares/{shareId}
PUT /sheets/{sheetId}/shares/{shareId}
PUT /sights/{sightId}/shares/{shareId}
PUT /reports/{reportId}/shares/{shareId}

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 UpdateShare ( long objectId, Api.Models.Share share ) : Api.Models.Share
objectId long the ID of the object To share
share Api.Models.Share the share
return Api.Models.Share
コード例 #1
0
		public virtual void TestUpdateShare()
		{
			server.setResponseBody("../../../TestSDK/resources/updateShare.json");
			Share share = new Share.UpdateShareBuilder("12dfgfg34sdf54L", AccessLevel.VIEWER).Build();
			Share newShare = shareResourcesImpl.UpdateShare(1234L, share);
			Assert.AreEqual(share.AccessLevel, newShare.AccessLevel);
			Assert.AreEqual(newShare.UserId, 1539725208119172);
		}
コード例 #2
0
        public virtual void TestUpdateShare()
        {
            server.setResponseBody("../../../TestSDK/resources/updateShare.json");
            Share share = new Share();

            share.AccessLevel = AccessLevel.ADMIN;
            Share newShare = shareResourcesImpl.UpdateShare(1234L, 123454L, share);

            Assert.AreEqual(share.AccessLevel, newShare.AccessLevel);
        }