> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.SaintAgent

# \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent">\</a> Class SaintAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Administration and maintenance of SAINT counters and statuses

```csharp theme={null}
public class SaintAgent : AgentBase, ISaintAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[SaintAgent](SuperOffice.WebApi.Agents.SaintAgent.md)

#### Implements

[ISaintAgent](SuperOffice.WebApi.Agents.ISaintAgent.md),
[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](http://example.com/super/api)");
mySession.Authorization = new AuthorizationUsernamePassword("user", "pass");
using (SaintAgent agent = new SaintAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_\_ctor\_System\_Net\_Http\_HttpClient\_">\</a> SaintAgent(HttpClient)

Constructor: Administration and maintenance of SAINT counters and statuses

```csharp theme={null}
public SaintAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Use this HTTP client instead of making own HttpClient instance.

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> SaintAgent(WebApiOptions, HttpClient)

Constructor: Administration and maintenance of SAINT counters and statuses

```csharp theme={null}
public SaintAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Optional: Use this HTTP client instead of making a new one.

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_CreateDefaultSaintConfigurationAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultSaintConfigurationAsync(RequestOptions)

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

```csharp theme={null}
public Task<SaintConfiguration> CreateDefaultSaintConfigurationAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SaintConfiguration](SuperOffice.WebApi.Data.SaintConfiguration.md)\&gt;

A blank SaintConfiguration

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_CreateDefaultStatusMonitorAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultStatusMonitorAsync(RequestOptions)

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

```csharp theme={null}
public Task<StatusMonitor> CreateDefaultStatusMonitorAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitor](SuperOffice.WebApi.Data.StatusMonitor.md)\&gt;

A blank StatusMonitor

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_CreateDefaultStatusMonitorPeriodsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultStatusMonitorPeriodsAsync(RequestOptions)

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

```csharp theme={null}
public Task<StatusMonitorPeriods> CreateDefaultStatusMonitorPeriodsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitorPeriods](SuperOffice.WebApi.Data.StatusMonitorPeriods.md)\&gt;

A blank StatusMonitorPeriods

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_GetSaintConfigurationsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSaintConfigurationsAsync(RequestOptions)

Returns the StatusMonitorPeriods entity.

```csharp theme={null}
public Task<SaintConfiguration[]> GetSaintConfigurationsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SaintConfiguration](SuperOffice.WebApi.Data.SaintConfiguration.md)\[]\&gt;

The SaintConfiguration for all entities

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_GetStatusMonitorAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetStatusMonitorAsync(int, RequestOptions)

Get a single status monitor based on its identity

```csharp theme={null}
public Task<StatusMonitor> GetStatusMonitorAsync(int id, RequestOptions requestOptions = null)
```

#### Parameters

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Identity of status monitor

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitor](SuperOffice.WebApi.Data.StatusMonitor.md)\&gt;

The requested status monitor

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_GetStatusMonitorPeriodsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetStatusMonitorPeriodsAsync(RequestOptions)

Returns the StatusMonitorPeriods entity.

```csharp theme={null}
public Task<StatusMonitorPeriods> GetStatusMonitorPeriodsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitorPeriods](SuperOffice.WebApi.Data.StatusMonitorPeriods.md)\&gt;

The StatusMonitorEntity

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_GetStatusMonitorsAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetStatusMonitorsAsync(int, string, RequestOptions)

Get all active status monitors for a specified target

```csharp theme={null}
public Task<StatusMonitor[]> GetStatusMonitorsAsync(int id, string type, RequestOptions requestOptions = null)
```

#### Parameters

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Identity of target type(contact identity, project identity etc.)

`type` [string](https://learn.microsoft.com/dotnet/api/system.string)

Type to get status monitors for("contact", "project", etc.)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitor](SuperOffice.WebApi.Data.StatusMonitor.md)\[]\&gt;

Active status monitors

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_RegenerateCountersAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegenerateCountersAsync(bool, RequestOptions)

Regenerate the Saint counters - this can take several minutes

```csharp theme={null}
public Task<BatchTaskInfo> RegenerateCountersAsync(bool runAsBatch, RequestOptions requestOptions = null)
```

#### Parameters

`runAsBatch` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, then execute the regeneration as a Batch Task; the service call will return immediately. Otherwise wait until the task completes, may cause a timeout if called as a Web Service

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[BatchTaskInfo](SuperOffice.WebApi.Data.BatchTaskInfo.md)\&gt;

