Search Results for

    Show / Hide Table of Contents

    Class UploadedFile

    Serializable implementation of IUploadedFile used by the SDK. Stores provider file metadata in a Unity-friendly form for runtime and editor workflows.

    Inheritance
    object
    UploadedFile
    Implements
    IUploadedFile
    IAIResource
    IData
    IHasId<string>
    IHasName
    IDeprecatable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    [Serializable]
    public sealed class UploadedFile : IUploadedFile, IAIResource, IData, IHasId<string>, IHasName, IDeprecatable

    Fields

    | Edit this page View Source

    api

    Provider identifier that owns this file.

    Declaration
    [SerializeField]
    public Api api
    Field Value
    Type Description
    Api
    | Edit this page View Source

    byteSize

    File size in bytes.

    Declaration
    [SerializeField]
    [FormerlySerializedAs("bytes")]
    public int byteSize
    Field Value
    Type Description
    int
    | Edit this page View Source

    createdAt

    Provider creation timestamp.

    Declaration
    [SerializeField]
    [FormerlySerializedAs("created")]
    public UnixTime createdAt
    Field Value
    Type Description
    UnixTime
    | Edit this page View Source

    expiresAt

    Provider expiration timestamp.

    Declaration
    [SerializeField]
    public UnixTime expiresAt
    Field Value
    Type Description
    UnixTime
    | Edit this page View Source

    id

    Provider-side unique file id.

    Declaration
    [SerializeField]
    public string id
    Field Value
    Type Description
    string
    | Edit this page View Source

    metadata

    Additional provider-specific metadata.

    Declaration
    [SerializeField]
    public SerializableMetadata metadata
    Field Value
    Type Description
    SerializableMetadata
    | Edit this page View Source

    mimeType

    Detected or declared MIME type.

    Declaration
    [SerializeField]
    public MimeType mimeType
    Field Value
    Type Description
    MimeType
    | Edit this page View Source

    name

    Human-readable file name, if available.

    Declaration
    [SerializeField]
    public string name
    Field Value
    Type Description
    string
    | Edit this page View Source

    uri

    Provider file URL (may be temporary or signed).

    Declaration
    [SerializeField]
    public string uri
    Field Value
    Type Description
    string

    Properties

    | Edit this page View Source

    Api

    Declaration
    public Api Api { get; }
    Property Value
    Type Description
    Api
    | Edit this page View Source

    ByteSize

    Gets the file size in bytes. This value is useful for validating upload/download limits and storage usage.

    Declaration
    public int ByteSize { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    CreatedAt

    Declaration
    public UnixTime? CreatedAt { get; }
    Property Value
    Type Description
    UnixTime?
    | Edit this page View Source

    ExpiresAt

    Gets the file expiration timestamp, if the provider defines one. Returns null when the file has no expiration policy.

    Declaration
    public UnixTime? ExpiresAt { get; }
    Property Value
    Type Description
    UnixTime?
    | Edit this page View Source

    Id

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Metadata

    Declaration
    public SerializableMetadata Metadata { get; }
    Property Value
    Type Description
    SerializableMetadata
    | Edit this page View Source

    MimeType

    Gets the MIME type associated with the file. This can be used to select preview, parsing, or processing paths.

    Declaration
    public MimeType MimeType { get; }
    Property Value
    Type Description
    MimeType
    | Edit this page View Source

    Name

    Gets the name of this object.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Uri

    Gets a provider URL for this file, if available. Some providers expose signed URLs while others may return no URL.

    Declaration
    public string Uri { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    CreateWithId(string)

    Creates a lightweight uploaded-file instance with only the file id populated. Useful when an API expects a file reference and full metadata is not required.

    Declaration
    public static IUploadedFile CreateWithId(string fileId)
    Parameters
    Type Name Description
    string fileId

    Provider file id.

    Returns
    Type Description
    IUploadedFile

    An IUploadedFile that references the given id.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when fileId is null or empty.

    | Edit this page View Source

    Equals(UploadedFile)

    Compares this instance with another UploadedFile for value equality. Equality is based on id, name, byte size, and creation timestamp.

    Declaration
    public bool Equals(UploadedFile other)
    Parameters
    Type Name Description
    UploadedFile other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Compares this instance with another object for value equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Returns a hash code consistent with the value-equality members.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    Implements

    IUploadedFile
    IAIResource
    IData
    IHasId<TId>
    IHasName
    IDeprecatable

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    CoreLibTypeExtensions.GetNameOrDash(IData)
    CoreLibTypeExtensions.GetIdOrNull(IHasId<string>)
    CoreLibTypeExtensions.IsNullOrEmptyId(IHasId<string>)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation