public ListShares ( long objectId, |
||
objectId | long | the object Id |
paging | the pagination request | |
shareScope | when specified with a value of |
|
Résultat | PaginatedResult |
public virtual PaginatedResult<Share> ListShares(long objectId, PaginationParameters paging, ShareScope shareScope)
{
IDictionary<string, string> parameters = new Dictionary<string, string>();
if (paging != null)
{
parameters = paging.toDictionary();
}
if (ShareScope.Workspace.Equals(shareScope))
{
parameters.Add("include", "workspaceShares");
}
return this.ListResourcesWithWrapper<Share>(MasterResourceType + "/" + objectId + "/shares" + QueryUtil.GenerateUrl(null, parameters));
}
public virtual void TestListShares() { server.setResponseBody("../../../TestSDK/resources/listShares.json"); IList <Share> shares = shareResourcesImpl.ListShares(2906571706525572L); Assert.True(shares.Count == 2, "The number of shares returned is incorrect."); Assert.AreEqual("*****@*****.**", shares[0].Email, "Email attribute of the share is incorrect."); Assert.AreEqual("*****@*****.**", shares[1].Email, "Email attribute of the share is incorrect."); }