public string GetQueryString(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var result = new StringBuilder(); result.AppendQueryStringPart(GetQueryString(queryParameters)); result.AppendQueryStringPart(GetQueryString(optionalParameters)); return($"?{result}"); }
private RestRequest GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var queryString = queryStringBuilder.GetQueryString(queryParameters, optionalParameters); return(new RestRequest($"{url}/{queryString}", Method.GET)); }
public ChangeInfo GetDetails(string changeId, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var restRequest = GetRestRequest($"/changes/{changeId}/detail", queryParameters, optionalParameters); return(ExecuteRequest <ChangeInfo>(restRequest)); }
public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters); return(ExecuteRequest <List <ChangeInfo> >(restRequest)); }
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()); }