コード例 #1
0
        public string GetQueryString(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var result = new StringBuilder();

            result.AppendQueryStringPart(GetQueryString(queryParameters));
            result.AppendQueryStringPart(GetQueryString(optionalParameters));

            return($"?{result}");
        }
コード例 #2
0
        private RestRequest GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var queryString = queryStringBuilder.GetQueryString(queryParameters, optionalParameters);

            return(new RestRequest($"{url}/{queryString}", Method.GET));
        }
コード例 #3
0
        public ChangeInfo GetDetails(string changeId, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest($"/changes/{changeId}/detail", queryParameters, optionalParameters);

            return(ExecuteRequest <ChangeInfo>(restRequest));
        }
コード例 #4
0
        public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters);

            return(ExecuteRequest <List <ChangeInfo> >(restRequest));
        }
コード例 #5
0
        private static string GetQueryString(ChangeOptionalParameters parameters)
        {
            var result = new StringBuilder();

            if (parameters.Labels)
            {
                result.AppendQueryStringPart("o=LABELS");
            }

            if (parameters.DetailedLabels)
            {
                result.AppendQueryStringPart("o=DETAILED_LABELS");
            }

            if (parameters.CurrentRevision)
            {
                result.AppendQueryStringPart("o=CURRENT_REVISION");
            }

            if (parameters.AllRevisions)
            {
                result.AppendQueryStringPart("o=ALL_REVISIONS");
            }

            if (parameters.DownloadCommands)
            {
                result.AppendQueryStringPart("o=DOWNLOAD_COMMANDS");
            }

            if (parameters.DraftComments)
            {
                result.AppendQueryStringPart("o=DRAFT_COMMENTS");
            }

            if (parameters.CurrentCommit)
            {
                result.AppendQueryStringPart("o=CURRENT_COMMIT");
            }

            if (parameters.AllCommits)
            {
                result.AppendQueryStringPart("o=ALL_COMMITS");
            }

            if (parameters.CurrentFiles)
            {
                result.AppendQueryStringPart("o=CURRENT_FILES");
            }

            if (parameters.AllFiles)
            {
                result.AppendQueryStringPart("o=ALL_FILES");
            }

            if (parameters.DetailedAccounts)
            {
                result.AppendQueryStringPart("o=DETAILED_ACCOUNTS");
            }

            if (parameters.Messages)
            {
                result.AppendQueryStringPart("o=MESSAGES");
            }

            if (parameters.CurrentActions)
            {
                result.AppendQueryStringPart("o=CURRENT_ACTIONS");
            }

            if (parameters.ChangeActions)
            {
                result.AppendQueryStringPart("o=CHANGE_ACTIONS");
            }

            if (parameters.Reviewed)
            {
                result.AppendQueryStringPart("o=REVIEWED");
            }

            if (parameters.WebLinks)
            {
                result.AppendQueryStringPart("o=WEB_LINKS");
            }

            if (parameters.Check)
            {
                result.AppendQueryStringPart("o=CHECK");
            }

            return(result.ToString());
        }