Skip to main content

Class RelationAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Contact/Person relations

Inheritance

objectAgentBaseRelationAgent

Implements

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

Constructors

RelationAgent(HttpClient)

Constructor: Contact/Person relations

Parameters

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

RelationAgent(WebApiOptions, HttpClient)

Constructor: Contact/Person relations

Parameters

options WebApiOptions Base URL and authentication values. httpClient HttpClient Optional: Use this HTTP client instead of making a new one.

Methods

CreateDefaultContactRelationEntityAsync(RequestOptions)

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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ContactRelationEntity&gt; A blank ContactRelationEntity

DeleteContactRelationAsync(int, RequestOptions)

Deletes the spesified contact relation.

Parameters

contactRelationEntityId int Relation to delete requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

GetContactRelationEntityAsync(int, RequestOptions)

Gets a specific ContactRelationEntity object.

Parameters

contactRelationEntityId int The identifier of the ContactRelationEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ContactRelationEntity&gt; ContactRelationEntity

SaveContactRelationAsync(ContactRelationEntity, RequestOptions)

Creates a new or updates an existing contact relation.

Parameters

contactRelationEntity ContactRelationEntity Relation to save requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ContactRelationEntity&gt; Saved relation