コード例 #1
0
        private static string ProjectWikis_DeleteWikiPageAsync_BuildUrl(Meziantou.GitLab.DeleteWikiPageProjectWikiRequest request)
        {
            string url;

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

                urlBuilder.Append("/wikis/");
                if ((!object.ReferenceEquals(request.Slug, null)))
                {
                    urlBuilder.AppendParameter(request.Slug);
                }

                url = urlBuilder.ToString();
            }

            return(url);
        }
コード例 #2
0
        private async System.Threading.Tasks.Task ProjectWikis_DeleteWikiPageAsync(Meziantou.GitLab.DeleteWikiPageProjectWikiRequest request, Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            string url = Meziantou.GitLab.GitLabClient.ProjectWikis_DeleteWikiPageAsync_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.IGitLabProjectWikisClient.DeleteWikiPageAsync(Meziantou.GitLab.DeleteWikiPageProjectWikiRequest request, Meziantou.GitLab.RequestOptions?requestOptions, System.Threading.CancellationToken cancellationToken)
 {
     return(this.ProjectWikis_DeleteWikiPageAsync(request, requestOptions, cancellationToken));
 }