Show / Hide Table of Contents

    Class AppearitionBaseRequest<T>

    Inheritance
    System.Object
    AppearitionBaseRequest<T>
    AppearitionRequest<T>
    Namespace: Appearition.Internal
    Assembly: Appearition.SDK.dll
    Syntax
    public abstract class AppearitionBaseRequest<T>
        where T : BaseApi, new()
    Type Parameters
    Name Description
    T

    Fields

    Boundary

    Declaration
    protected readonly string Boundary
    Field Value
    Type Description
    System.String

    Timeout

    Timeout for the request, in milliseconds. Default value is 180,000 (3minutes)

    Declaration
    public int Timeout
    Field Value
    Type Description
    System.Int32

    Properties

    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.

    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; protected set; }
    Property Value
    Type Description
    System.Boolean

    true if is done; otherwise, false.

    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.

    Progress

    Declaration
    public virtual float Progress { get; protected set; }
    Property Value
    Type Description
    System.Single

    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.

    Methods

    CompleteRequest(String, T, Action<T>, 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, 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.String url

    URL.

    System.String requestResponseCode

    Request response code.

    System.String error

    Error.

    Returns
    Type Description
    T

    The request.

    HandleAPICall_GET(Int32, T, BaseRequestContent, Action<T>)

    Process of a standard API GET call compatible with the Appearition EMS.

    Declaration
    public IEnumerator HandleAPICall_GET(int productId, T reusableObject, BaseRequestContent requestContent, Action<T> callback)
    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.

    HandleAPICall_POST(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(int productId, T reusableObject, object postRequestBody, BaseRequestContent requestContent, Action<T> callback = null)
    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.

    HandleAPICall_POSTMultiPartFormData(Int32, T, BaseRequestContent, IEnumerable<MultiPartFormParam>, String, Action<T>)

    Declaration
    public IEnumerator HandleAPICall_POSTMultiPartFormData(int productId, T reusableObject, BaseRequestContent requestContent, IEnumerable<MultiPartFormParam> postRequestData, string mediaType = "", Action<T> callback = null)
    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

    LaunchAPICall_GET(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(int productId, T reusableObject, BaseRequestContent requestContent = null, Action<T> callback = null)
    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.

    LaunchAPICall_MultiPartPOST(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(int productId, T reusableObject, BaseRequestContent requestContent = null, List<MultiPartFormParam> postRequestData = null, string mediaType = "", Action<T> callback = null)
    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.

    LaunchAPICall_POST(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(int productId, T reusableObject, object postRequestBody, BaseRequestContent requestContent = null, Action<T> callback = null)
    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.

    Events

    OnRequestCompleted

    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<>

    Extension Methods

    ObjectExtension.ToStream(Object)
    Back to top Appearition SDK for Unity API