shrike 0.1.1

AT Protocol library for Rust
Documentation
// Code generated by lexgen. DO NOT EDIT.

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RepoPutRecordInput {
    /// The NSID of the record collection.
    pub collection: crate::syntax::Nsid,
    /// The record to write.
    pub record: serde_json::Value,
    /// The handle or DID of the repo (aka, current account).
    pub repo: crate::syntax::AtIdentifier,
    /// The Record Key.
    pub rkey: crate::syntax::RecordKey,
    /// Compare and swap with the previous commit by CID.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub swap_commit: Option<String>,
    /// Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub swap_record: Option<String>,
    /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub validate: Option<bool>,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RepoPutRecordOutput {
    pub cid: String,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub commit: Option<crate::api::com::atproto::RepoDefsCommitMeta>,
    pub uri: crate::syntax::AtUri,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub validation_status: Option<String>,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

/// RepoPutRecord — Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.
pub async fn repo_put_record(
    client: &crate::xrpc::Client,
    input: &RepoPutRecordInput,
) -> Result<RepoPutRecordOutput, crate::xrpc::Error> {
    client.procedure("com.atproto.repo.putRecord", input).await
}