Skip to main content

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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