Interface ICommentClient
Namespace: Noxum.Nova.Cms.Client
Assembly: Noxum.Nova.Cms.Client.dll
Syntax
public interface ICommentClient
Methods
CreateCommentAsync(CreateCommentRequest, string, CancellationToken)
Create a comment.
Declaration
Task<CmsComment> CreateCommentAsync(CreateCommentRequest request, string username = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateCommentRequest | request | The model describing the comment that shall be created. |
| string | username | The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task<CmsComment> | OK |
Exceptions
| Type | Condition |
|---|---|
| CmsApiException | A server side error occurred. |
DeleteCommentAsync(long, string, CancellationToken)
Deletes a comment.
Declaration
Task DeleteCommentAsync(long commentId, string username = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| long | commentId | The comment's id. |
| string | username | The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task | OK |
Exceptions
| Type | Condition |
|---|---|
| CmsApiException | A server side error occurred. |
GetCommentAsync(long, CancellationToken)
Get a single comment by ID
Declaration
Task<CmsComment> GetCommentAsync(long commentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| long | commentId | The comment's ID. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task<CmsComment> | OK |
Exceptions
| Type | Condition |
|---|---|
| CmsApiException | A server side error occurred. |
GetCommentsAsync(int?, int?, string, bool?, string, int?, CancellationToken)
Get multiple comments, sorted by id, descending.
Declaration
Task<CmsCommentList> GetCommentsAsync(int? branchRef = null, int? objectRef = null, string user = null, bool? isDeleted = null, string @continue = null, int? take = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | branchRef | The id of the branch. |
| int? | objectRef | The id of object the comment refers to. |
| string | user | The user who wrote the comment. If not null, only comments created by the specified user will be included. |
| bool? | isDeleted | If true, include only deleted, if false include only not-deleted, if null include all comments. |
| string | continue | An opaque token that encapsulates information how to continue the list request |
| int? | take | The number of comments to take. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task<CmsCommentList> | OK |
Exceptions
| Type | Condition |
|---|---|
| CmsApiException | A server side error occurred. |
UpdateCommentAsync(long, UpdateCommentRequest, string, CancellationToken)
Updates a comment.
Declaration
Task UpdateCommentAsync(long commentId, UpdateCommentRequest request, string username = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| long | commentId | The comment id. |
| UpdateCommentRequest | request | The update request model |
| string | username | The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| Task | OK |
Exceptions
| Type | Condition |
|---|---|
| CmsApiException | A server side error occurred. |