proto-blue-api 0.3.0

AT Protocol high-level API: agent, rich text, moderation, generated types
Documentation
// Generated by atproto-codegen. Do not edit.
//! Lexicon: com.atproto.label.defs

use serde::{Deserialize, Serialize};

/// Metadata tag on an atproto resource (eg, repo or record).
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Label {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<String>,
    pub cts: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exp: Option<proto_blue_syntax::Datetime>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub neg: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sig: Option<Vec<u8>>,
    pub src: proto_blue_syntax::Did,
    pub uri: String,
    pub val: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ver: Option<i64>,
}

pub type LabelValue = String;
pub const LABEL_VALUE_HIDE: &str = "!hide";
pub const LABEL_VALUE_NO_PROMOTE: &str = "!no-promote";
pub const LABEL_VALUE_WARN: &str = "!warn";
pub const LABEL_VALUE_NO_UNAUTHENTICATED: &str = "!no-unauthenticated";
pub const LABEL_VALUE_DMCA_VIOLATION: &str = "dmca-violation";
pub const LABEL_VALUE_DOXXING: &str = "doxxing";
pub const LABEL_VALUE_PORN: &str = "porn";
pub const LABEL_VALUE_SEXUAL: &str = "sexual";
pub const LABEL_VALUE_NUDITY: &str = "nudity";
pub const LABEL_VALUE_NSFL: &str = "nsfl";
pub const LABEL_VALUE_GORE: &str = "gore";

/// Declares a label value and its expected interpretations and behaviors.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LabelValueDefinition {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub adult_only: Option<bool>,
    pub blurs: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub default_setting: Option<String>,
    pub identifier: String,
    pub locales: Vec<LabelValueDefinitionStrings>,
    pub severity: String,
}

/// Strings which describe the label in the UI, localized into a specific language.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LabelValueDefinitionStrings {
    pub description: String,
    pub lang: String,
    pub name: String,
}

/// Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SelfLabel {
    pub val: String,
}

/// Metadata tags on an atproto record, published by the author within the record.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SelfLabels {
    pub values: Vec<SelfLabel>,
}