Table of Contents

Class OpenBiApiClientBlogExtensions

Namespace
BiExcellence.OpenBi.Api.Blog
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /contentbooks and /contentarticles REST APIs.

public static class OpenBiApiClientBlogExtensions
Inheritance
object
OpenBiApiClientBlogExtensions

Methods

CreateContentArticleAsync(IOpenBiApiClient, BlogArticle, CancellationToken)

Creates a content article. Name the book it belongs to in BlogId. The server fills an empty Author from the authenticated user and an empty UrlPath from the title. UpdateContentArticleAsync(IOpenBiApiClient, string, BlogArticle, CancellationToken) creates as well as updates, for a caller that picks its own id.

public static Task<BlogArticle?> CreateContentArticleAsync(this IOpenBiApiClient client, BlogArticle contentArticle, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
contentArticle BlogArticle
cancellationToken CancellationToken

Returns

Task<BlogArticle>

CreateContentBookAsync(IOpenBiApiClient, Blog, CancellationToken)

Creates a content book - the container; write its articles with CreateContentArticleAsync(IOpenBiApiClient, BlogArticle, CancellationToken). UpdateContentBookAsync(IOpenBiApiClient, string, Blog, CancellationToken) creates as well as updates, for a caller that picks its own id.

public static Task<Blog?> CreateContentBookAsync(this IOpenBiApiClient client, Blog contentBook, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
contentBook Blog
cancellationToken CancellationToken

Returns

Task<Blog>

DeleteContentArticleAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a content article. An id that does not exist is not an error.

public static Task DeleteContentArticleAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

DeleteContentBookAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a content book together with its articles. An id that does not exist is not an error.

public static Task DeleteContentBookAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetContentArticleAsync(IOpenBiApiClient, string, CancellationToken)

Reads one content article (GET contentarticles/{id}). Throws an OpenBiApiException with status 404 when there is no content article with this id.

public static Task<BlogArticle> GetContentArticleAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<BlogArticle>

GetContentArticlesAsync(IOpenBiApiClient, string?, string?, string?, OpenBiListRequest?, CancellationToken)

Lists content articles, optionally scoped to one book (bookId), restricted to one author, and searched by q, which matches articles whose title or content contains it. Scoped to a book the list is in Position order, otherwise in title order.

public static Task<OpenBiListResult<BlogArticle>> GetContentArticlesAsync(this IOpenBiApiClient client, string? bookId = null, string? author = null, string? q = null, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
bookId string
author string
q string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<BlogArticle>>

GetContentBookAsync(IOpenBiApiClient, string, CancellationToken)

Reads one content book (GET contentbooks/{id}). Throws an OpenBiApiException with status 404 when there is no content book with this id.

public static Task<Blog> GetContentBookAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<Blog>

GetContentBooksAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists content books. A content book is a collection of articles - a blog, a news section, a documentation area of a CMS site; GetContentArticlesAsync(IOpenBiApiClient, string?, string?, string?, OpenBiListRequest?, CancellationToken) lists the articles of one.

public static Task<OpenBiListResult<Blog>> GetContentBooksAsync(this IOpenBiApiClient client, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Blog>>

UpdateContentArticleAsync(IOpenBiApiClient, string, BlogArticle, CancellationToken)

Creates or updates the content article with this id (POST contentarticles/{id}) - an id that does not exist yet is inserted. The id in the route wins over the one in the body. The server fills an empty UrlPath from the title, but not the author.

public static Task<BlogArticle?> UpdateContentArticleAsync(this IOpenBiApiClient client, string id, BlogArticle contentArticle, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
contentArticle BlogArticle
cancellationToken CancellationToken

Returns

Task<BlogArticle>

UpdateContentBookAsync(IOpenBiApiClient, string, Blog, CancellationToken)

Creates or updates the content book with this id (POST contentbooks/{id}) - an id that does not exist yet is inserted. The id in the route wins over the one in the body.

public static Task<Blog?> UpdateContentBookAsync(this IOpenBiApiClient client, string id, Blog contentBook, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
contentBook Blog
cancellationToken CancellationToken

Returns

Task<Blog>