Skip to main content

<a id=“SuperOffice_WebApi_Agents_DashboardAgent”></a> Class DashboardAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Agent lets you configure dashboard tiles and retrieve dashboard data

Inheritance

objectAgentBaseDashboardAgent

Implements

IAgentBase, IDashboardAgent, IDisposable

Inherited 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&gt;(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 (DashboardAgent agent = new DashboardAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

<a id=“SuperOffice_WebApi_Agents_DashboardAgent__ctor_System_Net_Http_HttpClient_”></a> DashboardAgent(HttpClient)

Constructor: Agent lets you configure dashboard tiles and retrieve dashboard data

Parameters

httpClient HttpClient Use this HTTP client instead of making own HttpClient instance.

<a id=“SuperOffice_WebApi_Agents_DashboardAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> DashboardAgent(WebApiOptions, HttpClient)

Constructor: Agent lets you configure dashboard tiles and retrieve dashboard data

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_DashboardAgent_CreateDefaultDashboardAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultDashboardAsync(RequestOptions)

Set default values into a new Dashboard. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Dashboard&gt; A blank Dashboard

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_CreateDefaultDashboardTileAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultDashboardTileAsync(RequestOptions)

Set default values into a new DashboardTile. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile&gt; A blank DashboardTile

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_CreateNewFromTemplateAsync_System_Int32_System_String_System_String_System_Int32_SuperOffice_WebApi_Data_VisibleFor___SuperOffice_WebApi_RequestOptions_”></a> CreateNewFromTemplateAsync(int, string, string, int, VisibleFor[], RequestOptions)

Create new tile from another tile used as template

Parameters

dashboardTileId int Tile template Id caption string Caption of new tile description string Description of new tile selectionId int Selection id of new tile visibleFor VisibleFor[] Who the tile should be visible for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile&gt; The new tile

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_DeleteDashboardAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteDashboardAsync(int, RequestOptions)

Deletes the Dashboard

Parameters

dashboardId int The identity of the Dashboard requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_DeleteDashboardTileAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteDashboardTileAsync(int, RequestOptions)

Deletes the DashboardTile

Parameters

dashboardTileId int The identity of the DashboardTile requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDashboardAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetDashboardAsync(int, RequestOptions)

Gets a specific Dashboard object.

Parameters

dashboardId int The identifier of the Dashboard object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Dashboard&gt; Dashboard

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDashboardTileAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetDashboardTileAsync(int, RequestOptions)

Gets a specific DashboardTile object.

Parameters

dashboardTileId int The identifier of the DashboardTile object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile&gt; DashboardTile

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDashboardTilesAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> GetDashboardTilesAsync(int[], RequestOptions)

Gets an array of dashboard tiles for the provided ids

Parameters

dashboardTileIds int[] The ids of the tiles to get requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile[]&gt; Dashboard tiles

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDashboardsAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetDashboardsAsync(int, RequestOptions)

Gets all dashboards for an associate

Parameters

associateId int Associate Id requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Dashboard[]&gt; All the users dashboards

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDataAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDataAsync(int, string, RequestOptions)

Get data for this tile

Parameters

dashboardTileId int Tile Id restrictions string Replacement restrictions requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TileData[]&gt; The data

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetDataWithSelectionAsync_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetDataWithSelectionAsync(int, int, string, RequestOptions)

Get data for this tile

Parameters

dashboardTileId int Tile Id selectionId int Selection Id restrictions string Replacement restrictions requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TileData[]&gt; The data

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_GetStandardDashboardTileFromChartIdAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetStandardDashboardTileFromChartIdAsync(string, RequestOptions)

Gets the standard tile (not personal tile) corresponding to the given chart id

Parameters

chartId string The ChartId of the wanted chart/tile requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile&gt; Standard tile

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_SaveDashboardAsync_SuperOffice_WebApi_Data_Dashboard_SuperOffice_WebApi_RequestOptions_”></a> SaveDashboardAsync(Dashboard, RequestOptions)

Updates the existing Dashboard or creates a new Dashboard if the id parameter is 0.

Parameters

dashboard Dashboard The Dashboard that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Dashboard&gt; New or updated Dashboard

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_SaveDashboardTileAsync_SuperOffice_WebApi_Data_DashboardTile_SuperOffice_WebApi_RequestOptions_”></a> SaveDashboardTileAsync(DashboardTile, RequestOptions)

Updates the existing DashboardTile or creates a new DashboardTile if the id parameter is 0.

Parameters

dashboardTile DashboardTile The DashboardTile that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<DashboardTile&gt; New or updated DashboardTile

<a id=“SuperOffice_WebApi_Agents_DashboardAgent_SetTileAsync_System_Int32_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SetTileAsync(int, int, int, RequestOptions)

Sets tile in the given dashboard position

Parameters

dashboardId int Dashboard Id tileId int Tile Id position int Tile position in the dashboard requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Dashboard&gt; The new dashboard is returned after the tile change