<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent”></a> Class ForeignSystemAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Collection of all services that works with Foreign key data (Key/Value pairs)
Inheritance
object ← AgentBase ← ForeignSystemAgentImplements
IForeignSystemAgent, IAgentBase, IDisposableInherited Members
AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T>(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()Examples
<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (ForeignSystemAgent agent = new ForeignSystemAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent__ctor_System_Net_Http_HttpClient_”></a> ForeignSystemAgent(HttpClient)
Constructor: Collection of all services that works with Foreign key data (Key/Value pairs)Parameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> ForeignSystemAgent(WebApiOptions, HttpClient)
Constructor: Collection of all services that works with Foreign key data (Key/Value pairs)Parameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_AddDeviceByIdentifierAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddDeviceByIdentifierAsync(string, string, string, RequestOptions)
Adds a new ForeignDevice with deviceName that belongs to the application with applicationName, with an optional device-specific identifier.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Unique id of device (Palm pilot device ID, version number, etc)
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> The ForeignDevice.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_AddForeignKeyAsync_SuperOffice_WebApi_Data_ForeignKey_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddForeignKeyAsync(ForeignKey, string, string, string, RequestOptions)
Add a new key belonging to the ForeignApp and ForeignDevice specified.Parameters
foreignKey ForeignKey
Foreign key to save
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier. Optional if device identifier is not used.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey> The new or updated ForeignKey<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_CreateDefaultForeignAppEntityAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultForeignAppEntityAsync(RequestOptions)
Set default values into a new ForeignAppEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignAppEntity> A blank ForeignAppEntity<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_DeleteDeviceByIdentifierAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> DeleteDeviceByIdentifierAsync(string, string, string, RequestOptions)
Delete a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Unique id of device (Palm pilot device ID, version number, etc)
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_DeleteForeignAppEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteForeignAppEntityAsync(int, RequestOptions)
Deletes the ForeignAppEntityParameters
foreignAppEntityId int
The identity of the ForeignAppEntity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_DeleteForeignDeviceAsync_SuperOffice_WebApi_Data_ForeignDevice_System_String_SuperOffice_WebApi_RequestOptions_”></a> DeleteForeignDeviceAsync(ForeignDevice, string, RequestOptions)
Deletes a foreign device from an applicationParameters
foreignDevice ForeignDevice
foreign device to delete
applicationName string
Name of application to delete from
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_DeleteForeignKeyAsync_SuperOffice_WebApi_Data_ForeignKey_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteForeignKeyAsync(ForeignKey, string, string, string, string, int, RequestOptions)
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.Parameters
foreignKey ForeignKey
Key name to delete.
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier. Optional if device identifier is not used.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_DeleteForeignKeyOnNameAsync_System_String_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteForeignKeyOnNameAsync(string, string, string, string, string, int, RequestOptions)
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.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier. Optional if device identifier is not used.
keyName string
The name of the foreign key to delete.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return value<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetAllForeignKeysOnEntityAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetAllForeignKeysOnEntityAsync(string, int, RequestOptions)
Get a list of foreignkeys (‘app.device.key’) and their values (‘123’) that belong to the specified entity.Parameters
entityType string
Entity type (table name): ‘contact’, ‘project’ etc.
entityId int
Primary key of Entity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StringDictionary> Dictionary of ‘appname.deviceid.keyname’ = ‘123’ key values<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetAppByNameAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetAppByNameAsync(string, RequestOptions)
Gets the ForeignApp with the given name.Parameters
applicationName string
The name of the foreign application.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignAppEntity> The ForeignApp that matches the name.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetApplicationDevicesAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetApplicationDevicesAsync(string, RequestOptions)
Gets all devices that belong to a foreign application.Parameters
applicationName string
The foreign application name
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice[]> Array of ForeignDevices<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetApplicationKeysAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetApplicationKeysAsync(string, RequestOptions)
Returns all ForeignKeys that belong to an application.Parameters
applicationName string
The name of the foreign application.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey[]> Array of all ForeignKeys in the ForeignApp.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceByIdentifierAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceByIdentifierAsync(string, string, string, RequestOptions)
Gets a ForeignDevice with deviceName and deviceIdentifier that belongs to the application with applicationName.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Optional unique id of device (Palm pilot device ID, version number, etc)
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> The ForeignDevice.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceByNameAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceByNameAsync(string, string, RequestOptions)
Gets a ForeignDevice with deviceName that belongs to the application with applicationName.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> The ForeignDevice.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceKeysAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceKeysAsync(string, string, RequestOptions)
Returns all ForeignKeys that belong to a device.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey[]> Array of all ForeignKeys in the ForeignDevice.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceKeysOnDeviceIdentifierAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceKeysOnDeviceIdentifierAsync(string, string, string, RequestOptions)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Identifier for a unique grouping of keys within a device.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey[]> Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceKeysOnDeviceIdentifierTableAsync_System_String_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceKeysOnDeviceIdentifierTableAsync(string, string, string, string, RequestOptions)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Identifier for a unique grouping of keys within a device.
tableName string
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey[]> Array of all ForeignKeys in the ForeignDevice that belong to the DeviceIdentifier.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetDeviceKeysOnDeviceIdentifierTableRecordIdAsync_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetDeviceKeysOnDeviceIdentifierTableRecordIdAsync(string, string, string, string, int, RequestOptions)
Returns all ForeignKeys that belong to a device with a given deviceIdentifier and table name, as well as record id.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Identifier for a unique grouping of keys within a device.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey[]> Array of all ForeignKeys in the ForeignDevice that match the criteria<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetForeignAppEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetForeignAppEntityAsync(int, RequestOptions)
Gets a specific ForeignAppEntity object.Parameters
foreignAppEntityId int
The identifier of the ForeignAppEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignAppEntity> ForeignAppEntity<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetForeignDeviceAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetForeignDeviceAsync(int, RequestOptions)
Gets a specific ForeignDevice object.Parameters
foreignDeviceId int
The identifier of the ForeignDevice object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> ForeignDevice<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyAsync_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetKeyAsync(string, string, string, string, int, RequestOptions)
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.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
keyName string
The name of the foreign key.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey> The ForeignKey.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyByValueAndIdentifierAsync_System_String_System_String_System_String_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetKeyByValueAndIdentifierAsync(string, string, string, string, string, string, RequestOptions)
Get a foreignkey based on its name and value, that belongs to the specified deviceId, device, and application.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier. Optional if device identifier is not used.
keyName string
The name of the foreign key.
keyValue string
Foreignkey value
tableName string
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey> The ForeignKey.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyByValueAsync_System_String_System_String_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetKeyByValueAsync(string, string, string, string, string, RequestOptions)
Get a foreignkey based on its name and value, that belongs to the specified device and application.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
keyName string
The name of the foreign key.
keyValue string
Foreignkey value
tableName string
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey> The ForeignKey.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyOnDeviceIdentifierAsync_System_String_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetKeyOnDeviceIdentifierAsync(string, string, string, string, string, int, RequestOptions)
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.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier.
keyName string
The name of the foreign key.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignKey> The ForeignKey.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyValueAsync_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetKeyValueAsync(string, string, string, string, int, RequestOptions)
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.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
keyName string
The name of the foreign key.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> The ForeignKey value as string.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_GetKeyValueOnDeviceIdentifierAsync_System_String_System_String_System_String_System_String_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetKeyValueOnDeviceIdentifierAsync(string, string, string, string, string, int, RequestOptions)
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.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier.
keyName string
The name of the foreign key.
tableName string
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.
recordId int
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.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> The ForeignKey’s string value.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_SaveDeviceByIdentifierAsync_System_String_System_String_System_String_SuperOffice_WebApi_Data_ForeignDevice_SuperOffice_WebApi_RequestOptions_”></a> SaveDeviceByIdentifierAsync(string, string, string, ForeignDevice, RequestOptions)
Updates a ForeignDevice with deviceName that belongs to the application with applicationName.Parameters
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
Unique id of device (Palm pilot device ID, version number, etc)
foreignDevice ForeignDevice
Foreign device to save. Can be null if adding new device.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> The ForeignDevice.<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_SaveForeignAppEntityAsync_SuperOffice_WebApi_Data_ForeignAppEntity_SuperOffice_WebApi_RequestOptions_”></a> SaveForeignAppEntityAsync(ForeignAppEntity, RequestOptions)
Updates the existing ForeignAppEntity or creates a new ForeignAppEntity if the id parameter is 0.Parameters
foreignAppEntity ForeignAppEntity
The ForeignAppEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignAppEntity> New or updated ForeignAppEntity<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_SaveForeignDeviceAsync_SuperOffice_WebApi_Data_ForeignDevice_System_String_SuperOffice_WebApi_RequestOptions_”></a> SaveForeignDeviceAsync(ForeignDevice, string, RequestOptions)
Saves a foreign device for an foreign applicationParameters
foreignDevice ForeignDevice
Foreign device to save
applicationName string
The name of the foreign application.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ForeignDevice> Returns the saved foreign device<a id=“SuperOffice_WebApi_Agents_ForeignSystemAgent_SaveForeignKeyAsync_SuperOffice_WebApi_Data_ForeignKey_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> SaveForeignKeyAsync(ForeignKey, string, string, string, RequestOptions)
Saves a key belonging to the ForeignApp and ForeignDevice specified.Parameters
foreignKey ForeignKey
Foreign key to save
applicationName string
The name of the foreign application.
deviceName string
The name of the foreign device.
deviceIdentifier string
The device identifier. Optional if device identifier is not used.
requestOptions RequestOptions
Override language/culture codes on this request.