All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.atproto.repo.getRecord.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("DEPRECATION")

package com.atproto.repo

import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
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

/**
 * @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(): List> = buildList {
    add("repo" to repo)
    add("collection" to collection)
    add("rkey" to rkey)
    add("cid" to cid)
  }
}

@Serializable
public data class GetRecordResponse(
  public val uri: AtUri,
  public val cid: Cid? = null,
  public val `value`: JsonContent,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy