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 RepoCreateRecordInput {
    /// The NSID of the record collection.
    pub collection: crate::syntax::Nsid,
    /// The record itself. Must contain a $type field.
    pub record: serde_json::Value,
    /// The handle or DID of the repo (aka, current account).
    pub repo: crate::syntax::AtIdentifier,
    /// The Record Key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rkey: Option<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>,
    /// 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 RepoCreateRecordOutput {
    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>,
}

/// RepoCreateRecord — Create a single new repository record. Requires auth, implemented by PDS.
pub async fn repo_create_record(
    client: &crate::xrpc::Client,
    input: &RepoCreateRecordInput,
) -> Result<RepoCreateRecordOutput, crate::xrpc::Error> {
    client
        .procedure("com.atproto.repo.createRecord", input)
        .await
}