Class AppearitionBaseRequest<T>
Inherited Members
Namespace: Appearition.Internal
Assembly: Appearition.SDK.dll
Syntax
public abstract class AppearitionBaseRequest<T>
where T : BaseApi, new()
Type Parameters
Name | Description |
---|---|
T |
Fields
View SourceTimeout
Timeout for the request, in milliseconds. Default value is 180,000 (3minutes)
Declaration
public int Timeout
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
View SourceCurrentState
Declaration
public AppearitionBaseRequest<T>.RequestState CurrentState { get; protected set; }
Property Value
Type | Description |
---|---|
AppearitionBaseRequest.RequestState<> |
DownloadedBytes
Bytes downloaded by the current request. If the API Call doesn't feature download of any attachments, this value will be null.
Declaration
public virtual byte[] DownloadedBytes { get; }
Property Value
Type | Description |
---|---|
System.Byte[] | The downloaded bytes. |
DownloadedBytesSavePath
Declaration
protected virtual string DownloadedBytesSavePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Errors
Contains all the _errors and messages from the EMS obtained during this request. Do note that it content will not be available until the _isDone flag is set to true.
Declaration
public EmsError Errors { get; }
Property Value
Type | Description |
---|---|
EmsError | The _errors. |
IsDone
Returns whether the current request has completed or not.
Declaration
public virtual bool IsDone { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
JsonDownloaded
Contains the JSON response from this request once complete.
Declaration
public virtual string JsonDownloaded { get; }
Property Value
Type | Description |
---|---|
System.String | The json downloaded. |
JsonSavePath
Declaration
protected virtual string JsonSavePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PostBody
Declaration
protected object PostBody { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
ProductId
Declaration
protected int ProductId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Progress
Declaration
public virtual float Progress { get; protected set; }
Property Value
Type | Description |
---|---|
System.Single |
RequestContent
Declaration
protected BaseRequestContent RequestContent { get; set; }
Property Value
Type | Description |
---|---|
BaseRequestContent |
RequestResponseObject
Contains the response of the download extracted. This variable might be null until the download has complete.
Declaration
public virtual T RequestResponseObject { get; }
Property Value
Type | Description |
---|---|
T | The request response object. |
ResponseCode
Response code for this current request.
Declaration
public virtual string ResponseCode { get; }
Property Value
Type | Description |
---|---|
System.String | The response code. |
SizeOfFileBeingUploaded
Declaration
public virtual long SizeOfFileBeingUploaded { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
View SourceCompleteRequest(String, T, Action<T>, Boolean, String, String, String)
Concludes the current request, including storing the standard ApiData, deserializing the json, and calling the events/callback.
Declaration
public virtual T CompleteRequest(string responseJson, T reusableObject, Action<T> callback, bool isLiveData, string url = "", string requestResponseCode = "", string error = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | responseJson | Response json. |
T | reusableObject | Reusable object. |
System.Action<T> | callback | Callback. |
System.Boolean | isLiveData | Whether the data is freshly downloaded or offline loaded |
System.String | url | URL. |
System.String | requestResponseCode | Request response code. |
System.String | error | Error. |
Returns
Type | Description |
---|---|
T | The request. |
HandleAPICall_GET<K>(Int32, T, BaseRequestContent, Action<T>)
Process of a standard API GET call compatible with the Appearition EMS.
Declaration
public IEnumerator HandleAPICall_GET<K>(int productId, T reusableObject, BaseRequestContent requestContent, Action<T> callback)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | Product identifier. |
T | reusableObject | |
BaseRequestContent | requestContent | Request content. |
System.Action<T> | callback | Callback. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The API call GE. |
Type Parameters
Name | Description |
---|---|
K |
HandleAPICall_POST<K>(Int32, T, Object, BaseRequestContent, Action<T>)
Process of a standard API POST call compatible with the Appearition EMS. This process is not compatible with multipart form ApiData POST requests.
Declaration
public IEnumerator HandleAPICall_POST<K>(int productId, T reusableObject, object postRequestBody, BaseRequestContent requestContent, Action<T> callback = null)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | Product identifier. |
T | reusableObject | |
System.Object | postRequestBody | Post request body. |
BaseRequestContent | requestContent | Request content. |
System.Action<T> | callback | Callback. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The API call position. |
Type Parameters
Name | Description |
---|---|
K |
HandleAPICall_POSTMultiPartFormData<K>(Int32, T, BaseRequestContent, IEnumerable<MultiPartFormParam>, String, Action<T>)
Declaration
public IEnumerator HandleAPICall_POSTMultiPartFormData<K>(int productId, T reusableObject, BaseRequestContent requestContent, IEnumerable<MultiPartFormParam> postRequestData, string mediaType = "", Action<T> callback = null)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | |
T | reusableObject | |
BaseRequestContent | requestContent | |
System.Collections.Generic.IEnumerable<MultiPartFormParam> | postRequestData | |
System.String | mediaType | |
System.Action<T> | callback |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Type Parameters
Name | Description |
---|---|
K |
LaunchAPICall_GET<K>(Int32, T, BaseRequestContent, Action<T>)
Launches an API of the type GET and returns the download process ApiData class.
Declaration
public static AppearitionRequest<T> LaunchAPICall_GET<K>(int productId, T reusableObject, BaseRequestContent requestContent = null, Action<T> callback = null)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | Product identifier. |
T | reusableObject | |
BaseRequestContent | requestContent | |
System.Action<T> | callback | Callback. |
Returns
Type | Description |
---|---|
AppearitionRequest<T> | The API call GE. |
Type Parameters
Name | Description |
---|---|
K |
LaunchAPICall_MultiPartPOST<K>(Int32, T, BaseRequestContent, List<MultiPartFormParam>, String, Action<T>)
Launches an API of the type POST with MultiPart Form-ApiData, mainly for uploading ApiData, and returns the process ApiData class. This class doesn't include a _progress for the time being.
Declaration
public static AppearitionRequest<T> LaunchAPICall_MultiPartPOST<K>(int productId, T reusableObject, BaseRequestContent requestContent = null, List<MultiPartFormParam> postRequestData = null, string mediaType = "", Action<T> callback = null)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | Product identifier. |
T | reusableObject | |
BaseRequestContent | requestContent | Request content. |
System.Collections.Generic.List<MultiPartFormParam> | postRequestData | Post request ApiData. |
System.String | mediaType | |
System.Action<T> | callback | Callback. |
Returns
Type | Description |
---|---|
AppearitionRequest<T> | The API call multi part position. |
Type Parameters
Name | Description |
---|---|
K |
LaunchAPICall_POST<K>(Int32, T, Object, BaseRequestContent, Action<T>)
Launches an API of the type POST and returns the download process ApiData class.
Declaration
public static AppearitionRequest<T> LaunchAPICall_POST<K>(int productId, T reusableObject, object postRequestBody, BaseRequestContent requestContent = null, Action<T> callback = null)
where K : BaseHandler
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | productId | Product identifier. |
T | reusableObject | |
System.Object | postRequestBody | Post request body. |
BaseRequestContent | requestContent | Request content. |
System.Action<T> | callback | Callback. |
Returns
Type | Description |
---|---|
AppearitionRequest<T> | The API call position. |
Type Parameters
Name | Description |
---|---|
K |
Events
View SourceOnRequestCompleted
Declaration
public event AppearitionBaseRequest<T>.RequestCompleted OnRequestCompleted
Event Type
Type | Description |
---|---|
AppearitionBaseRequest.RequestCompleted<> |
OnRequestCompletedJson
Declaration
public event AppearitionBaseRequest<T>.RequestCompletedJson OnRequestCompletedJson
Event Type
Type | Description |
---|---|
AppearitionBaseRequest.RequestCompletedJson<> |