Information about the batch task, if batch execution was requested. Otherwise null

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_RegenerateStatusMonitorAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegenerateStatusMonitorAsync(int, RequestOptions)

Regenerate the given status monitor

```csharp theme={null}
public Task RegenerateStatusMonitorAsync(int statusMonitorId, RequestOptions requestOptions = null)
```

#### Parameters

`statusMonitorId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the statusmonitor to regenerate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_RegenerateStatusMonitorsAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RegenerateStatusMonitorsAsync(bool, RequestOptions)

Regenerate status monitors

```csharp theme={null}
public Task<BatchTaskInfo> RegenerateStatusMonitorsAsync(bool runAsBatch, RequestOptions requestOptions = null)
```

#### Parameters

`runAsBatch` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, then execute the regeneration as a Batch Task; the service call will return immediately. Otherwise wait until the task completes, may cause a timeout if called as a Web Service

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[BatchTaskInfo](SuperOffice.WebApi.Data.BatchTaskInfo.md)\&gt;

Information about the batch task, if batch execution was requested. Otherwise null

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_SaveSaintConfigurationAsync\_SuperOffice\_WebApi\_Data\_SaintConfiguration\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveSaintConfigurationAsync(SaintConfiguration, RequestOptions)

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

```csharp theme={null}
public Task<SaintConfiguration> SaveSaintConfigurationAsync(SaintConfiguration saintConfiguration, RequestOptions requestOptions = null)
```

#### Parameters

`saintConfiguration` [SaintConfiguration](SuperOffice.WebApi.Data.SaintConfiguration.md)

The SaintConfiguration that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SaintConfiguration](SuperOffice.WebApi.Data.SaintConfiguration.md)\&gt;

New or updated SaintConfiguration

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_SaveStatusMonitorAsync\_SuperOffice\_WebApi\_Data\_StatusMonitor\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveStatusMonitorAsync(StatusMonitor, RequestOptions)

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

```csharp theme={null}
public Task<StatusMonitor> SaveStatusMonitorAsync(StatusMonitor statusMonitor, RequestOptions requestOptions = null)
```

#### Parameters

`statusMonitor` [StatusMonitor](SuperOffice.WebApi.Data.StatusMonitor.md)

The StatusMonitor that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitor](SuperOffice.WebApi.Data.StatusMonitor.md)\&gt;

New or updated StatusMonitor

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_SaveStatusMonitorPeriodsAsync\_SuperOffice\_WebApi\_Data\_StatusMonitorPeriods\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveStatusMonitorPeriodsAsync(StatusMonitorPeriods, RequestOptions)

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

```csharp theme={null}
public Task<StatusMonitorPeriods> SaveStatusMonitorPeriodsAsync(StatusMonitorPeriods statusMonitorPeriods, RequestOptions requestOptions = null)
```

#### Parameters

`statusMonitorPeriods` [StatusMonitorPeriods](SuperOffice.WebApi.Data.StatusMonitorPeriods.md)

The StatusMonitorPeriods that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatusMonitorPeriods](SuperOffice.WebApi.Data.StatusMonitorPeriods.md)\&gt;

New or updated StatusMonitorPeriods

### \<a id="SuperOffice\_WebApi\_Agents\_SaintAgent\_SetRankOnStatusMonitorsAsync\_System\_String\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetRankOnStatusMonitorsAsync(string, int\[], RequestOptions)

Set rank order on status monitors

```csharp theme={null}
public Task SetRankOnStatusMonitorsAsync(string type, int[] itemsIds, RequestOptions requestOptions = null)
```

#### Parameters

`type` [string](https://learn.microsoft.com/dotnet/api/system.string)

Type of status monitors to reorder ("contact", "project", etc.)

`itemsIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

The ids of the items in the order you want

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value


## Related topics

- [SuperOffice.WebApi.Data.SaintConfiguration](/en/api/reference/webapi/SuperOffice.WebApi.Data.SaintConfiguration.md)
- [SuperOffice.WebApi.Data.StatusMonitor](/en/api/reference/webapi/SuperOffice.WebApi.Data.StatusMonitor.md)
- [SuperOffice.WebApi.Data.StatusMonitorPeriods](/en/api/reference/webapi/SuperOffice.WebApi.Data.StatusMonitorPeriods.md)
- [SuperOffice.WebApi.Agents.AgentBase](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AgentBase.md)
- [SuperOffice.WebApi.Agents.ISaintAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ISaintAgent.md)
- [Get Saint Configurations](/en/api/reference/restful/agent/saint_agent/get-saint-configurations.md)
