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

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

            return($"?{result}");
        }
Beispiel #2
0
 private string GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
 {
     return($"{url}/{_queryStringBuilder.GetQueryString(queryParameters, optionalParameters)}");
 }
Beispiel #3
0
        public ChangeInfo GetDetails(string changeId, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest($"/changes/{changeId}/detail", queryParameters, optionalParameters);

            return(_requestRunner.ExecuteRequest <ChangeInfo>(restRequest, Method.GET));
        }
Beispiel #4
0
        public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters);

            return(_requestRunner.ExecuteRequest <List <ChangeInfo> >(restRequest, Method.GET));
        }
Beispiel #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());
        }