commonMain.com.atproto.repo.getRecord.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bluesky-jvm Show documentation
Show all versions of bluesky-jvm Show documentation
Bluesky Social API bindings for Kotlin.
The newest version!
@file:Suppress("DEPRECATION")
package com.atproto.repo
import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlinx.collections.immutable.toImmutableList
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.AtIdentifier
import sh.christian.ozone.api.AtUri
import sh.christian.ozone.api.Cid
import sh.christian.ozone.api.Nsid
import sh.christian.ozone.api.model.JsonContent
import sh.christian.ozone.api.model.ReadOnlyList
/**
* @param repo The handle or DID of the repo.
* @param collection The NSID of the record collection.
* @param rkey The Record Key.
* @param cid The CID of the version of the record. If not specified, then return the most recent
* version.
*/
@Serializable
public data class GetRecordQueryParams(
/**
* The handle or DID of the repo.
*/
public val repo: AtIdentifier,
/**
* The NSID of the record collection.
*/
public val collection: Nsid,
/**
* The Record Key.
*/
public val rkey: String,
/**
* The CID of the version of the record. If not specified, then return the most recent version.
*/
public val cid: Cid? = null,
) {
public fun asList(): ReadOnlyList> = buildList {
add("repo" to repo)
add("collection" to collection)
add("rkey" to rkey)
add("cid" to cid)
}.toImmutableList()
}
@Serializable
public data class GetRecordResponse(
public val uri: AtUri,
public val cid: Cid? = null,
public val `value`: JsonContent,
)