示例#1
0
        /// <summary>
        /// Create List in Project
        /// </summary>
        /// <param name="projectId">projectId</param>
        /// <param name="requestData">RequestCreateList object</param>
        /// <returns>ModelList object expected</returns>
        public Task <Response> CreateListAsync(string projectId, RequestCreateList requestData)
        {
            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException("projectId can't be empty or null!");
            }
            if (requestData == null)
            {
                throw new ArgumentException("requestData can't be empty or null!");
            }

            string requestUri = "project/" + projectId + "/list";

            return(ExecutePostCallAsync <ModelList>(requestUri, requestData));
        }
示例#2
0
        /// <summary>
        /// Create List in Project
        /// </summary>
        /// <param name="projectId">projectId</param>
        /// <param name="requestData">RequestCreateList object</param>
        /// <returns>ModelList object expected</returns>
        public Response CreateList(string projectId, RequestCreateList requestData)
        {
            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException("projectId can't be empty or null!");
            }
            if (requestData == null)
            {
                throw new ArgumentException("requestData can't be empty or null!");
            }

            string requestUri = "project/" + projectId + "/list";

            Response response = null;

            Task.Run(async() =>
            {
                response = await ExecutePostCallAsync <ModelList>(requestUri, requestData);
            })
            .Wait();

            return(response);
        }
示例#3
0
        /// <summary>
        /// Create a folderless List
        /// </summary>
        /// <param name="paramsCreateList">param object of create list request</param>
        /// <param name="requestData">RequestCreateList object</param>
        /// <returns>ResponseGeneric with ModelList object expected</returns>
        public Task <ResponseGeneric <ResponseModelList, ResponseError> > CreateFolderlessListAsync(ParamsCreateFolderlessList paramsCreateList, RequestCreateList requestData)
        {
            requestData.ValidateData();

            var client  = new RestClient(_baseAddress);
            var request = new RestRequest($"space/{paramsCreateList.SpaceId}/list", Method.POST);

            request.AddHeader("authorization", AccessToken);
            request.AddJsonBody(requestData);

            // execute the request
            return(RestSharperHelper.ExecuteRequestAsync <ResponseModelList, ResponseError>(client, request));
        }
示例#4
0
        /// <summary>
        /// Create List in Folder
        /// </summary>
        /// <param name="paramsCreateList">param object of create list request</param>
        /// <param name="requestData">RequestCreateList object</param>
        /// <returns>ResponseGeneric with ModelList response object</returns>
        public ResponseGeneric <ResponseModelList, ResponseError> CreateList(ParamsCreateFolderList paramsCreateList, RequestCreateList requestData)
        {
            requestData.ValidateData();

            var client  = new RestClient(_baseAddress);
            var request = new RestRequest($"folder/{paramsCreateList.FolderId}/list", Method.POST);

            request.AddHeader("authorization", AccessToken);
            request.AddJsonBody(requestData);

            // execute the request
            ResponseGeneric <ResponseModelList, ResponseError> result = RestSharperHelper.ExecuteRequest <ResponseModelList, ResponseError>(client, request);

            return(result);
        }