Ejemplo n.º 1
0
 public bool Equals(ShareScope obj)
 {
     return(0 == string.CompareOrdinal(_value, obj._value));
 }
        /// <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.Workspace"/>, 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)));
        }
 public bool Equals(ShareScope obj)
 {
     return 0 == string.CompareOrdinal(_value, obj._value);
 }
        /// <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 /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)
        {
            var url = MasterResourceType + "/" + objectId + "/shares";

            if (ShareScope.Workspace.Equals(shareScope))
            {
                url = url + "?include=workspaceShares";
            }
            return(this.ListResourcesWithWrapper <Share>(url));
        }