Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public async Task <HttpResponseMessage> GET_get(string locator, string fields)
        {
            string uriParams = string.Empty;
            string subUri    = string.Empty;

            if (!string.IsNullOrWhiteSpace(locator))
            {
                uriParams += locator;
            }
            if (!string.IsNullOrWhiteSpace(fields))
            {
                uriParams += fields;
            }
            string requestURI = _rootPath + subUri;

            if (!string.IsNullOrWhiteSpace(uriParams))
            {
                requestURI += WebUtility.UrlEncode(uriParams);
            }
            HttpResponseMessage response = await _serverConnection.MakeRequest(requestURI).ConfigureAwait(false);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException(response.ReasonPhrase);
            }
            return(response);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public async Task <HttpResponseMessage> POST_createPool()
        {
            string uriParams  = string.Empty;
            string subUri     = string.Empty;
            string requestURI = _rootPath + subUri;

            if (!string.IsNullOrWhiteSpace(uriParams))
            {
                requestURI += WebUtility.UrlEncode(uriParams);
            }
            HttpResponseMessage response = await _serverConnection.MakeRequest(requestURI).ConfigureAwait(false);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException(response.ReasonPhrase);
            }
            return(response);
        }
Пример #3
0
        /// <summary>
        /// Experimental use only!
        /// </summary>
        public async Task <HttpResponseMessage> GET_getDate_date_dateLocator(string format, string timezone, string dateLocator)
        {
            string uriParams = string.Empty;
            string subUri    = $"/date/{dateLocator}";

            if (!string.IsNullOrWhiteSpace(format))
            {
                uriParams += format;
            }
            if (!string.IsNullOrWhiteSpace(timezone))
            {
                uriParams += timezone;
            }
            string requestURI = _rootPath + subUri;

            if (!string.IsNullOrWhiteSpace(uriParams))
            {
                requestURI += WebUtility.UrlEncode(uriParams);
            }
            HttpResponseMessage response = await _serverConnection.MakeRequest(requestURI).ConfigureAwait(false);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException(response.ReasonPhrase);
            }
            return(response);
        }
Пример #4
0
        /// <summary>
        /// Lists changes by the specified locator
        /// </summary>
        public async Task <HttpResponseMessage> GET_serveChanges(string project, string buildType, string build, string vcsRoot, string sinceChange, long?start, int?count, string locator, string fields)
        {
            string uriParams = string.Empty;
            string subUri    = string.Empty;

            if (!string.IsNullOrWhiteSpace(project))
            {
                uriParams += project;
            }
            if (!string.IsNullOrWhiteSpace(buildType))
            {
                uriParams += buildType;
            }
            if (!string.IsNullOrWhiteSpace(build))
            {
                uriParams += build;
            }
            if (!string.IsNullOrWhiteSpace(vcsRoot))
            {
                uriParams += vcsRoot;
            }
            if (!string.IsNullOrWhiteSpace(sinceChange))
            {
                uriParams += sinceChange;
            }
            if (start != null)
            {
                uriParams += start.ToString();
            }
            if (count != null)
            {
                uriParams += count.ToString();
            }
            if (!string.IsNullOrWhiteSpace(locator))
            {
                uriParams += locator;
            }
            if (!string.IsNullOrWhiteSpace(fields))
            {
                uriParams += fields;
            }
            string requestURI = _rootPath + subUri;

            if (!string.IsNullOrWhiteSpace(uriParams))
            {
                requestURI += WebUtility.UrlEncode(uriParams);
            }
            HttpResponseMessage response = await _serverConnection.MakeRequest(requestURI).ConfigureAwait(false);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException(response.ReasonPhrase);
            }
            return(response);
        }