Пример #1
0
        public Task <RepositoryCreated> CreateAsync(string owner, string reposlug, RepositoryCreateOptionalParameters optional)
        {
            var segments = CreateDefaultSegmentsDictionary(owner, reposlug);
            var request  = new RestComplexDataRequest(Method.POST, segments, null, null, optional,
                                                      RestDataContentType.Json);
            var task = MakeAsyncRequest <RepositoryCreated>(DEFAULT_SPECIFIC_REPOSITORY_RESOURCE, request);

            return(task);
        }
Пример #2
0
        public Task <BranchRestriction> AddAsync(string owner, string reposlug, BranchRestriction restriction)
        {
            var segments    = CreateDefaultSegmentsDictionary(owner, reposlug);
            var content     = restriction.CreatePostData();
            var restRequest = new RestComplexDataRequest(Method.POST, segments, null, null, content,
                                                         RestDataContentType.UrlEncode);
            var task = MakeAsyncRequest <BranchRestriction>(BRANCH_RESTRICTIONS_RESOURCE, restRequest);

            return(task);
        }
        public Task <PullRequest> EditAsync(string owner, string reposlug, long id, PullRequest pullRequest)
        {
            var segments = CreateDefaultSegmentsDictionary(owner, reposlug);

            segments.Add(PULL_REQUEST_ID_SEGMENT, id.ToString());
            var request = new RestComplexDataRequest(Method.PUT, segments, null, null, pullRequest,
                                                     RestDataContentType.Json);
            var task = MakeAsyncRequest <PullRequest>(SPECIFIED_PULL_REQUEST_RESOURCE, request);

            return(task);
        }
        public Task <PullRequest> CreateAsync(string owner, string reposlug, PullRequest pullRequest)
        {
            var segments = CreateDefaultSegmentsDictionary(owner, reposlug);
            var request  = new RestComplexDataRequest(Method.POST, segments, null, null, pullRequest,
                                                      RestDataContentType.Json);

            System.Diagnostics.Debug.WriteLine(pullRequest.Serialize());
            var task = MakeAsyncRequest <PullRequest>(DEFAULT_PULL_REQUEST_RESOURCE, request);

            return(task);
        }
Пример #5
0
        public Task <BranchRestriction> EditAsync(string owner, string reposlug, string id, BranchRestriction restriction)
        {
            var segments = CreateDefaultSegmentsDictionary(owner, reposlug);

            segments.Add(ID_SEGMENT, id);
            var content     = restriction.CreatePostData();
            var restRequest = new RestComplexDataRequest(Method.PUT, segments, null, null, content,
                                                         RestDataContentType.UrlEncode);
            var task = MakeAsyncRequest <BranchRestriction>(SPECIFIED_RESTRICTION_RESOURCE, restRequest);

            return(task);
        }