Skip to main content

<a id=“SuperOffice_WebApi_Agents_SentryAgent”></a> Class SentryAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Data and function right queries

Inheritance

objectAgentBaseSentryAgent

Implements

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

Constructors

<a id=“SuperOffice_WebApi_Agents_SentryAgent__ctor_System_Net_Http_HttpClient_”></a> SentryAgent(HttpClient)

Constructor: Data and function right queries

Parameters

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

<a id=“SuperOffice_WebApi_Agents_SentryAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> SentryAgent(WebApiOptions, HttpClient)

Constructor: Data and function right queries

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_SentryAgent_CanCreateAppointmentInAllDiariesAsync_SuperOffice_WebApi_RequestOptions_”></a> CanCreateAppointmentInAllDiariesAsync(RequestOptions)

CanCreateAppointmentInAllDiaries will check if the current associate can create appointments in diaries belonging all other associates. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.

<a id=“SuperOffice_WebApi_Agents_SentryAgent_CanCreateAppointmentInAssociateDiariesAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> CanCreateAppointmentInAssociateDiariesAsync(int[], RequestOptions)

CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.

Parameters

associateIds int[] Array of associate ids to check. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.

<a id=“SuperOffice_WebApi_Agents_SentryAgent_CanCreateAppointmentInEachAssociatesDiaryAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> CanCreateAppointmentInEachAssociatesDiaryAsync(int[], RequestOptions)

CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.

Parameters

associateIds int[] Array of associate ids to check. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool[]&gt; Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.

<a id=“SuperOffice_WebApi_Agents_SentryAgent_GetFunctionRightsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetFunctionRightsAsync(RequestOptions)

Get a string array of all functions rights for the role of the current associate.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string[]&gt; String array with the technical names of assigned function rights

<a id=“SuperOffice_WebApi_Agents_SentryAgent_GetNewTableRightAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetNewTableRightAsync(string, RequestOptions)

Returns a TableRight for a new row based on tableName parameter.

Parameters

tableName string Name of the table to get the TableRights from requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TableRight&gt; The TableRight

<a id=“SuperOffice_WebApi_Agents_SentryAgent_GetTableRightByContactOwnershipAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetTableRightByContactOwnershipAsync(string, int, RequestOptions)

Return the TableRight from the relationship between the current user and the given user and group.

Parameters

tableName string Name of the table to get the TableRights from. contactId int The owner contact. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TableRight&gt; The TableRight

<a id=“SuperOffice_WebApi_Agents_SentryAgent_GetTableRightByOwnershipAsync_System_String_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetTableRightByOwnershipAsync(string, int, int, RequestOptions)

Return the TableRight from the relationship between the current user and the given user and group.

Parameters

tableName string Name of the table to get the TableRights from. contactGroupId int The user-group that the associate id is part of. contactAssociateId int The associate id of the owner of the record requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TableRight&gt; The TableRight

<a id=“SuperOffice_WebApi_Agents_SentryAgent_HasFunctionRightAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> HasFunctionRightAsync(string, RequestOptions)

Get a boolean value indicating if the current user has the functional right.

Parameters

functionRight string Function right to check. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt;