Class OpenBiApiClientBlogExtensions
Extension methods for the /contentbooks and /contentarticles REST APIs.
public static class OpenBiApiClientBlogExtensions
- Inheritance
-
objectOpenBiApiClientBlogExtensions
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
clientIOpenBiApiClientcontentArticleBlogArticlecancellationTokenCancellationToken
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
clientIOpenBiApiClientcontentBookBlogcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClientbookIdstringauthorstringqstringrequestOpenBiListRequestcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClientrequestOpenBiListRequestcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcontentArticleBlogArticlecancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcontentBookBlogcancellationTokenCancellationToken
Returns
- Task<Blog>