Show / Hide Table of Contents

Class PocketAgent

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

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

Constructors

PocketAgent(ICallerIDImplementation, IPocketStartupDataImplementation, ISoRequestItemsAccessor)

Declaration
public PocketAgent(ICallerIDImplementation callerIDImplementation, IPocketStartupDataImplementation pocketStartupDataImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type Name Description
ICallerIDImplementation callerIDImplementation
IPocketStartupDataImplementation pocketStartupDataImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor

PocketAgent(ICallerIDImplementation, IPocketStartupDataImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)

Declaration
public PocketAgent(ICallerIDImplementation callerIDImplementation, IPocketStartupDataImplementation pocketStartupDataImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
Type Name Description
ICallerIDImplementation callerIDImplementation
IPocketStartupDataImplementation pocketStartupDataImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor
SuperOffice.Data.IDebugUser debugUser
SuperOffice.Diagnostics.IServiceCallsRepository serviceCallsRepository
SuperOffice.Configuration.ConfigFile.IScriptingConfiguration scriptingConfiguration
SuperOffice.Configuration.ConfigFile.IOnlineConfiguration onlineConfiguration

Methods

GetCallerIDsFromSelectionAsync(int, string, CancellationToken)

Get caller ids from a selection. Queries the shadow selection of persons and companies, so selections of any kind can be used

Declaration
public Task<CallerIDCollection> GetCallerIDsFromSelectionAsync(int selectionId, string lastHash, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int selectionId

Id of selection to get caller ids from

string lastHash

Hash for the previous call, used for checking if the same set of caller ids was sent in an earlier call, and returning null in that case

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskCallerIDCollection

Collection of caller IDs, containing the hash of the caller ids

GetMyCallerIDsAsync(string, DateTime, DateTime, CancellationToken)

Get caller ids that the current principal might be interested in (phone numbers of related persons in sales and appointments created/owned/touched by ourselves or colleagues in our primary group

Declaration
public Task<CallerIDCollection> GetMyCallerIDsAsync(string lastHash, DateTime minDate, DateTime maxDate, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string lastHash

Hash for the previous call, used for checking if the same set of caller ids was sent in a previous call, and returning null in that case

DateTime minDate

Only check activities after this date

DateTime maxDate

Only check activities before this date

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskCallerIDCollection

Collection of caller IDs, containing the hash of the caller ids

GetPocketStartupDataAsync(string[], DateTime, CancellationToken)

Declaration
public Task<PocketStartupData> GetPocketStartupDataAsync(string[] tables, DateTime currentClientTime, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tables

Tables to check for license

DateTime currentClientTime

Current time on the client, used for overdue sale lookup having correct timezone relative to client

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskPocketStartupData

Startup data for pocket

GetPushNotificationTagsForDeviceAsync(string, CancellationToken)

Retrieve current tag value for a device

Declaration
public Task<string> GetPushNotificationTagsForDeviceAsync(string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deviceIdentifier

The unique identifier of this device

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Taskstring

A comma separated list of events this device should receive push events for

GetRegisteredDevicesAsync(int, CancellationToken)

Retrieve all registered devices for an associate

Declaration
public Task<PocketDeviceInfo[]> GetRegisteredDevicesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

The user to get devices for

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskPocketDeviceInfo

NotificationHandledAsync(NotificationEventType, int, CancellationToken)

Mark a notification as handled, so it can be cleaned up on other clients that have received the notification

Declaration
public Task NotificationHandledAsync(NotificationEventType notificationEventType, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SuperOffice.Data.NotificationEventType notificationEventType

Type of notification

int id

Id of entity to notify about

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

NotificationsHandledAsync(NotificationEvent[], CancellationToken)

Mark a set of notifications as handled, so they can be cleaned up on other clients that have received the notification

Declaration
public Task NotificationsHandledAsync(NotificationEvent[] notificationEvents, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NotificationEvent notificationEvents

List of notifications to mark as handled

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

NotifyUsersAsync(NotificationEventType, int, CancellationToken)

Notify users about a new or changed entity

Declaration
public Task NotifyUsersAsync(NotificationEventType notificationEventType, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SuperOffice.Data.NotificationEventType notificationEventType

Type of notification

int id

Id of entity to notify about

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

RegisterDeviceForPushNotificationAsync(PocketDeviceInfo, CancellationToken)

Register a device that should receive push notifications when notable events occour

Declaration
public Task RegisterDeviceForPushNotificationAsync(PocketDeviceInfo deviceInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PocketDeviceInfo deviceInfo

Properties for the device to register

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

RunAppointmentAlarmBrokerAsync(CancellationToken)

Execute the AppointmentAlarmBroker once

Declaration
public Task RunAppointmentAlarmBrokerAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

SendPushNotificationAsync(int[], PocketNotificationMessage, CancellationToken)

Send a push notification to one or more associates

Declaration
public Task SendPushNotificationAsync(int[] associateIds, PocketNotificationMessage message, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateIds

The associates to send the push notification message to

PocketNotificationMessage message

The message to send

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

SetPushNotificationTagsForDeviceAsync(string, string, CancellationToken)

Specify what kind of notification events a device should receive push notifications for

Declaration
public Task SetPushNotificationTagsForDeviceAsync(string deviceIdentifier, string tags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string deviceIdentifier

The unique identifier for a device

string tags

A comma separated list of events this device should receive push events for

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

SetPushNotificationTagsForUserAsync(int, string, CancellationToken)

Specify what kind of notification events a user should receive push notifications for. This will update all registerred devices for this user.

Declaration
public Task SetPushNotificationTagsForUserAsync(int associateId, string tags, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

The associate to set tags for

string tags

A comma separated list of events the associate should receive push events for

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

Implements

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