Class SaintAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Administration and maintenance of SAINT counters and statuses
Inheritance
object ← AgentBase ← SaintAgentImplements
ISaintAgent, IAgentBase, IDisposableInherited 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>(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 (SaintAgent agent = new SaintAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
SaintAgent(HttpClient)
Constructor: Administration and maintenance of SAINT counters and statusesParameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
SaintAgent(WebApiOptions, HttpClient)
Constructor: Administration and maintenance of SAINT counters and statusesParameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
CreateDefaultSaintConfigurationAsync(RequestOptions)
Set default values into a new SaintConfiguration. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<SaintConfiguration> A blank SaintConfigurationCreateDefaultStatusMonitorAsync(RequestOptions)
Set default values into a new StatusMonitor. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitor> A blank StatusMonitorCreateDefaultStatusMonitorPeriodsAsync(RequestOptions)
Set default values into a new StatusMonitorPeriods. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitorPeriods> A blank StatusMonitorPeriodsGetSaintConfigurationsAsync(RequestOptions)
Returns the StatusMonitorPeriods entity.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<SaintConfiguration[]> The SaintConfiguration for all entitiesGetStatusMonitorAsync(int, RequestOptions)
Get a single status monitor based on its identityParameters
id int
Identity of status monitor
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitor> The requested status monitorGetStatusMonitorPeriodsAsync(RequestOptions)
Returns the StatusMonitorPeriods entity.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitorPeriods> The StatusMonitorEntityGetStatusMonitorsAsync(int, string, RequestOptions)
Get all active status monitors for a specified targetParameters
id int
Identity of target type(contact identity, project identity etc.)
type string
Type to get status monitors for(“contact”, “project”, etc.)
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitor[]> Active status monitorsRegenerateCountersAsync(bool, RequestOptions)
Regenerate the Saint counters - this can take several minutesParameters
runAsBatch bool
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
Override language/culture codes on this request.
Returns
Task<BatchTaskInfo> Information about the batch task, if batch execution was requested. Otherwise nullRegenerateStatusMonitorAsync(int, RequestOptions)
Regenerate the given status monitorParameters
statusMonitorId int
The id of the statusmonitor to regenerate
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return valueRegenerateStatusMonitorsAsync(bool, RequestOptions)
Regenerate status monitorsParameters
runAsBatch bool
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
Override language/culture codes on this request.
Returns
Task<BatchTaskInfo> Information about the batch task, if batch execution was requested. Otherwise nullSaveSaintConfigurationAsync(SaintConfiguration, RequestOptions)
Updates the existing SaintConfiguration or creates a new SaintConfiguration if the id parameter is 0.Parameters
saintConfiguration SaintConfiguration
The SaintConfiguration that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<SaintConfiguration> New or updated SaintConfigurationSaveStatusMonitorAsync(StatusMonitor, RequestOptions)
Updates the existing StatusMonitor or creates a new StatusMonitor if the id parameter is 0.Parameters
statusMonitor StatusMonitor
The StatusMonitor that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitor> New or updated StatusMonitorSaveStatusMonitorPeriodsAsync(StatusMonitorPeriods, RequestOptions)
Updates the existing StatusMonitorPeriods or creates a new StatusMonitorPeriods if the id parameter is 0.Parameters
statusMonitorPeriods StatusMonitorPeriods
The StatusMonitorPeriods that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatusMonitorPeriods> New or updated StatusMonitorPeriodsSetRankOnStatusMonitorsAsync(string, int[], RequestOptions)
Set rank order on status monitorsParameters
type string
Type of status monitors to reorder (“contact”, “project”, etc.)
itemsIds int[]
The ids of the items in the order you want
requestOptions RequestOptions
Override language/culture codes on this request.