コード例 #1
0
        public DownloadShareList GetDownloadShares(long?offset     = null, long?limit = null, GetDownloadSharesFilter filter = null,
                                                   SharesSort sort = null)
        {
            _client.Executor.CheckApiServerVersion();

            #region Parameter Validation

            offset.NullableMustNotNegative(nameof(offset));
            limit.NullableMustPositive(nameof(limit));

            #endregion

            IRestRequest         restRequest = _client.Builder.GetDownloadShares(offset, limit, filter, sort);
            ApiDownloadShareList result      =
                _client.Executor.DoSyncApiCall <ApiDownloadShareList>(restRequest, DracoonRequestExecutor.RequestType.GetDownloadShares);
            return(ShareMapper.FromApiDownloadShareList(result));
        }
コード例 #2
0
        internal static IRestRequest GetUploadSharesMock(long?offset = null, long?limit = null, GetUploadSharesFilter f = null, SharesSort s = null)
        {
            RestRequest rr = RestRequestWithAuth(ApiConfig.ApiGetUploadShares, Method.GET);

            ApplyFilter(f, rr);
            ApplySort(s, rr);
            if (offset.HasValue)
            {
                rr.AddQueryParameter("offset", offset.ToString());
            }
            if (limit.HasValue)
            {
                rr.AddQueryParameter("limit", limit.ToString());
            }
            return(rr);
        }
コード例 #3
0
        IRestRequest IRequestBuilder.GetUploadShares(long?offset, long?limit, GetUploadSharesFilter filter = null, SharesSort sort = null)
        {
            RestRequest request = new RestRequest(ApiConfig.ApiGetUploadShares, Method.GET);

            SetGeneralRestValues(request, true);
            AddFilters(filter, request);
            AddSort(sort, request);
            if (offset.HasValue)
            {
                request.AddQueryParameter("offset", offset.ToString());
            }
            if (limit.HasValue)
            {
                request.AddQueryParameter("limit", limit.ToString());
            }
            return(request);
        }