Skip to main content

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent”></a> Class FavouriteAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Agent used for retrieveing and setting favourites

Inheritance

objectAgentBaseFavouriteAgent

Implements

IFavouriteAgent, IAgentBase, 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 (FavouriteAgent agent = new FavouriteAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent__ctor_System_Net_Http_HttpClient_”></a> FavouriteAgent(HttpClient)

Constructor: Agent used for retrieveing and setting favourites

Parameters

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

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> FavouriteAgent(WebApiOptions, HttpClient)

Constructor: Agent used for retrieveing and setting favourites

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_FavouriteAgent_AddFavouriteAsync_System_String_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddFavouriteAsync(string, int, int, string, RequestOptions)

Add a record in a table as a favourite for an associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordId int Id of a record in your specified table (tableName) associateId int Id of a current user extraInfo string Any extra information requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_AddFavouritesAsync_System_String_System_Int32___System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddFavouritesAsync(string, int[], int, string, RequestOptions)

Add a list of record ids as favourites for an associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordIds int[] Ids of records in your specified table (tableName). Corresponding rows will be added as Favourites. associateId int Id of a current user extraInfo string Any extra information requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_AddTicketsToFavouritesByProviderAsync_System_String_SuperOffice_WebApi_Data_ArchiveRestrictionInfo___System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddTicketsToFavouritesByProviderAsync(string, ArchiveRestrictionInfo[], int, string, RequestOptions)

Add a list of tickets as favourites that are given by the ticket provider.

Parameters

providerName string Name of a ticket provider restrictions ArchiveRestrictionInfo[] Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. associateId int Id of a current user extraInfo string Any extra information requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_GetFavouritesAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetFavouritesAsync(string, int, RequestOptions)

Get all favourites for a table and associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Favourite[]&gt; Requested favourites for a table and associate

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_IsFavouriteAsync_System_String_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> IsFavouriteAsync(string, int, int, RequestOptions)

Checks if a record in a table is a favourite for an associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordId int Id of a record in your specified table (tableName) associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; Is Favourite?

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_RemoveAllFavouritesAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveAllFavouritesAsync(string, int, RequestOptions)

Remove all favourites for a table and associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_RemoveFavouriteAsync_System_String_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveFavouriteAsync(string, int, int, RequestOptions)

Remove favourite for a table, record id and associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordId int Id of a record in your specified table (tableName) associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_RemoveFavouritesAsync_System_String_System_Int32___System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveFavouritesAsync(string, int[], int, RequestOptions)

Remove a list of record ids from favourites for an associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordIds int[] Ids of records in your specified table (tableName). Corresponding rows will be removed from Favourites. associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_RemoveFavouritesByIdAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> RemoveFavouritesByIdAsync(int[], RequestOptions)

Remove favourite using favourite id

Parameters

favouriteIds int[] Ids of favourite rows to delete requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_RemoveTicketsFromFavouritesByProviderAsync_System_String_SuperOffice_WebApi_Data_ArchiveRestrictionInfo___System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveTicketsFromFavouritesByProviderAsync(string, ArchiveRestrictionInfo[], int, RequestOptions)

Remove a list of tickets from favourites that are given by the ticket provider.

Parameters

providerName string Name of a ticket provider restrictions ArchiveRestrictionInfo[] Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. associateId int Id of a current user requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_FavouriteAgent_ToggleFavouriteAsync_System_String_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> ToggleFavouriteAsync(string, int, int, string, RequestOptions)

Toggle a record in a table as a favourite for an associate

Parameters

tableName string Table name, transformed to and from numeric table id by the service layer. recordId int Id of a record in your specified table (tableName) associateId int Id of a current user extraInfo string Any extra information requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; Return the new value, true if added, false if removed