Table of Contents

Class RESTResponse

The base class for all API objects returned by RESTApiV3. This class encapsulates common properties and methods for handling various types of outputs from REST API responses.

public class RESTResponse : Result, IResult
Inheritance
RESTResponse
Implements
Derived
Inherited Members
Extension Methods

Properties

AudioOutput

Audio data output from the API as an AudioClip object

public virtual AudioClip AudioOutput { get; set; }

Property Value

AudioClip

BinaryOutput

Binary data output from the API

public virtual byte[] BinaryOutput { get; set; }

Property Value

byte[]

FileOutput

File output from the API as a UnityFile object

public virtual UniFile FileOutput { get; set; }

Property Value

UniFile

HasBody

Whether the API response has an empty body.

public virtual bool HasBody { get; }

Property Value

bool

Id

The identifier, which can be referenced in API endpoints. This ID is used to uniquely identify the API object.

public virtual string Id { get; set; }

Property Value

string

ImageOutput

Image data output from the API as a Texture2D object

public virtual Texture2D ImageOutput { get; set; }

Property Value

Texture2D

IsStreamDone

Returns true if it's a result of SSE event and the event is done.

public bool IsStreamDone { get; set; }

Property Value

bool

OutputPath

The absolute path where the output file is saved

public string OutputPath { get; set; }

Property Value

string

StatusCode

The HTTP status code of the API response.

public long StatusCode { get; set; }

Property Value

long

TextOutput

Text data output from the API

public virtual string TextOutput { get; set; }

Property Value

string

Methods

StreamDone()

Creates a new instance of the RESTResponse class with the success flag set to true. This method is used to quickly create a successful result.

public static RESTResponse StreamDone()

Returns

RESTResponse

A new instance of RESTResponse with IsSuccess set to true.