Smartsheet.Api.Internal.ShareResourcesImpl.UpdateShare C# (CSharp) Method

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
        public virtual Share UpdateShare(long objectId, Share share)
        {
            return this.UpdateResource<Share>(MasterResourceType + "/" + objectId + "/shares/" + share.Id, typeof(Share), share);
        }

Usage Example

		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);
		}
All Usage Examples Of Smartsheet.Api.Internal.ShareResourcesImpl::UpdateShare