示例#1
0
        private static string SystemHooks_DeleteAsync_BuildUrl(Meziantou.GitLab.DeleteSystemHookRequest request)
        {
            string url;

            using (Meziantou.GitLab.Internals.UrlBuilder urlBuilder = new Meziantou.GitLab.Internals.UrlBuilder())
            {
                urlBuilder.Append("hooks/");
                if (request.Id.HasValue)
                {
                    urlBuilder.AppendParameter(request.Id.GetValueOrDefault().Value);
                }

                url = urlBuilder.ToString();
            }

            return(url);
        }
示例#2
0
        private async System.Threading.Tasks.Task SystemHooks_DeleteAsync(Meziantou.GitLab.DeleteSystemHookRequest request, Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            string url = Meziantou.GitLab.GitLabClient.SystemHooks_DeleteAsync_BuildUrl(request);

            using (System.Net.Http.HttpRequestMessage requestMessage = new System.Net.Http.HttpRequestMessage())
            {
                requestMessage.Method     = System.Net.Http.HttpMethod.Delete;
                requestMessage.RequestUri = new System.Uri(url, System.UriKind.RelativeOrAbsolute);
                HttpResponse?response = null;
                try
                {
                    response = await this.SendAsync(requestMessage, requestOptions, cancellationToken).ConfigureAwait(false);

                    await response.EnsureStatusCodeAsync(cancellationToken).ConfigureAwait(false);
                }
                finally
                {
                    if ((response != null))
                    {
                        response.Dispose();
                    }
                }
            }
        }
示例#3
0
 System.Threading.Tasks.Task Meziantou.GitLab.IGitLabSystemHooksClient.DeleteAsync(Meziantou.GitLab.DeleteSystemHookRequest request, Meziantou.GitLab.RequestOptions?requestOptions, System.Threading.CancellationToken cancellationToken)
 {
     return(this.SystemHooks_DeleteAsync(request, requestOptions, cancellationToken));
 }
示例#4
0
 public static System.Threading.Tasks.Task DeleteAsync(this Meziantou.GitLab.IGitLabSystemHooksClient client, SystemHookIdRef id, Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Meziantou.GitLab.DeleteSystemHookRequest request = new Meziantou.GitLab.DeleteSystemHookRequest(id);
     return(client.DeleteAsync(request, requestOptions, cancellationToken));
 }