Interface IForeignSystemAgent
Interface for the ForeignSystem Agent Collection of all services that works with Foreign key data (Key/Value pairs)
Namespace: SuperOfficeCRMServices
Assembly: SuperOffice.Services.dll
Syntax
[Agent("ForeignSystem Agent", "Interface for the ForeignSystem Agent. Collection of all services that works with Foreign key data (Key/Value pairs)")]
public interface IForeignSystemAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ForeignSystemAgent agent = new ForeignSystemAgent())
{
// call methods on agent here...
}
}
Methods
AddDeviceByIdentifierAsync(string, string, string, CancellationToken)
Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.
Declaration
Task<ForeignDevice> AddDeviceByIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Unique id of device (Palm pilot device ID, version number, etc) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | The ForeignDevice. |
AddForeignKeyAsync(ForeignKey, string, string, string, CancellationToken)
Add a new key belonging to the ForeignApp and ForeignDevice specified.
Declaration
Task<ForeignKey> AddForeignKeyAsync(ForeignKey foreignKey, string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignKey | foreignKey | Foreign key to save |
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. Optional if device identifier is not used. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The new or updated ForeignKey |
CreateDefaultForeignAppEntityAsync(CancellationToken)
Loading default values into a new ForeignAppEntity.
Declaration
Task<ForeignAppEntity> CreateDefaultForeignAppEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignAppEntity | New ForeignAppEntity with default values |
DeleteDeviceByIdentifierAsync(string, string, string, CancellationToken)
Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
Declaration
Task DeleteDeviceByIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Unique id of device (Palm pilot device ID, version number, etc) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteForeignAppEntityAsync(int, CancellationToken)
Deletes the ForeignAppEntity
Declaration
Task DeleteForeignAppEntityAsync(int foreignAppEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | foreignAppEntityId | The identity of the ForeignAppEntity |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteForeignDeviceAsync(ForeignDevice, string, CancellationToken)
Deletes a foreign device from an application
Declaration
Task DeleteForeignDeviceAsync(ForeignDevice foreignDevice, string applicationName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignDevice | foreignDevice | foreign device to delete |
| string | applicationName | Name of application to delete from |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
DeleteForeignKeyAsync(ForeignKey, string, string, string, string, int, CancellationToken)
Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
Declaration
Task DeleteForeignKeyAsync(ForeignKey foreignKey, string applicationName, string deviceName, string deviceIdentifier, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignKey | foreignKey | Key name to delete. |
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. Optional if device identifier is not used. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteForeignKeyOnNameAsync(string, string, string, string, string, int, CancellationToken)
Deletes all specified occurrences of a key, belonging to the ForeignApp and ForeignDevice, table and record specified. Specifying a blank table name will delete ALL keys of the given name; specifying a recordId of 0 will delete ALL keys of the given name for the given table.
Declaration
Task DeleteForeignKeyOnNameAsync(string applicationName, string deviceName, string deviceIdentifier, string keyName, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. Optional if device identifier is not used. |
| string | keyName | The name of the foreign key to delete. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to delete ALL keys that otherwise match; this may be dangerous and can take a long time if there are many items to delete. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table.<p/>Specifying a zero recordId will remove the recordId restriction and delete all keys that otherwise match. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
GetAllForeignKeysOnEntityAsync(string, int, CancellationToken)
Get a list of foreignkeys ('app.device.key') and their values ('123') that belong to the specified entity.
Declaration
Task<StringDictionary> GetAllForeignKeysOnEntityAsync(string entityType, int entityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | entityType | Entity type (table name): 'contact', 'project' etc. |
| int | entityId | Primary key of Entity |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskSuperOffice.CRM.Services.StringDictionary | Dictionary of 'appname.deviceid.keyname' = '123' key values |
GetAppByNameAsync(string, CancellationToken)
Gets the ForeignApp with the given name.
Declaration
Task<ForeignAppEntity> GetAppByNameAsync(string applicationName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignAppEntity | The ForeignApp that matches the name. |
GetApplicationDevicesAsync(string, CancellationToken)
Gets all devices that belong to a foreign application.
Declaration
Task<ForeignDevice[]> GetApplicationDevicesAsync(string applicationName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The foreign application name |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | Array of ForeignDevices |
GetApplicationKeysAsync(string, CancellationToken)
Returns all ForeignKeys that belong to an application.
Declaration
Task<ForeignKey[]> GetApplicationKeysAsync(string applicationName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | Array of all ForeignKeys in the ForeignApp. |
GetDeviceByIdentifierAsync(string, string, string, CancellationToken)
Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.
Declaration
Task<ForeignDevice> GetDeviceByIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Optional unique id of device (Palm pilot device ID, version number, etc) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | The ForeignDevice. |
GetDeviceByNameAsync(string, string, CancellationToken)
Gets a ForeignDevice with deviceName that belongs to the application with applicationName.
Declaration
Task<ForeignDevice> GetDeviceByNameAsync(string applicationName, string deviceName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | The ForeignDevice. |
GetDeviceKeysAsync(string, string, CancellationToken)
Returns all ForeignKeys that belong to a device.
Declaration
Task<ForeignKey[]> GetDeviceKeysAsync(string applicationName, string deviceName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | Array of all ForeignKeys in the ForeignDevice. |
GetDeviceKeysOnDeviceIdentifierAsync(string, string, string, CancellationToken)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier.
Declaration
Task<ForeignKey[]> GetDeviceKeysOnDeviceIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Identifier for a unique grouping of keys within a device. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier. |
GetDeviceKeysOnDeviceIdentifierTableAsync(string, string, string, string, CancellationToken)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.
Declaration
Task<ForeignKey[]> GetDeviceKeysOnDeviceIdentifierTableAsync(string applicationName, string deviceName, string deviceIdentifier, string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Identifier for a unique grouping of keys within a device. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier. |
GetDeviceKeysOnDeviceIdentifierTableRecordIdAsync(string, string, string, string, int, CancellationToken)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.
Declaration
Task<ForeignKey[]> GetDeviceKeysOnDeviceIdentifierTableRecordIdAsync(string applicationName, string deviceName, string deviceIdentifier, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Identifier for a unique grouping of keys within a device. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | Array of all ForeignKeys in the ForeignDevice that match the criteria |
GetForeignAppEntityAsync(int, CancellationToken)
Gets a ForeignAppEntity object.
Declaration
Task<ForeignAppEntity> GetForeignAppEntityAsync(int foreignAppEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | foreignAppEntityId | The identifier of the ForeignAppEntity object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignAppEntity | A single ForeignAppEntity |
GetForeignDeviceAsync(int, CancellationToken)
Gets a ForeignDevice object.
Declaration
Task<ForeignDevice> GetForeignDeviceAsync(int foreignDeviceId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | foreignDeviceId | The identifier of the ForeignDevice object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | A single ForeignDevice |
GetKeyAsync(string, string, string, string, int, CancellationToken)
Returning a foreign key by its key name, that belongs to the specified device and application. A table name and record ID can also be specified.
Declaration
Task<ForeignKey> GetKeyAsync(string applicationName, string deviceName, string keyName, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | keyName | The name of the foreign key. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The ForeignKey. |
GetKeyByValueAndIdentifierAsync(string, string, string, string, string, string, CancellationToken)
Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.
Declaration
Task<ForeignKey> GetKeyByValueAndIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, string keyName, string keyValue, string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. Optional if device identifier is not used. |
| string | keyName | The name of the foreign key. |
| string | keyValue | Foreignkey value |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The ForeignKey. |
GetKeyByValueAsync(string, string, string, string, string, CancellationToken)
Get a foreignkey based on its name and value, that belongs to the specified device and application.
Declaration
Task<ForeignKey> GetKeyByValueAsync(string applicationName, string deviceName, string keyName, string keyValue, string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | keyName | The name of the foreign key. |
| string | keyValue | Foreignkey value |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The ForeignKey. |
GetKeyOnDeviceIdentifierAsync(string, string, string, string, string, int, CancellationToken)
Returning a foreign key by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
Declaration
Task<ForeignKey> GetKeyOnDeviceIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, string keyName, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. |
| string | keyName | The name of the foreign key. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The ForeignKey. |
GetKeyValueAsync(string, string, string, string, int, CancellationToken)
Gets the string value of a ForeignKey, that belongs to the specified device and application. The table name and record ID must also be specified.
Declaration
Task<string> GetKeyValueAsync(string applicationName, string deviceName, string keyName, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | keyName | The name of the foreign key. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskstring | The ForeignKey value as string. |
GetKeyValueOnDeviceIdentifierAsync(string, string, string, string, string, int, CancellationToken)
Returning a foreign key string value by its key name and device identifier, that belongs to the specified device and application. A table name and record ID can also be specified.
Declaration
Task<string> GetKeyValueOnDeviceIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, string keyName, string tableName, int recordId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. |
| string | keyName | The name of the foreign key. |
| string | tableName | Table name, transformed to and from numeric table id by the service layer.<p/>Use an empty string to indicate that your key is not bound to any specific table. |
| int | recordId | Id of record that this key refers to. If the table name was blank, then this parameter must be 0. It can also be 0 to mean that the foreign key record was not bound to any particular record of the target table. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskstring | The ForeignKey's string value. |
SaveDeviceByIdentifierAsync(string, string, string, ForeignDevice, CancellationToken)
Updates a ForeignDevice with deviceName that belongs to the application with applicationName.
Declaration
Task<ForeignDevice> SaveDeviceByIdentifierAsync(string applicationName, string deviceName, string deviceIdentifier, ForeignDevice foreignDevice, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | Unique id of device (Palm pilot device ID, version number, etc) |
| ForeignDevice | foreignDevice | Foreign device to save. Can be null if adding new device. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | The ForeignDevice. |
SaveForeignAppEntityAsync(ForeignAppEntity, CancellationToken)
Updates the existing ForeignAppEntity or creates a new ForeignAppEntity if the id parameter is 0.
Declaration
Task<ForeignAppEntity> SaveForeignAppEntityAsync(ForeignAppEntity foreignAppEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignAppEntity | foreignAppEntity | The ForeignAppEntity that is saved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignAppEntity | New or updated ForeignAppEntity |
SaveForeignDeviceAsync(ForeignDevice, string, CancellationToken)
Saves a foreign device for an foreign application
Declaration
Task<ForeignDevice> SaveForeignDeviceAsync(ForeignDevice foreignDevice, string applicationName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignDevice | foreignDevice | Foreign device to save |
| string | applicationName | The name of the foreign application. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignDevice | Returns the saved foreign device |
SaveForeignKeyAsync(ForeignKey, string, string, string, CancellationToken)
Saves a key belonging to the ForeignApp and ForeignDevice specified.
Declaration
Task<ForeignKey> SaveForeignKeyAsync(ForeignKey foreignKey, string applicationName, string deviceName, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ForeignKey | foreignKey | Foreign key to save |
| string | applicationName | The name of the foreign application. |
| string | deviceName | The name of the foreign device. |
| string | deviceIdentifier | The device identifier. Optional if device identifier is not used. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskForeignKey | The new or updated ForeignKey |