NAME

Apertur::SDK::Resource::Sessions - Upload session management

DESCRIPTION

Provides methods to create, retrieve, update, and list upload sessions, as well as password verification, QR code generation, and delivery status checking.

METHODS

create(%options)

Creates a new upload session. Returns the session hashref including uuid.

get($uuid)

Retrieves session details by UUID.

update($uuid, %options)

Updates a session's settings.

list(%params)

Lists sessions with optional pagination (page, pageSize).

recent(%params)

Returns recently created sessions with optional limit.

qr($uuid, %options)

Returns the QR code image as raw bytes. Options: format, size, style, fg, bg, borderSize, borderColor.

verify_password($uuid, $password)

Verifies a password for a protected session.

delivery_status($uuid, %opts)

Returns the delivery status snapshot for a session as a hashref:

{
    status      => 'pending' | 'active' | 'completed' | 'expired',
    files       => [ { record_id => ..., filename => ..., size_bytes => ...,
                       destinations => [ { destination_id => ..., status => ..., ... } ] } ],
    lastChanged => '<ISO 8601>',
}

Options:

poll_from

ISO 8601 timestamp. When provided, the server long-polls for up to 5 minutes waiting for something to change before responding. This call automatically widens the per-request timeout to 360 s (6 min) so the server releases first under the happy path.