atrium_api/com/atproto/moderation/
create_report.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.moderation.createReport` namespace.
3pub const NSID: &str = "com.atproto.moderation.createReport";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    #[serde(skip_serializing_if = "core::option::Option::is_none")]
8    pub mod_tool: core::option::Option<ModTool>,
9    ///Additional context about the content and violation.
10    #[serde(skip_serializing_if = "core::option::Option::is_none")]
11    pub reason: core::option::Option<String>,
12    ///Indicates the broad category of violation the report is for.
13    pub reason_type: crate::com::atproto::moderation::defs::ReasonType,
14    pub subject: crate::types::Union<InputSubjectRefs>,
15}
16pub type Input = crate::types::Object<InputData>;
17#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
18#[serde(rename_all = "camelCase")]
19pub struct OutputData {
20    pub created_at: crate::types::string::Datetime,
21    pub id: i64,
22    #[serde(skip_serializing_if = "core::option::Option::is_none")]
23    pub reason: core::option::Option<String>,
24    pub reason_type: crate::com::atproto::moderation::defs::ReasonType,
25    pub reported_by: crate::types::string::Did,
26    pub subject: crate::types::Union<OutputSubjectRefs>,
27}
28pub type Output = crate::types::Object<OutputData>;
29#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
30#[serde(tag = "error", content = "message")]
31pub enum Error {}
32impl std::fmt::Display for Error {
33    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
34        Ok(())
35    }
36}
37///Moderation tool information for tracing the source of the action
38#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
39#[serde(rename_all = "camelCase")]
40pub struct ModToolData {
41    ///Additional arbitrary metadata about the source
42    #[serde(skip_serializing_if = "core::option::Option::is_none")]
43    pub meta: core::option::Option<crate::types::Unknown>,
44    ///Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')
45    pub name: String,
46}
47pub type ModTool = crate::types::Object<ModToolData>;
48#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
49#[serde(tag = "$type")]
50pub enum InputSubjectRefs {
51    #[serde(rename = "com.atproto.admin.defs#repoRef")]
52    ComAtprotoAdminDefsRepoRef(Box<crate::com::atproto::admin::defs::RepoRef>),
53    #[serde(rename = "com.atproto.repo.strongRef")]
54    ComAtprotoRepoStrongRefMain(Box<crate::com::atproto::repo::strong_ref::Main>),
55}
56#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
57#[serde(tag = "$type")]
58pub enum OutputSubjectRefs {
59    #[serde(rename = "com.atproto.admin.defs#repoRef")]
60    ComAtprotoAdminDefsRepoRef(Box<crate::com::atproto::admin::defs::RepoRef>),
61    #[serde(rename = "com.atproto.repo.strongRef")]
62    ComAtprotoRepoStrongRefMain(Box<crate::com::atproto::repo::strong_ref::Main>),
63}