SolidTicketsDataModule

Client SDK for the Solid Tickets data module — the user's wallet: schema:Ticket resources stored on their pod and registered in the Solid type index.

Calls are delegated over IPC to the Android Solid Services app, which owns the login and the tokens. Obtain an instance via Solid.getTicketsDataModule. Collect ticketsDataModuleServiceConnectionState and wait for true before issuing calls. All operations are suspend functions, return null when the service yields no result, and throw SolidException on failure.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun createTicket(webId: String, newTicket: NewTicket, storage: String? = null, artifact: ByteArray? = null, artifactContentType: String? = null, images: NewTicketImages? = null, isPrivate: Boolean = true, container: String? = null): Ticket?

Creates a ticket on the user's pod, in its own sub-container of the tickets container.

Link copied to clipboard
suspend fun deleteTicket(webId: String, ticketUri: String): Ticket?

Deletes the ticket at ticketUri: its index row and its whole sub-container (document, artifact, stored images). Returns the removed ticket.

Link copied to clipboard
suspend fun getTicket(webId: String, ticketUri: String): Ticket?

Reads the full ticket document at ticketUri.

Link copied to clipboard
suspend fun getTicketArtifact(webId: String, artifactUri: String): TicketArtifact?

Reads a binary stored with a ticket — the original artifact or a stored pass image. Subject to the ~1 MB Binder transaction limit.

Link copied to clipboard
suspend fun listTickets(webId: String): TicketList?

Returns the cached tickets index for webId — enough to render a wallet list without fetching each ticket document.

Link copied to clipboard
suspend fun putTicketArtifact(webId: String, ticketUri: String, artifact: ByteArray, artifactContentType: String, images: NewTicketImages? = null): Ticket?

Replaces the ticket's stored artifact (and any provided pass-image roles) with fresh bytes, refreshing the document links. Travels inline over Binder, so it is subject to the ~1 MB transaction limit.

Link copied to clipboard

Hot Flow of the IPC service connection state; emits true once connected.

Link copied to clipboard
suspend fun updateTicket(webId: String, ticketUri: String, updated: NewTicket): Ticket?

Rewrites the ticket at ticketUri from updated with replace semantics: properties absent from updated are removed. The created date and the artifact link are preserved.