Class AgentBase
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Base class for client Agents. Uses a <xref href=“System.Net.Http.HttpClient” data-throw-if-not-resolved=“false”></xref> to call the SuperOffice REST API. Will use a default implementation with gzip and progress callbacks if nothing is specified.
Inheritance
object ← AgentBaseDerived
AIAgent, ApiAgent, AppointmentAgent, ArchiveAgent, AssociateAgent, BLOBAgent, BatchAgent, BulkUpdateAgent, CRMScriptAgent, ChatAgent, ConfigurationAgent, ContactAgent, CustomObjectAgent, CustomerServiceAgent, DashAgent, DashboardAgent, DatabaseAgent, DatabaseTableAgent, DiagnosticsAgent, DocumentAgent, DocumentMigrationAgent, EMailAgent, ErpSyncAgent, FavouriteAgent, FindAgent, ForeignSystemAgent, FreeTextAgent, ImportAgent, LicenseAgent, ListAgent, MDOAgent, MarketingAgent, MessagingAgent, NavigatorAgent, NewsFeedAgent, NumberAllocationAgent, PersonAgent, PhoneListAgent, PocketAgent, PreferenceAgent, PreviewsAgent, ProjectAgent, QuoteAgent, RelationAgent, ReportAgent, ResourceAgent, SaintAgent, SaleAgent, SelectionAgent, SentryAgent, TargetsAgent, TicketAgent, TimeZoneAgent, TooltipsAgent, UserAgent, UserDefinedFieldInfoAgent, ViewStateAgent, WebhookAgent, WorkflowAgentImplements
IAgentBase, IDisposableInherited Members
object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()Remarks
Disposes of the client when the agent is disposed, if no client provided to ctor.Constructors
AgentBase(string, HttpClient)
Agent base class.Parameters
baseUrl string
URL to web API endpoint
httpClient HttpClient
client to use to communicate with endpoint. Will make a default http client if nothing is provided.
AgentBase(WebApiOptions, HttpClient)
Agent base class.Parameters
configuration WebApiOptions
Settings and URL to web API endpoint
httpClient HttpClient
client to use to communicate with endpoint. Will make a default http client if nothing is provided.
Fields
_binary
Field Value
string_client
Field Value
HttpClient_config
Field Value
WebApiOptions_disposeClient
Field Value
bool_json
Field Value
stringProperties
Client
The HTTP Client we are using. Create a default SO HttpClient if not specified in constructor.Property Value
HttpClientClientCancellationTokenSource
Used in SendRequest to allow clients to cancel requests.Property Value
CancellationTokenSourceConfiguration
Configuration this agent was initalized with.Property Value
WebApiOptionsHasRunningRequest
Is an HTTP request in flight?Property Value
boolProgressListener
Progress callback receiver for downloadsProperty Value
IProgressListenerUploadProgressListener
Progress callback receiver for uploadsProperty Value
IProgressListenerMethods
BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)
Parameters
method HttpMethod
url string
body object
config WebApiOptions
contentType string
Returns
HttpRequestMessageBuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)
Parameters
method HttpMethod
url string
body object
stream Stream
config WebApiOptions
contentType string
Returns
HttpRequestMessageBuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)
Parameters
method HttpMethod
url string
body Stream
config WebApiOptions
contentType string
Returns
HttpRequestMessageCancelRequest()
Used by the client to terminate the current method call.Dispose()
Disposes of the HTTP Client if we own it.Finally(RequestOptions)
Parameters
options RequestOptions
Merge(RequestOptions)
Parameters
options RequestOptions
Returns
WebApiOptionsParseAuthorization(IAuthorization)
Creates authentication headers based on <xref href=“SuperOffice.WebApi.Authorization.IAuthorization” data-throw-if-not-resolved=“false”></xref> scheme and parameter.Parameters
authorization IAuthorization
Contains authorization scheme and parameter values.
Returns
AuthenticationHeaderValue Authorization header.ParseResponse<T>(HttpResponseMessage)
Parameters
response HttpResponseMessage
Returns
Task<T>Type Parameters
T
SendRequest(HttpRequestMessage, RequestOptions)
Parameters
request HttpRequestMessage
config RequestOptions
Returns
Task<HttpResponseMessage>SendRequestObject(HttpMethod, string, object, WebApiOptions, string)
Parameters
method HttpMethod
url string
args object
config WebApiOptions
contentType string
Returns
Task<HttpResponseMessage>SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)
Parameters
method HttpMethod
url string
args object
stream Stream
config WebApiOptions
contentType string
Returns
Task<HttpResponseMessage>ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)
Return NULL on NOT-FOUND errorsParameters
request HttpRequestMessage
response HttpResponseMessage