コード例 #1
0
        public string ToQueryString()
        {
            string result = String.Empty;

            if (!String.IsNullOrEmpty(MergeCommitMessage))
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "merge_commit_message", WebUtility.UrlEncode(MergeCommitMessage.Replace("\r", "")));
            }
            if (!String.IsNullOrEmpty(SquashCommitMessage))
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "squash_commit_message", WebUtility.UrlEncode(SquashCommitMessage.Replace("\r", "")));
            }
            if (Squash.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result, "squash", Squash.ToString().ToLower());
            }
            if (ShouldRemoveSourceBranch.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "should_remove_source_branch", ShouldRemoveSourceBranch.ToString().ToLower());
            }
            if (MergeWhenPipelineSucceeds.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "merge_when_pipeline_succeeds", MergeWhenPipelineSucceeds.ToString().ToLower());
            }
            if (!String.IsNullOrEmpty(Sha))
            {
                result = QueryStringHelper.AddQueryParameter(result, "state_event", WebUtility.UrlEncode(Sha));
            }
            return(result);
        }
コード例 #2
0
        public string ToQueryString()
        {
            string result = String.Empty;

            result = QueryStringHelper.AddQueryParameter(result, "source_branch", WebUtility.UrlEncode(SourceBranch));
            result = QueryStringHelper.AddQueryParameter(result, "target_branch", WebUtility.UrlEncode(TargetBranch));
            result = QueryStringHelper.AddQueryParameter(result, "title", WebUtility.UrlEncode(Title.Replace("\r", "")));
            if (AssigneeId.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "assignee_id", AssigneeId.Value.ToString());
            }
            if (!String.IsNullOrEmpty(Description))
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "description", WebUtility.UrlEncode(Description.Replace("\r", "")));
            }
            if (RemoveSourceBranch.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "remove_source_branch", RemoveSourceBranch.ToString().ToLower());
            }
            if (Squash.HasValue)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "squash", Squash.ToString().ToLower());
            }
            if (Labels != null)
            {
                result = QueryStringHelper.AddQueryParameter(result,
                                                             "labels", String.Join(",", Labels).ToLower());
            }
            return(result);
        }