<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent”></a> Class TimeZoneAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll TimeZone maintenance
Inheritance
object ← AgentBase ← TimeZoneAgentImplements
ITimeZoneAgent, 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 (TimeZoneAgent agent = new TimeZoneAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent__ctor_System_Net_Http_HttpClient_”></a> TimeZoneAgent(HttpClient)
Constructor: TimeZone maintenanceParameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> TimeZoneAgent(WebApiOptions, HttpClient)
Constructor: TimeZone maintenanceParameters
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_TimeZoneAgent_CheckNewTimeZoneDataAvailableAsync_SuperOffice_WebApi_RequestOptions_”></a> CheckNewTimeZoneDataAvailableAsync(RequestOptions)
Check to see if new timezone data is availableParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> Returns true if new timezone info is found available, false otherwise<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_DeleteTimeZonesAsync_SuperOffice_WebApi_RequestOptions_”></a> DeleteTimeZonesAsync(RequestOptions)
Deletes all time zone data (locations and rules) from the databaseParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_GetBaseTimeZoneIdAsync_SuperOffice_WebApi_RequestOptions_”></a> GetBaseTimeZoneIdAsync(RequestOptions)
Get the base timezone id.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> Returns the base timezone id. Returns 0 if not set.<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_GetDefaultTimeZoneInformationAsync_SuperOffice_WebApi_RequestOptions_”></a> GetDefaultTimeZoneInformationAsync(RequestOptions)
Get information about the current, preferred timezone for the current user. If no such preference has been set, returns the correct fallback (and UserPreferenceId is 0)Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PreferredTimeZone> Get information about the current, preferred timezone for the current user.<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_GetDefaultTimeZonePreferenceAsync_SuperOffice_WebApi_RequestOptions_”></a> GetDefaultTimeZonePreferenceAsync(RequestOptions)
Returns the id of the default timezone preference with deflevel system wideParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> The id of the system wide default timezone preference<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_InitializeTimeZoneDataAsync_SuperOffice_WebApi_RequestOptions_”></a> InitializeTimeZoneDataAsync(RequestOptions)
Initalizes the TimeZoneDataParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TimeZoneData[]><a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_SetActiveTimeZoneRowAsync_System_Int32_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> SetActiveTimeZoneRowAsync(int, bool, RequestOptions)
Set active state of singe row in the TZLocation tableParameters
id int
Id of row to set active state on
active bool
Set active to true or false
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_SetActiveTimeZonesByFilterAsync_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> SetActiveTimeZonesByFilterAsync(string, bool, RequestOptions)
Toggles active state of a single row in the TZLocation tableParameters
filter string
Filter timezones
active bool
Set active to true or false
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_SetBaseTimeZoneIdAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SetBaseTimeZoneIdAsync(int, RequestOptions)
Set the base timezone id.Parameters
timezoneId int
The timezone id to save
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> Returns true if setting of base timezone was done<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_TimeOfLastTimeZoneUpdateAsync_SuperOffice_WebApi_RequestOptions_”></a> TimeOfLastTimeZoneUpdateAsync(RequestOptions)
Get the time time zone data was last updatedParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<DateTime> Time of last update<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_ToggleActiveTimeZoneRowAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> ToggleActiveTimeZoneRowAsync(int, RequestOptions)
Toggles active state of a single row in the TZLocation tableParameters
id int
Id of row to toggle active state on
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_TimeZoneAgent_UpdateTimeZoneDataAsync_SuperOffice_WebApi_RequestOptions_”></a> UpdateTimeZoneDataAsync(RequestOptions)
Retrieve time zone data from the SuperOffice server and update TimeZone data in the databaseParameters
requestOptions RequestOptions
Override language/culture codes on this request.