Represents the scope of a share. For use with the ShareResources.ListShares(long, PaginationParameters, ShareScope).
See http://smartsheet-platform.github.io/api-docs/#share-object and http://smartsheet-platform.github.io/api-docs/#list-sheet-shares for more information.
コード例 #1
0
        /// <summary>
        /// <para>List shares of a given object.</para>
        /// <para>It mirrors To the following Smartsheet REST API method:<br />
        /// GET /workspaces/{workspaceId}/shares <br />
        /// GET /sheets/{sheetId}/shares <br />
        /// GET /sights/{sightId}/shares <br />
        /// GET /reports/{reportId}/shares</para>
        /// </summary>
        /// <param name="objectId"> the object Id </param>
        /// <param name="paging"> the pagination request </param>
        /// <param name="shareScope"> when specified with a value of <see cref="ShareScope.Worksapce"/>, the response will contain both item-level shares (scope=‘ITEM’) and workspace-level shares (scope='WORKSPACE’). </param>
        /// <returns> the list of Share objects (note that an empty list will be returned if there is none). </returns>
        /// <exception cref="System.InvalidOperationException"> if any argument is null or empty string </exception>
        /// <exception cref="InvalidRequestException"> if there is any problem with the REST API request </exception>
        /// <exception cref="AuthorizationException"> if there is any problem with  the REST API authorization (access token) </exception>
        /// <exception cref="ResourceNotFoundException"> if the resource cannot be found </exception>
        /// <exception cref="ServiceUnavailableException"> if the REST API service is not available (possibly due To rate limiting) </exception>
        /// <exception cref="SmartsheetException"> if there is any other error during the operation </exception>
        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));
        }