Show / Hide Table of Contents

Class NewsFeedAgent

Proxy class for the NewsFeed Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Inheritance
object
NewsFeedAgent
Implements
INewsFeedAgent
IAgent
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class NewsFeedAgent : INewsFeedAgent, IAgent

Constructors

NewsFeedAgent(INewsFeedItemImplementation, ISoRequestItemsAccessor)

Proxy class for the NewsFeed Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Declaration
public NewsFeedAgent(INewsFeedItemImplementation newsFeedItemImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type Name Description
INewsFeedItemImplementation newsFeedItemImplementation
ISoRequestItemsAccessor accessor

NewsFeedAgent(INewsFeedItemImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)

Proxy class for the NewsFeed Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Declaration
public NewsFeedAgent(INewsFeedItemImplementation newsFeedItemImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type Name Description
INewsFeedItemImplementation newsFeedItemImplementation
ISoRequestItemsAccessor accessor
IDebugUser debugUser
IServiceCallsRepository serviceCallsRepository

Methods

CreateDefaultNewsFeedItemAsync(CancellationToken)

Loading default values into a new NewsFeedItem.

Declaration
public Task<NewsFeedItem> CreateDefaultNewsFeedItemAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<NewsFeedItem>

New NewsFeedItem with default values

DeleteNewsFeedItemAsync(int, CancellationToken)

Deletes the NewsFeedItem

Declaration
public Task DeleteNewsFeedItemAsync(int newsFeedItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int newsFeedItemId

The identity of the NewsFeedItem

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

GetNewsFeedItemAsync(int, CancellationToken)

Gets a NewsFeedItem object.

Declaration
public Task<NewsFeedItem> GetNewsFeedItemAsync(int newsFeedItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int newsFeedItemId

The identifier of the NewsFeedItem object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<NewsFeedItem>

A single NewsFeedItem

GetNewsFeedItemsByIdAsync(int[], CancellationToken)

Get an array of items from the newsfeed by id. If the current user cannot access a particular item, it will be excluded from the results.

Declaration
public Task<NewsFeedItem[]> GetNewsFeedItemsByIdAsync(int[] newsFeedItemIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] newsFeedItemIds

Ids of the news feed items to mark as seen for this user.

CancellationToken cancellationToken

This operation can be cancelled

Returns
Type Description
Task<NewsFeedItem[]>

The news feed items that was posted, or null if not found/not accessible by the user.

GetNewsItemsForUserAsync(int, DateTime, DateTime, int, int, CancellationToken)

Get a list of newsfeed items for a particular user between two dates. If the current user cannot access a particular item, it will be excluded from the results.

Declaration
public Task<NewsFeedItem[]> GetNewsItemsForUserAsync(int associateId, DateTime fromDate, DateTime toDate, int top, int skip, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

Id of the associate to fetch news feed items for. 0 = current user

DateTime fromDate

Start date for fetching news feed items.

DateTime toDate

End date for fetching news feed items.

int top

Maximum number of news feed items to return.

int skip

Number of news feed items to skip for paging.

CancellationToken cancellationToken

This operation can be cancelled

Returns
Type Description
Task<NewsFeedItem[]>

The news feed items that was posted, or null if not found/not accessible by the user.

MarkAsHandledAsync(int, CancellationToken)

Marks the news feed item as handled, so it can be removed from the feed.

Declaration
public Task<bool> MarkAsHandledAsync(int newsFeedItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int newsFeedItemId

Id of the news feed item to mark as handled for all users.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<bool>

Indicates if the news feed item was successfully marked as handled. False if it was already handled.

MarkAsReadAsync(int, CancellationToken)

Marks the news feed item as read, so it can be un-bolded in the current user's feed.

Declaration
public Task MarkAsReadAsync(int newsFeedItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int newsFeedItemId

Id of the news feed item to mark as seen for this user.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

PostNewsFeedItemAsync(NewsFeedItem, int[], int[], bool, CancellationToken)

Saves a new item to the newsfeed, publishing it to the specified users.

Declaration
public Task<NewsFeedItem> PostNewsFeedItemAsync(NewsFeedItem newsFeedItem, int[] toAssociateIds, int[] toGroupIds, bool toAll, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NewsFeedItem newsFeedItem

The news feed item to post. NewsFeedItemId is ignored, as a new id will be generated when posting to the newsfeed.

int[] toAssociateIds

List of associate ids that this news feed item is sent to.

int[] toGroupIds

List of group ids that this news feed item is sent to. This gets resolved to associate ids when posted.

bool toAll

Indicates if this news feed item is sent to all users. Gets resolved into all users when posted.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<NewsFeedItem>

The news feed item that was posted, including its new id.

StartHandlingAsync(int, CancellationToken)

Marks the news feed item as being handled, that CTA processing has started. i.e. other users should not start handling it also.

Declaration
public Task<bool> StartHandlingAsync(int newsFeedItemId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int newsFeedItemId

Id of the news feed item to mark as handled for all users.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<bool>

Indicates if the news feed item was successfully marked as being handled. False if it was already being handled or was handled.

Implements

INewsFeedAgent
IAgent
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top