Esempio n. 1
0
        public string GetQueryString(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var result = new StringBuilder();

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

            return($"?{result}");
        }
Esempio n. 2
0
        private static string GetQueryString(ChangeQueryParameters queryParameters)
        {
            var result = new StringBuilder();

            if (queryParameters.NumberOfResults != 0)
            {
                result.AppendQueryStringPart($"n={queryParameters.NumberOfResults}");
            }

            if (queryParameters.Status != null)
            {
                result.AppendQueryStringPart($"status:{queryParameters.Status}");
            }

            if (queryParameters.ReviewedByMe)
            {
                result.AppendQueryStringPart("q=reviewer:self");
            }

            return(result.ToString());
        }
Esempio n. 3
0
 private string GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
 {
     return($"{url}/{_queryStringBuilder.GetQueryString(queryParameters, optionalParameters)}");
 }
Esempio n. 4
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));
        }
Esempio n. 5
0
        public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters);

            return(_requestRunner.ExecuteRequest <List <ChangeInfo> >(restRequest, Method.GET));
        }