pub mod cancel_scheduled_actions;
pub mod emit_event;
pub mod get_account_timeline;
pub mod get_event;
pub mod get_record;
pub mod get_records;
pub mod get_repo;
pub mod get_reporter_stats;
pub mod get_repos;
pub mod get_subjects;
pub mod list_scheduled_actions;
pub mod query_events;
pub mod query_statuses;
pub mod schedule_action;
pub mod search_repos;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{AtUri, Cid, Datetime, Did, Handle, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::app_bsky::ageassurance::Access;
use crate::chat_bsky::convo::MessageRef;
use crate::com_atproto::admin::RepoRef;
use crate::com_atproto::admin::ThreatSignature;
use crate::com_atproto::label::Label;
use crate::com_atproto::moderation::ReasonType;
use crate::com_atproto::moderation::SubjectType;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::com_atproto::server::InviteCode;
use crate::tools_ozone::moderation;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AccountEvent<S: BosStr = DefaultStr> {
pub active: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<AccountEventStatus<S>>,
pub timestamp: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccountEventStatus<S: BosStr = DefaultStr> {
Unknown,
Deactivated,
Deleted,
Takendown,
Suspended,
Tombstoned,
Other(S),
}
impl<S: BosStr> AccountEventStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Deactivated => "deactivated",
Self::Deleted => "deleted",
Self::Takendown => "takendown",
Self::Suspended => "suspended",
Self::Tombstoned => "tombstoned",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"unknown" => Self::Unknown,
"deactivated" => Self::Deactivated,
"deleted" => Self::Deleted,
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"tombstoned" => Self::Tombstoned,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AccountEventStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AccountEventStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AccountEventStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AccountEventStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AccountEventStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AccountEventStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AccountEventStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AccountEventStatus::Unknown => AccountEventStatus::Unknown,
AccountEventStatus::Deactivated => AccountEventStatus::Deactivated,
AccountEventStatus::Deleted => AccountEventStatus::Deleted,
AccountEventStatus::Takendown => AccountEventStatus::Takendown,
AccountEventStatus::Suspended => AccountEventStatus::Suspended,
AccountEventStatus::Tombstoned => AccountEventStatus::Tombstoned,
AccountEventStatus::Other(v) => AccountEventStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AccountHosting<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deactivated_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reactivated_at: Option<Datetime>,
pub status: AccountHostingStatus<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccountHostingStatus<S: BosStr = DefaultStr> {
Takendown,
Suspended,
Deleted,
Deactivated,
Unknown,
Other(S),
}
impl<S: BosStr> AccountHostingStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Takendown => "takendown",
Self::Suspended => "suspended",
Self::Deleted => "deleted",
Self::Deactivated => "deactivated",
Self::Unknown => "unknown",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"deleted" => Self::Deleted,
"deactivated" => Self::Deactivated,
"unknown" => Self::Unknown,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AccountHostingStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AccountHostingStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AccountHostingStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AccountHostingStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AccountHostingStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AccountHostingStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AccountHostingStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AccountHostingStatus::Takendown => AccountHostingStatus::Takendown,
AccountHostingStatus::Suspended => AccountHostingStatus::Suspended,
AccountHostingStatus::Deleted => AccountHostingStatus::Deleted,
AccountHostingStatus::Deactivated => AccountHostingStatus::Deactivated,
AccountHostingStatus::Unknown => AccountHostingStatus::Unknown,
AccountHostingStatus::Other(v) => AccountHostingStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AccountStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub appeal_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub escalate_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub report_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub suspend_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub takedown_count: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AccountStrike<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub active_strike_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub first_strike_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_strike_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_strike_count: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AgeAssuranceEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub access: Option<Access<S>>,
pub attempt_id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_ip: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_ua: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub country_code: Option<S>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub init_ip: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub init_ua: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub region_code: Option<S>,
pub status: AgeAssuranceEventStatus<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceEventStatus<S: BosStr = DefaultStr> {
Unknown,
Pending,
Assured,
Other(S),
}
impl<S: BosStr> AgeAssuranceEventStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Pending => "pending",
Self::Assured => "assured",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AgeAssuranceEventStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AgeAssuranceEventStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AgeAssuranceEventStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AgeAssuranceEventStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AgeAssuranceEventStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AgeAssuranceEventStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AgeAssuranceEventStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AgeAssuranceEventStatus::Unknown => AgeAssuranceEventStatus::Unknown,
AgeAssuranceEventStatus::Pending => AgeAssuranceEventStatus::Pending,
AgeAssuranceEventStatus::Assured => AgeAssuranceEventStatus::Assured,
AgeAssuranceEventStatus::Other(v) => AgeAssuranceEventStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AgeAssuranceOverrideEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub access: Option<Access<S>>,
pub comment: S,
pub status: AgeAssuranceOverrideEventStatus<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceOverrideEventStatus<S: BosStr = DefaultStr> {
Assured,
Reset,
Blocked,
Other(S),
}
impl<S: BosStr> AgeAssuranceOverrideEventStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Assured => "assured",
Self::Reset => "reset",
Self::Blocked => "blocked",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"assured" => Self::Assured,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AgeAssuranceOverrideEventStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AgeAssuranceOverrideEventStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AgeAssuranceOverrideEventStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AgeAssuranceOverrideEventStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AgeAssuranceOverrideEventStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AgeAssuranceOverrideEventStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AgeAssuranceOverrideEventStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AgeAssuranceOverrideEventStatus::Assured => AgeAssuranceOverrideEventStatus::Assured,
AgeAssuranceOverrideEventStatus::Reset => AgeAssuranceOverrideEventStatus::Reset,
AgeAssuranceOverrideEventStatus::Blocked => AgeAssuranceOverrideEventStatus::Blocked,
AgeAssuranceOverrideEventStatus::Other(v) => {
AgeAssuranceOverrideEventStatus::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AgeAssurancePurgeEvent<S: BosStr = DefaultStr> {
pub comment: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct BlobView<S: BosStr = DefaultStr> {
pub cid: Cid<S>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<BlobViewDetails<S>>,
pub mime_type: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub moderation: Option<moderation::Moderation<S>>,
pub size: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum BlobViewDetails<S: BosStr = DefaultStr> {
#[serde(rename = "tools.ozone.moderation.defs#imageDetails")]
ImageDetails(Box<moderation::ImageDetails<S>>),
#[serde(rename = "tools.ozone.moderation.defs#videoDetails")]
VideoDetails(Box<moderation::VideoDetails<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct CancelScheduledTakedownEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct IdentityEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub handle: Option<Handle<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pds_host: Option<UriValue<S>>,
pub timestamp: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub tombstone: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ImageDetails<S: BosStr = DefaultStr> {
pub height: i64,
pub width: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventAcknowledge<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub acknowledge_account_subjects: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventComment<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sticky: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventDivert<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventEmail<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_delivered: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub policies: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub severity_level: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_expires_at: Option<Datetime>,
pub subject_line: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventEscalate<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventLabel<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub create_label_vals: Vec<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
pub negate_label_vals: Vec<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventMute<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub duration_in_hours: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventMuteReporter<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventPriorityScore<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub score: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventReport<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_reporter_muted: Option<bool>,
pub report_type: ReasonType<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventResolveAppeal<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventReverseTakedown<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub policies: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub severity_level: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_count: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventTag<S: BosStr = DefaultStr> {
pub add: Vec<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub remove: Vec<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventTakedown<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub acknowledge_account_subjects: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub policies: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub severity_level: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_expires_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub target_services: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventUnmute<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventUnmuteReporter<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventView<S: BosStr = DefaultStr> {
pub created_at: Datetime,
pub created_by: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub creator_handle: Option<S>,
pub event: ModEventViewEvent<S>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub mod_tool: Option<moderation::ModTool<S>>,
pub subject: ModEventViewSubject<S>,
pub subject_blob_cids: Vec<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_handle: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ModEventViewEvent<S: BosStr = DefaultStr> {
#[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
ModEventTakedown(Box<moderation::ModEventTakedown<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
ModEventComment(Box<moderation::ModEventComment<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
ModEventReport(Box<moderation::ModEventReport<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
ModEventLabel(Box<moderation::ModEventLabel<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
ModEventAcknowledge(Box<moderation::ModEventAcknowledge<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
ModEventEscalate(Box<moderation::ModEventEscalate<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
ModEventMute(Box<moderation::ModEventMute<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
ModEventUnmute(Box<moderation::ModEventUnmute<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
ModEventMuteReporter(Box<moderation::ModEventMuteReporter<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
ModEventEmail(Box<moderation::ModEventEmail<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
ModEventDivert(Box<moderation::ModEventDivert<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
ModEventTag(Box<moderation::ModEventTag<S>>),
#[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
AccountEvent(Box<moderation::AccountEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
IdentityEvent(Box<moderation::IdentityEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
RecordEvent(Box<moderation::RecordEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
ModEventPriorityScore(Box<moderation::ModEventPriorityScore<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ModEventViewSubject<S: BosStr = DefaultStr> {
#[serde(rename = "com.atproto.admin.defs#repoRef")]
RepoRef(Box<RepoRef<S>>),
#[serde(rename = "com.atproto.repo.strongRef")]
StrongRef(Box<StrongRef<S>>),
#[serde(rename = "chat.bsky.convo.defs#messageRef")]
MessageRef(Box<MessageRef<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModEventViewDetail<S: BosStr = DefaultStr> {
pub created_at: Datetime,
pub created_by: Did<S>,
pub event: ModEventViewDetailEvent<S>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub mod_tool: Option<moderation::ModTool<S>>,
pub subject: ModEventViewDetailSubject<S>,
pub subject_blobs: Vec<moderation::BlobView<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ModEventViewDetailEvent<S: BosStr = DefaultStr> {
#[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
ModEventTakedown(Box<moderation::ModEventTakedown<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
ModEventComment(Box<moderation::ModEventComment<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
ModEventReport(Box<moderation::ModEventReport<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
ModEventLabel(Box<moderation::ModEventLabel<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
ModEventAcknowledge(Box<moderation::ModEventAcknowledge<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
ModEventEscalate(Box<moderation::ModEventEscalate<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
ModEventMute(Box<moderation::ModEventMute<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
ModEventUnmute(Box<moderation::ModEventUnmute<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
ModEventMuteReporter(Box<moderation::ModEventMuteReporter<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
ModEventEmail(Box<moderation::ModEventEmail<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
ModEventDivert(Box<moderation::ModEventDivert<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
ModEventTag(Box<moderation::ModEventTag<S>>),
#[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
AccountEvent(Box<moderation::AccountEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
IdentityEvent(Box<moderation::IdentityEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
RecordEvent(Box<moderation::RecordEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
ModEventPriorityScore(Box<moderation::ModEventPriorityScore<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<S>>),
#[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ModEventViewDetailSubject<S: BosStr = DefaultStr> {
#[serde(rename = "tools.ozone.moderation.defs#repoView")]
RepoView(Box<moderation::RepoView<S>>),
#[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")]
RepoViewNotFound(Box<moderation::RepoViewNotFound<S>>),
#[serde(rename = "tools.ozone.moderation.defs#recordView")]
RecordView(Box<moderation::RecordView<S>>),
#[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")]
RecordViewNotFound(Box<moderation::RecordViewNotFound<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModTool<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub meta: Option<Data<S>>,
pub name: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Moderation<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_status: Option<moderation::SubjectStatusView<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ModerationDetail<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_status: Option<moderation::SubjectStatusView<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub op: RecordEventOp<S>,
pub timestamp: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RecordEventOp<S: BosStr = DefaultStr> {
Create,
Update,
Delete,
Other(S),
}
impl<S: BosStr> RecordEventOp<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Create => "create",
Self::Update => "update",
Self::Delete => "delete",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"create" => Self::Create,
"update" => Self::Update,
"delete" => Self::Delete,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for RecordEventOp<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for RecordEventOp<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for RecordEventOp<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for RecordEventOp<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for RecordEventOp<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for RecordEventOp<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = RecordEventOp<S::Output>;
fn into_static(self) -> Self::Output {
match self {
RecordEventOp::Create => RecordEventOp::Create,
RecordEventOp::Update => RecordEventOp::Update,
RecordEventOp::Delete => RecordEventOp::Delete,
RecordEventOp::Other(v) => RecordEventOp::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordHosting<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<Datetime>,
pub status: RecordHostingStatus<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RecordHostingStatus<S: BosStr = DefaultStr> {
Deleted,
Unknown,
Other(S),
}
impl<S: BosStr> RecordHostingStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Deleted => "deleted",
Self::Unknown => "unknown",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"deleted" => Self::Deleted,
"unknown" => Self::Unknown,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for RecordHostingStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for RecordHostingStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for RecordHostingStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for RecordHostingStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for RecordHostingStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for RecordHostingStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = RecordHostingStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
RecordHostingStatus::Deleted => RecordHostingStatus::Deleted,
RecordHostingStatus::Unknown => RecordHostingStatus::Unknown,
RecordHostingStatus::Other(v) => RecordHostingStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordView<S: BosStr = DefaultStr> {
pub blob_cids: Vec<Cid<S>>,
pub cid: Cid<S>,
pub indexed_at: Datetime,
pub moderation: moderation::Moderation<S>,
pub repo: moderation::RepoView<S>,
pub uri: AtUri<S>,
pub value: Data<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordViewDetail<S: BosStr = DefaultStr> {
pub blobs: Vec<moderation::BlobView<S>>,
pub cid: Cid<S>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
pub moderation: moderation::ModerationDetail<S>,
pub repo: moderation::RepoView<S>,
pub uri: AtUri<S>,
pub value: Data<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordViewNotFound<S: BosStr = DefaultStr> {
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RecordsStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub appealed_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub escalated_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub processed_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reported_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub takendown_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_reports: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RepoView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deactivated_at: Option<Datetime>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<S>,
pub handle: Handle<S>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub invite_note: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invited_by: Option<InviteCode<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invites_disabled: Option<bool>,
pub moderation: moderation::Moderation<S>,
pub related_records: Vec<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threat_signatures: Option<Vec<ThreatSignature<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RepoViewDetail<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deactivated_at: Option<Datetime>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email_confirmed_at: Option<Datetime>,
pub handle: Handle<S>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub invite_note: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invited_by: Option<InviteCode<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invites: Option<Vec<InviteCode<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invites_disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
pub moderation: moderation::ModerationDetail<S>,
pub related_records: Vec<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threat_signatures: Option<Vec<ThreatSignature<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RepoViewNotFound<S: BosStr = DefaultStr> {
pub did: Did<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ReporterStats<S: BosStr = DefaultStr> {
pub account_report_count: i64,
pub did: Did<S>,
pub labeled_account_count: i64,
pub labeled_record_count: i64,
pub record_report_count: i64,
pub reported_account_count: i64,
pub reported_record_count: i64,
pub takendown_account_count: i64,
pub takendown_record_count: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReviewClosed;
impl core::fmt::Display for ReviewClosed {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "reviewClosed")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReviewEscalated;
impl core::fmt::Display for ReviewEscalated {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "reviewEscalated")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReviewNone;
impl core::fmt::Display for ReviewNone {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "reviewNone")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReviewOpen;
impl core::fmt::Display for ReviewOpen {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "reviewOpen")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RevokeAccountCredentialsEvent<S: BosStr = DefaultStr> {
pub comment: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ScheduleTakedownEvent<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_after: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_until: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ScheduledActionView<S: BosStr = DefaultStr> {
pub action: ScheduledActionViewAction<S>,
pub created_at: Datetime,
pub created_by: Did<S>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub event_data: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_after: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execute_until: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_event_id: Option<i64>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_executed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_failure_reason: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub randomize_execution: Option<bool>,
pub status: ScheduledActionViewStatus<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ScheduledActionViewAction<S: BosStr = DefaultStr> {
Takedown,
Other(S),
}
impl<S: BosStr> ScheduledActionViewAction<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Takedown => "takedown",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"takedown" => Self::Takedown,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ScheduledActionViewAction<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ScheduledActionViewAction<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ScheduledActionViewAction<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ScheduledActionViewAction<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ScheduledActionViewAction<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ScheduledActionViewAction<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ScheduledActionViewAction<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ScheduledActionViewAction::Takedown => ScheduledActionViewAction::Takedown,
ScheduledActionViewAction::Other(v) => {
ScheduledActionViewAction::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ScheduledActionViewStatus<S: BosStr = DefaultStr> {
Pending,
Executed,
Cancelled,
Failed,
Other(S),
}
impl<S: BosStr> ScheduledActionViewStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Pending => "pending",
Self::Executed => "executed",
Self::Cancelled => "cancelled",
Self::Failed => "failed",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"pending" => Self::Pending,
"executed" => Self::Executed,
"cancelled" => Self::Cancelled,
"failed" => Self::Failed,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ScheduledActionViewStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ScheduledActionViewStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ScheduledActionViewStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ScheduledActionViewStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ScheduledActionViewStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ScheduledActionViewStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ScheduledActionViewStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ScheduledActionViewStatus::Pending => ScheduledActionViewStatus::Pending,
ScheduledActionViewStatus::Executed => ScheduledActionViewStatus::Executed,
ScheduledActionViewStatus::Cancelled => ScheduledActionViewStatus::Cancelled,
ScheduledActionViewStatus::Failed => ScheduledActionViewStatus::Failed,
ScheduledActionViewStatus::Other(v) => {
ScheduledActionViewStatus::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubjectReviewState<S: BosStr = DefaultStr> {
ToolsOzoneModerationDefsReviewOpen,
ToolsOzoneModerationDefsReviewEscalated,
ToolsOzoneModerationDefsReviewClosed,
ToolsOzoneModerationDefsReviewNone,
Other(S),
}
impl<S: BosStr> SubjectReviewState<S> {
pub fn as_str(&self) -> &str {
match self {
Self::ToolsOzoneModerationDefsReviewOpen => "tools.ozone.moderation.defs#reviewOpen",
Self::ToolsOzoneModerationDefsReviewEscalated => {
"tools.ozone.moderation.defs#reviewEscalated"
}
Self::ToolsOzoneModerationDefsReviewClosed => {
"tools.ozone.moderation.defs#reviewClosed"
}
Self::ToolsOzoneModerationDefsReviewNone => "tools.ozone.moderation.defs#reviewNone",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"tools.ozone.moderation.defs#reviewOpen" => Self::ToolsOzoneModerationDefsReviewOpen,
"tools.ozone.moderation.defs#reviewEscalated" => {
Self::ToolsOzoneModerationDefsReviewEscalated
}
"tools.ozone.moderation.defs#reviewClosed" => {
Self::ToolsOzoneModerationDefsReviewClosed
}
"tools.ozone.moderation.defs#reviewNone" => Self::ToolsOzoneModerationDefsReviewNone,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for SubjectReviewState<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for SubjectReviewState<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for SubjectReviewState<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SubjectReviewState<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr> jacquard_common::IntoStatic for SubjectReviewState<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = SubjectReviewState<S::Output>;
fn into_static(self) -> Self::Output {
match self {
SubjectReviewState::ToolsOzoneModerationDefsReviewOpen => {
SubjectReviewState::ToolsOzoneModerationDefsReviewOpen
}
SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated => {
SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated
}
SubjectReviewState::ToolsOzoneModerationDefsReviewClosed => {
SubjectReviewState::ToolsOzoneModerationDefsReviewClosed
}
SubjectReviewState::ToolsOzoneModerationDefsReviewNone => {
SubjectReviewState::ToolsOzoneModerationDefsReviewNone
}
SubjectReviewState::Other(v) => SubjectReviewState::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct SubjectStatusView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_stats: Option<moderation::AccountStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_strike: Option<moderation::AccountStrike<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub age_assurance_state: Option<SubjectStatusViewAgeAssuranceState<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub age_assurance_updated_by: Option<SubjectStatusViewAgeAssuranceUpdatedBy<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub appealed: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<S>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub hosting: Option<SubjectStatusViewHosting<S>>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_appealed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_reported_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_reviewed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_reviewed_by: Option<Did<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mute_reporting_until: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mute_until: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub priority_score: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub records_stats: Option<moderation::RecordsStats<S>>,
pub review_state: moderation::SubjectReviewState<S>,
pub subject: SubjectStatusViewSubject<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_blob_cids: Option<Vec<Cid<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_repo_handle: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub suspend_until: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub takendown: Option<bool>,
pub updated_at: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubjectStatusViewAgeAssuranceState<S: BosStr = DefaultStr> {
Pending,
Assured,
Unknown,
Reset,
Blocked,
Other(S),
}
impl<S: BosStr> SubjectStatusViewAgeAssuranceState<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Pending => "pending",
Self::Assured => "assured",
Self::Unknown => "unknown",
Self::Reset => "reset",
Self::Blocked => "blocked",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"pending" => Self::Pending,
"assured" => Self::Assured,
"unknown" => Self::Unknown,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for SubjectStatusViewAgeAssuranceState<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for SubjectStatusViewAgeAssuranceState<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for SubjectStatusViewAgeAssuranceState<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SubjectStatusViewAgeAssuranceState<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for SubjectStatusViewAgeAssuranceState<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceState<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = SubjectStatusViewAgeAssuranceState<S::Output>;
fn into_static(self) -> Self::Output {
match self {
SubjectStatusViewAgeAssuranceState::Pending => {
SubjectStatusViewAgeAssuranceState::Pending
}
SubjectStatusViewAgeAssuranceState::Assured => {
SubjectStatusViewAgeAssuranceState::Assured
}
SubjectStatusViewAgeAssuranceState::Unknown => {
SubjectStatusViewAgeAssuranceState::Unknown
}
SubjectStatusViewAgeAssuranceState::Reset => SubjectStatusViewAgeAssuranceState::Reset,
SubjectStatusViewAgeAssuranceState::Blocked => {
SubjectStatusViewAgeAssuranceState::Blocked
}
SubjectStatusViewAgeAssuranceState::Other(v) => {
SubjectStatusViewAgeAssuranceState::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubjectStatusViewAgeAssuranceUpdatedBy<S: BosStr = DefaultStr> {
Admin,
User,
Other(S),
}
impl<S: BosStr> SubjectStatusViewAgeAssuranceUpdatedBy<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Admin => "admin",
Self::User => "user",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"admin" => Self::Admin,
"user" => Self::User,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for SubjectStatusViewAgeAssuranceUpdatedBy<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for SubjectStatusViewAgeAssuranceUpdatedBy<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for SubjectStatusViewAgeAssuranceUpdatedBy<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for SubjectStatusViewAgeAssuranceUpdatedBy<S>
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for SubjectStatusViewAgeAssuranceUpdatedBy<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceUpdatedBy<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = SubjectStatusViewAgeAssuranceUpdatedBy<S::Output>;
fn into_static(self) -> Self::Output {
match self {
SubjectStatusViewAgeAssuranceUpdatedBy::Admin => {
SubjectStatusViewAgeAssuranceUpdatedBy::Admin
}
SubjectStatusViewAgeAssuranceUpdatedBy::User => {
SubjectStatusViewAgeAssuranceUpdatedBy::User
}
SubjectStatusViewAgeAssuranceUpdatedBy::Other(v) => {
SubjectStatusViewAgeAssuranceUpdatedBy::Other(v.into_static())
}
}
}
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum SubjectStatusViewHosting<S: BosStr = DefaultStr> {
#[serde(rename = "tools.ozone.moderation.defs#accountHosting")]
AccountHosting(Box<moderation::AccountHosting<S>>),
#[serde(rename = "tools.ozone.moderation.defs#recordHosting")]
RecordHosting(Box<moderation::RecordHosting<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum SubjectStatusViewSubject<S: BosStr = DefaultStr> {
#[serde(rename = "com.atproto.admin.defs#repoRef")]
RepoRef(Box<RepoRef<S>>),
#[serde(rename = "com.atproto.repo.strongRef")]
StrongRef(Box<StrongRef<S>>),
#[serde(rename = "chat.bsky.convo.defs#messageRef")]
MessageRef(Box<MessageRef<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct SubjectView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub profile: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub record: Option<moderation::RecordViewDetail<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub repo: Option<moderation::RepoViewDetail<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<moderation::SubjectStatusView<S>>,
pub subject: S,
pub r#type: SubjectType<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct TimelineEventPlcCreate;
impl core::fmt::Display for TimelineEventPlcCreate {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "timelineEventPlcCreate")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct TimelineEventPlcOperation;
impl core::fmt::Display for TimelineEventPlcOperation {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "timelineEventPlcOperation")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct TimelineEventPlcTombstone;
impl core::fmt::Display for TimelineEventPlcTombstone {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "timelineEventPlcTombstone")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct VideoDetails<S: BosStr = DefaultStr> {
pub height: i64,
pub length: i64,
pub width: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for AccountEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"accountEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AccountHosting<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"accountHosting"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AccountStats<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"accountStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AccountStrike<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"accountStrike"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AgeAssuranceEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"ageAssuranceEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AgeAssuranceOverrideEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"ageAssuranceOverrideEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.comment;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("comment"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AgeAssurancePurgeEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"ageAssurancePurgeEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.comment;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("comment"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for BlobView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"blobView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for CancelScheduledTakedownEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"cancelScheduledTakedownEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for IdentityEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"identityEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ImageDetails<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"imageDetails"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventAcknowledge<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventAcknowledge"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventComment<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventComment"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventDivert<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventDivert"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventEmail<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventEmail"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.policies {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("policies"),
max: 5usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventEscalate<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventEscalate"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventLabel<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventLabel"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventMute<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventMute"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventMuteReporter<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventMuteReporter"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventPriorityScore<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventPriorityScore"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.score;
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("score"),
max: 100i64,
actual: *value,
});
}
}
{
let value = &self.score;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("score"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventReport<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventReport"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventResolveAppeal<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventResolveAppeal"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventReverseTakedown<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventReverseTakedown"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.policies {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("policies"),
max: 5usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventTag<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventTag"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventTakedown<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventTakedown"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.policies {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("policies"),
max: 5usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventUnmute<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventUnmute"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventUnmuteReporter<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventUnmuteReporter"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModEventViewDetail<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modEventViewDetail"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModTool<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"modTool"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Moderation<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"moderation"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ModerationDetail<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"moderationDetail"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordHosting<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordHosting"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordViewDetail<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordViewDetail"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordViewNotFound<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordViewNotFound"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RecordsStats<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"recordsStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RepoView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"repoView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RepoViewDetail<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"repoViewDetail"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RepoViewNotFound<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"repoViewNotFound"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ReporterStats<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"reporterStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RevokeAccountCredentialsEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"revokeAccountCredentialsEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.comment;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("comment"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ScheduleTakedownEvent<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"scheduleTakedownEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ScheduledActionView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"scheduledActionView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SubjectStatusView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"subjectStatusView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.priority_score {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("priority_score"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.priority_score {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("priority_score"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SubjectView<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"subjectView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for VideoDetails<S> {
fn nsid() -> &'static str {
"tools.ozone.moderation.defs"
}
fn def_name() -> &'static str {
"videoDetails"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_tools_ozone_moderation_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod account_event_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Timestamp;
type Active;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Timestamp = Unset;
type Active = Unset;
}
pub struct SetTimestamp<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTimestamp<St> {}
impl<St: State> State for SetTimestamp<St> {
type Timestamp = Set<members::timestamp>;
type Active = St::Active;
}
pub struct SetActive<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetActive<St> {}
impl<St: State> State for SetActive<St> {
type Timestamp = St::Timestamp;
type Active = Set<members::active>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct timestamp(());
pub struct active(());
}
}
pub struct AccountEventBuilder<S: BosStr, St: account_event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<bool>,
Option<S>,
Option<AccountEventStatus<S>>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> AccountEvent<S> {
pub fn new() -> AccountEventBuilder<S, account_event_state::Empty> {
AccountEventBuilder::new()
}
}
impl<S: BosStr> AccountEventBuilder<S, account_event_state::Empty> {
pub fn new() -> Self {
AccountEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AccountEventBuilder<S, St>
where
St: account_event_state::State,
St::Active: account_event_state::IsUnset,
{
pub fn active(
mut self,
value: impl Into<bool>,
) -> AccountEventBuilder<S, account_event_state::SetActive<St>> {
self._fields.0 = Option::Some(value.into());
AccountEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: account_event_state::State> AccountEventBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: account_event_state::State> AccountEventBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<AccountEventStatus<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<AccountEventStatus<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> AccountEventBuilder<S, St>
where
St: account_event_state::State,
St::Timestamp: account_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> AccountEventBuilder<S, account_event_state::SetTimestamp<St>> {
self._fields.3 = Option::Some(value.into());
AccountEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AccountEventBuilder<S, St>
where
St: account_event_state::State,
St::Timestamp: account_event_state::IsSet,
St::Active: account_event_state::IsSet,
{
pub fn build(self) -> AccountEvent<S> {
AccountEvent {
active: self._fields.0.unwrap(),
comment: self._fields.1,
status: self._fields.2,
timestamp: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> AccountEvent<S> {
AccountEvent {
active: self._fields.0.unwrap(),
comment: self._fields.1,
status: self._fields.2,
timestamp: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("tools.ozone.moderation.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("accountEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
),
),
required: Some(
vec![
SmolStr::new_static("timestamp"),
SmolStr::new_static("active")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("active"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("timestamp"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("accountHosting"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("status")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("deactivatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("deletedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reactivatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("accountStats"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Statistics about a particular account subject",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("appealCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("escalateCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reportCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("suspendCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("takedownCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("accountStrike"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Strike information for an account")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("activeStrikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("firstStrikeAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Timestamp of the first strike received",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastStrikeAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Timestamp of the most recent strike received",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalStrikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssuranceEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Age assurance info coming directly from users. Only works on DID subjects.",
),
),
required: Some(
vec![
SmolStr::new_static("createdAt"),
SmolStr::new_static("status"),
SmolStr::new_static("attemptId")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("access"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.ageassurance.defs#access",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attemptId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unique identifier for this instance of the age assurance flow, in UUID format.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("completeIp"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The IP address used when completing the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("completeUa"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user agent used when completing the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("countryCode"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time of this write operation.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initIp"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The IP address used when initiating the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initUa"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user agent used when initiating the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("regionCode"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The ISO 3166-2 region code provided when beginning the Age Assurance flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The status of the Age Assurance process.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssuranceOverrideEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Age assurance status override by moderators. Only works on DID subjects.",
),
),
required: Some(
vec![
SmolStr::new_static("comment"), SmolStr::new_static("status")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("access"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.ageassurance.defs#access",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Comment describing the reason for the override.",
),
),
min_length: Some(1usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssurancePurgeEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only.",
),
),
required: Some(vec![SmolStr::new_static("comment")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Comment describing the reason for the purge.",
),
),
min_length: Some(1usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blobView"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("cid"),
SmolStr::new_static("mimeType"),
SmolStr::new_static("size"),
SmolStr::new_static("createdAt"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("details"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#imageDetails"),
CowStr::new_static("#videoDetails"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mimeType"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#moderation"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("size"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cancelScheduledTakedownEvent"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Logs cancellation of a scheduled takedown action for an account.",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("identityEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
),
),
required: Some(vec![SmolStr::new_static("timestamp")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pdsHost"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("timestamp"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tombstone"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("imageDetails"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("width"),
SmolStr::new_static("height"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("height"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("width"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventAcknowledge"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("acknowledgeAccountSubjects"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventComment"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Add a comment to a subject. An empty comment will clear any previously set sticky comment.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("sticky"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventDivert"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Divert a record's blobs to a 3rd party service for further scanning/tagging",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventEmail"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Keep a log of outgoing email to a user"),
),
required: Some(vec![SmolStr::new_static("subjectLine")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Additional comment about the outgoing comm.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("content"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The content of the email sent to the user.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isDelivered"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("policies"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Names/Keywords of the policies that necessitated the email.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("severityLevel"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strikeExpiresAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the strike should expire. If not provided, the strike never expires.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectLine"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The subject line of the email sent to the user.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventEscalate"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventLabel"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Apply/Negate labels on a subject")),
required: Some(vec![
SmolStr::new_static("createLabelVals"),
SmolStr::new_static("negateLabelVals"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createLabelVals"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("durationInHours"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("negateLabelVals"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventMute"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Mute incoming reports on a subject")),
required: Some(vec![SmolStr::new_static("durationInHours")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("durationInHours"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventMuteReporter"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Mute incoming reports from an account")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("durationInHours"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventPriorityScore"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Set priority score of the subject. Higher score means higher priority.",
)),
required: Some(vec![SmolStr::new_static("score")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("score"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventReport"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Report a subject")),
required: Some(vec![SmolStr::new_static("reportType")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isReporterMuted"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reportType"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.moderation.defs#reasonType"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventResolveAppeal"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Resolve appeal on a subject")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Describe resolution.")),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventReverseTakedown"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Revert take down action on a subject"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Describe reasoning behind the reversal.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("policies"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Names/Keywords of the policy infraction for which takedown is being reversed.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("severityLevel"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Severity level of the violation. Usually set from the last policy infraction's severity.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventTag"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Add/Remove a tag on a subject"),
),
required: Some(
vec![SmolStr::new_static("add"), SmolStr::new_static("remove")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("add"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Tags to be added to the subject. If already exists, won't be duplicated.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Additional comment about added/removed tags.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("remove"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventTakedown"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Take down a subject permanently or temporarily",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("acknowledgeAccountSubjects"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("durationInHours"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("policies"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Names/Keywords of the policies that drove the decision.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("severityLevel"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strikeExpiresAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the strike should expire. If not provided, the strike never expires.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("targetServices"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventUnmute"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Unmute action on a subject")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Describe reasoning behind the reversal.",
)),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventUnmuteReporter"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Unmute incoming reports from an account",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Describe reasoning behind the reversal.",
)),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventView"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("id"),
SmolStr::new_static("event"),
SmolStr::new_static("subject"),
SmolStr::new_static("subjectBlobCids"),
SmolStr::new_static("createdBy"),
SmolStr::new_static("createdAt"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creatorHandle"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("event"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#modEventTakedown"),
CowStr::new_static("#modEventReverseTakedown"),
CowStr::new_static("#modEventComment"),
CowStr::new_static("#modEventReport"),
CowStr::new_static("#modEventLabel"),
CowStr::new_static("#modEventAcknowledge"),
CowStr::new_static("#modEventEscalate"),
CowStr::new_static("#modEventMute"),
CowStr::new_static("#modEventUnmute"),
CowStr::new_static("#modEventMuteReporter"),
CowStr::new_static("#modEventUnmuteReporter"),
CowStr::new_static("#modEventEmail"),
CowStr::new_static("#modEventResolveAppeal"),
CowStr::new_static("#modEventDivert"),
CowStr::new_static("#modEventTag"),
CowStr::new_static("#accountEvent"),
CowStr::new_static("#identityEvent"),
CowStr::new_static("#recordEvent"),
CowStr::new_static("#modEventPriorityScore"),
CowStr::new_static("#ageAssuranceEvent"),
CowStr::new_static("#ageAssuranceOverrideEvent"),
CowStr::new_static("#ageAssurancePurgeEvent"),
CowStr::new_static("#revokeAccountCredentialsEvent"),
CowStr::new_static("#scheduleTakedownEvent"),
CowStr::new_static("#cancelScheduledTakedownEvent"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modTool"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#modTool"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subject"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("com.atproto.admin.defs#repoRef"),
CowStr::new_static("com.atproto.repo.strongRef"),
CowStr::new_static("chat.bsky.convo.defs#messageRef"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectBlobCids"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectHandle"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modEventViewDetail"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("id"),
SmolStr::new_static("event"),
SmolStr::new_static("subject"),
SmolStr::new_static("subjectBlobs"),
SmolStr::new_static("createdBy"),
SmolStr::new_static("createdAt"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("event"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#modEventTakedown"),
CowStr::new_static("#modEventReverseTakedown"),
CowStr::new_static("#modEventComment"),
CowStr::new_static("#modEventReport"),
CowStr::new_static("#modEventLabel"),
CowStr::new_static("#modEventAcknowledge"),
CowStr::new_static("#modEventEscalate"),
CowStr::new_static("#modEventMute"),
CowStr::new_static("#modEventUnmute"),
CowStr::new_static("#modEventMuteReporter"),
CowStr::new_static("#modEventUnmuteReporter"),
CowStr::new_static("#modEventEmail"),
CowStr::new_static("#modEventResolveAppeal"),
CowStr::new_static("#modEventDivert"),
CowStr::new_static("#modEventTag"),
CowStr::new_static("#accountEvent"),
CowStr::new_static("#identityEvent"),
CowStr::new_static("#recordEvent"),
CowStr::new_static("#modEventPriorityScore"),
CowStr::new_static("#ageAssuranceEvent"),
CowStr::new_static("#ageAssuranceOverrideEvent"),
CowStr::new_static("#ageAssurancePurgeEvent"),
CowStr::new_static("#revokeAccountCredentialsEvent"),
CowStr::new_static("#scheduleTakedownEvent"),
CowStr::new_static("#cancelScheduledTakedownEvent"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modTool"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#modTool"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subject"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#repoView"),
CowStr::new_static("#repoViewNotFound"),
CowStr::new_static("#recordView"),
CowStr::new_static("#recordViewNotFound"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectBlobs"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#blobView"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modTool"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Moderation tool information for tracing the source of the action",
),
),
required: Some(vec![SmolStr::new_static("name")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("meta"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Name/identifier of the source (e.g., 'automod', 'ozone/workspace')",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("subjectStatus"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#subjectStatusView"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderationDetail"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("subjectStatus"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#subjectStatusView"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
),
),
required: Some(
vec![SmolStr::new_static("timestamp"), SmolStr::new_static("op")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("op"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("timestamp"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordHosting"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("status")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("deletedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordView"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("uri"),
SmolStr::new_static("cid"),
SmolStr::new_static("value"),
SmolStr::new_static("blobCids"),
SmolStr::new_static("indexedAt"),
SmolStr::new_static("moderation"),
SmolStr::new_static("repo"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blobCids"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#moderation"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repo"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#repoView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordViewDetail"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("uri"),
SmolStr::new_static("cid"),
SmolStr::new_static("value"),
SmolStr::new_static("blobs"),
SmolStr::new_static("indexedAt"),
SmolStr::new_static("moderation"),
SmolStr::new_static("repo"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blobs"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#blobView"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#moderationDetail"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repo"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#repoView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordViewNotFound"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordsStats"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Statistics about a set of record subject items",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("appealedCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("escalatedCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pendingCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("processedCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reportedCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("takendownCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalReports"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repoView"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("did"),
SmolStr::new_static("handle"),
SmolStr::new_static("relatedRecords"),
SmolStr::new_static("indexedAt"),
SmolStr::new_static("moderation"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("deactivatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("email"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("inviteNote"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("invitedBy"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.server.defs#inviteCode"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("invitesDisabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#moderation"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("relatedRecords"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Unknown(LexUnknown {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threatSignatures"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"com.atproto.admin.defs#threatSignature",
),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repoViewDetail"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("did"),
SmolStr::new_static("handle"),
SmolStr::new_static("relatedRecords"),
SmolStr::new_static("indexedAt"),
SmolStr::new_static("moderation"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("deactivatedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("email"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("emailConfirmedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("inviteNote"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("invitedBy"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.server.defs#inviteCode"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("invites"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.server.defs#inviteCode"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("invitesDisabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moderation"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#moderationDetail"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("relatedRecords"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Unknown(LexUnknown {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threatSignatures"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"com.atproto.admin.defs#threatSignature",
),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repoViewNotFound"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("did")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reporterStats"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("did"),
SmolStr::new_static("accountReportCount"),
SmolStr::new_static("recordReportCount"),
SmolStr::new_static("reportedAccountCount"),
SmolStr::new_static("reportedRecordCount"),
SmolStr::new_static("takendownAccountCount"),
SmolStr::new_static("takendownRecordCount"),
SmolStr::new_static("labeledAccountCount"),
SmolStr::new_static("labeledRecordCount"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("accountReportCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labeledAccountCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labeledRecordCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordReportCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reportedAccountCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reportedRecordCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("takendownAccountCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("takendownRecordCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reviewClosed"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reviewEscalated"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reviewNone"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reviewOpen"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("revokeAccountCredentialsEvent"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Account credentials revocation by moderators. Only works on DID subjects.",
)),
required: Some(vec![SmolStr::new_static("comment")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Comment describing the reason for the revocation.",
)),
min_length: Some(1usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scheduleTakedownEvent"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Logs a scheduled takedown action for an account.",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeAfter"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeUntil"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scheduledActionView"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("View of a scheduled moderation action"),
),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("action"),
SmolStr::new_static("did"), SmolStr::new_static("createdBy"),
SmolStr::new_static("createdAt"),
SmolStr::new_static("status")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("action"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Type of action to be executed"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the scheduled action was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdBy"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"DID of the user who created this scheduled action",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Subject DID for the action"),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("eventData"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeAfter"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Earliest time to execute the action (for randomized scheduling)",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Exact time to execute the action"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executeUntil"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Latest time to execute the action (for randomized scheduling)",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executionEventId"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastExecutedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the action was last attempted to be executed",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastFailureReason"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Reason for the last execution failure"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("randomizeExecution"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Current status of the scheduled action"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the scheduled action was last updated",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectReviewState"),
LexUserType::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectStatusView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("subject"),
SmolStr::new_static("createdAt"),
SmolStr::new_static("updatedAt"),
SmolStr::new_static("reviewState")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("accountStats"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#accountStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("accountStrike"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#accountStrike"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssuranceState"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Current age assurance state of the subject.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssuranceUpdatedBy"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Whether or not the last successful update to age assurance was made by the user or admin.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("appealed"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("comment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Sticky comment on the subject."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Timestamp referencing the first moderation status impacting event was emitted on the subject",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hosting"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#accountHosting"),
CowStr::new_static("#recordHosting")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastAppealedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Timestamp referencing when the author of the subject appealed a moderation action",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastReportedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastReviewedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastReviewedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("muteReportingUntil"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("muteUntil"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("priorityScore"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recordsStats"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#recordsStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reviewState"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#subjectReviewState"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subject"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("com.atproto.admin.defs#repoRef"),
CowStr::new_static("com.atproto.repo.strongRef"),
CowStr::new_static("chat.bsky.convo.defs#messageRef")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectBlobCids"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectRepoHandle"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("suspendUntil"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("takendown"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Timestamp referencing when the last update was made to the moderation status of the subject",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectView"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Detailed view of a subject. For record subjects, the author's repo and profile will be returned.",
),
),
required: Some(
vec![SmolStr::new_static("type"), SmolStr::new_static("subject")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("profile"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#recordViewDetail"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repo"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#repoViewDetail"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#subjectStatusView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subject"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"com.atproto.moderation.defs#subjectType",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("timelineEventPlcCreate"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("timelineEventPlcOperation"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("timelineEventPlcTombstone"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("videoDetails"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("width"),
SmolStr::new_static("height"),
SmolStr::new_static("length"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("height"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("length"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("width"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod age_assurance_event_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type CreatedAt;
type Status;
type AttemptId;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Status = Unset;
type AttemptId = Unset;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type CreatedAt = Set<members::created_at>;
type Status = St::Status;
type AttemptId = St::AttemptId;
}
pub struct SetStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStatus<St> {}
impl<St: State> State for SetStatus<St> {
type CreatedAt = St::CreatedAt;
type Status = Set<members::status>;
type AttemptId = St::AttemptId;
}
pub struct SetAttemptId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAttemptId<St> {}
impl<St: State> State for SetAttemptId<St> {
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type AttemptId = Set<members::attempt_id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct status(());
pub struct attempt_id(());
}
}
pub struct AgeAssuranceEventBuilder<S: BosStr, St: age_assurance_event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Access<S>>,
Option<S>,
Option<S>,
Option<S>,
Option<S>,
Option<Datetime>,
Option<S>,
Option<S>,
Option<S>,
Option<AgeAssuranceEventStatus<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> AgeAssuranceEvent<S> {
pub fn new() -> AgeAssuranceEventBuilder<S, age_assurance_event_state::Empty> {
AgeAssuranceEventBuilder::new()
}
}
impl<S: BosStr> AgeAssuranceEventBuilder<S, age_assurance_event_state::Empty> {
pub fn new() -> Self {
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn access(mut self, value: impl Into<Option<Access<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_access(mut self, value: Option<Access<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::AttemptId: age_assurance_event_state::IsUnset,
{
pub fn attempt_id(
mut self,
value: impl Into<S>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetAttemptId<St>> {
self._fields.1 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn complete_ip(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_complete_ip(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn complete_ua(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_complete_ua(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn country_code(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_country_code(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::CreatedAt: age_assurance_event_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetCreatedAt<St>> {
self._fields.5 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn init_ip(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_init_ip(mut self, value: Option<S>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn init_ua(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_init_ua(mut self, value: Option<S>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn region_code(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_region_code(mut self, value: Option<S>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::Status: age_assurance_event_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<AgeAssuranceEventStatus<S>>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetStatus<St>> {
self._fields.9 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::CreatedAt: age_assurance_event_state::IsSet,
St::Status: age_assurance_event_state::IsSet,
St::AttemptId: age_assurance_event_state::IsSet,
{
pub fn build(self) -> AgeAssuranceEvent<S> {
AgeAssuranceEvent {
access: self._fields.0,
attempt_id: self._fields.1.unwrap(),
complete_ip: self._fields.2,
complete_ua: self._fields.3,
country_code: self._fields.4,
created_at: self._fields.5.unwrap(),
init_ip: self._fields.6,
init_ua: self._fields.7,
region_code: self._fields.8,
status: self._fields.9.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> AgeAssuranceEvent<S> {
AgeAssuranceEvent {
access: self._fields.0,
attempt_id: self._fields.1.unwrap(),
complete_ip: self._fields.2,
complete_ua: self._fields.3,
country_code: self._fields.4,
created_at: self._fields.5.unwrap(),
init_ip: self._fields.6,
init_ua: self._fields.7,
region_code: self._fields.8,
status: self._fields.9.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod blob_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Size;
type CreatedAt;
type Cid;
type MimeType;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Size = Unset;
type CreatedAt = Unset;
type Cid = Unset;
type MimeType = Unset;
}
pub struct SetSize<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSize<St> {}
impl<St: State> State for SetSize<St> {
type Size = Set<members::size>;
type CreatedAt = St::CreatedAt;
type Cid = St::Cid;
type MimeType = St::MimeType;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Size = St::Size;
type CreatedAt = Set<members::created_at>;
type Cid = St::Cid;
type MimeType = St::MimeType;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Size = St::Size;
type CreatedAt = St::CreatedAt;
type Cid = Set<members::cid>;
type MimeType = St::MimeType;
}
pub struct SetMimeType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMimeType<St> {}
impl<St: State> State for SetMimeType<St> {
type Size = St::Size;
type CreatedAt = St::CreatedAt;
type Cid = St::Cid;
type MimeType = Set<members::mime_type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct size(());
pub struct created_at(());
pub struct cid(());
pub struct mime_type(());
}
}
pub struct BlobViewBuilder<S: BosStr, St: blob_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Cid<S>>,
Option<Datetime>,
Option<BlobViewDetails<S>>,
Option<S>,
Option<moderation::Moderation<S>>,
Option<i64>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> BlobView<S> {
pub fn new() -> BlobViewBuilder<S, blob_view_state::Empty> {
BlobViewBuilder::new()
}
}
impl<S: BosStr> BlobViewBuilder<S, blob_view_state::Empty> {
pub fn new() -> Self {
BlobViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobViewBuilder<S, St>
where
St: blob_view_state::State,
St::Cid: blob_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> BlobViewBuilder<S, blob_view_state::SetCid<St>> {
self._fields.0 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobViewBuilder<S, St>
where
St: blob_view_state::State,
St::CreatedAt: blob_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> BlobViewBuilder<S, blob_view_state::SetCreatedAt<St>> {
self._fields.1 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: blob_view_state::State> BlobViewBuilder<S, St> {
pub fn details(mut self, value: impl Into<Option<BlobViewDetails<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_details(mut self, value: Option<BlobViewDetails<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> BlobViewBuilder<S, St>
where
St: blob_view_state::State,
St::MimeType: blob_view_state::IsUnset,
{
pub fn mime_type(
mut self,
value: impl Into<S>,
) -> BlobViewBuilder<S, blob_view_state::SetMimeType<St>> {
self._fields.3 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: blob_view_state::State> BlobViewBuilder<S, St> {
pub fn moderation(mut self, value: impl Into<Option<moderation::Moderation<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_moderation(mut self, value: Option<moderation::Moderation<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> BlobViewBuilder<S, St>
where
St: blob_view_state::State,
St::Size: blob_view_state::IsUnset,
{
pub fn size(
mut self,
value: impl Into<i64>,
) -> BlobViewBuilder<S, blob_view_state::SetSize<St>> {
self._fields.5 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlobViewBuilder<S, St>
where
St: blob_view_state::State,
St::Size: blob_view_state::IsSet,
St::CreatedAt: blob_view_state::IsSet,
St::Cid: blob_view_state::IsSet,
St::MimeType: blob_view_state::IsSet,
{
pub fn build(self) -> BlobView<S> {
BlobView {
cid: self._fields.0.unwrap(),
created_at: self._fields.1.unwrap(),
details: self._fields.2,
mime_type: self._fields.3.unwrap(),
moderation: self._fields.4,
size: self._fields.5.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> BlobView<S> {
BlobView {
cid: self._fields.0.unwrap(),
created_at: self._fields.1.unwrap(),
details: self._fields.2,
mime_type: self._fields.3.unwrap(),
moderation: self._fields.4,
size: self._fields.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod identity_event_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Timestamp;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Timestamp = Unset;
}
pub struct SetTimestamp<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTimestamp<St> {}
impl<St: State> State for SetTimestamp<St> {
type Timestamp = Set<members::timestamp>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct timestamp(());
}
}
pub struct IdentityEventBuilder<S: BosStr, St: identity_event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<Handle<S>>,
Option<UriValue<S>>,
Option<Datetime>,
Option<bool>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> IdentityEvent<S> {
pub fn new() -> IdentityEventBuilder<S, identity_event_state::Empty> {
IdentityEventBuilder::new()
}
}
impl<S: BosStr> IdentityEventBuilder<S, identity_event_state::Empty> {
pub fn new() -> Self {
IdentityEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: identity_event_state::State> IdentityEventBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: identity_event_state::State> IdentityEventBuilder<S, St> {
pub fn handle(mut self, value: impl Into<Option<Handle<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_handle(mut self, value: Option<Handle<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: identity_event_state::State> IdentityEventBuilder<S, St> {
pub fn pds_host(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_pds_host(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> IdentityEventBuilder<S, St>
where
St: identity_event_state::State,
St::Timestamp: identity_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> IdentityEventBuilder<S, identity_event_state::SetTimestamp<St>> {
self._fields.3 = Option::Some(value.into());
IdentityEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: identity_event_state::State> IdentityEventBuilder<S, St> {
pub fn tombstone(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_tombstone(mut self, value: Option<bool>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> IdentityEventBuilder<S, St>
where
St: identity_event_state::State,
St::Timestamp: identity_event_state::IsSet,
{
pub fn build(self) -> IdentityEvent<S> {
IdentityEvent {
comment: self._fields.0,
handle: self._fields.1,
pds_host: self._fields.2,
timestamp: self._fields.3.unwrap(),
tombstone: self._fields.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> IdentityEvent<S> {
IdentityEvent {
comment: self._fields.0,
handle: self._fields.1,
pds_host: self._fields.2,
timestamp: self._fields.3.unwrap(),
tombstone: self._fields.4,
extra_data: Some(extra_data),
}
}
}
pub mod image_details_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Width;
type Height;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Width = Unset;
type Height = Unset;
}
pub struct SetWidth<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWidth<St> {}
impl<St: State> State for SetWidth<St> {
type Width = Set<members::width>;
type Height = St::Height;
}
pub struct SetHeight<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHeight<St> {}
impl<St: State> State for SetHeight<St> {
type Width = St::Width;
type Height = Set<members::height>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct width(());
pub struct height(());
}
}
pub struct ImageDetailsBuilder<S: BosStr, St: image_details_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ImageDetails<S> {
pub fn new() -> ImageDetailsBuilder<S, image_details_state::Empty> {
ImageDetailsBuilder::new()
}
}
impl<S: BosStr> ImageDetailsBuilder<S, image_details_state::Empty> {
pub fn new() -> Self {
ImageDetailsBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ImageDetailsBuilder<S, St>
where
St: image_details_state::State,
St::Height: image_details_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> ImageDetailsBuilder<S, image_details_state::SetHeight<St>> {
self._fields.0 = Option::Some(value.into());
ImageDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ImageDetailsBuilder<S, St>
where
St: image_details_state::State,
St::Width: image_details_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> ImageDetailsBuilder<S, image_details_state::SetWidth<St>> {
self._fields.1 = Option::Some(value.into());
ImageDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ImageDetailsBuilder<S, St>
where
St: image_details_state::State,
St::Width: image_details_state::IsSet,
St::Height: image_details_state::IsSet,
{
pub fn build(self) -> ImageDetails<S> {
ImageDetails {
height: self._fields.0.unwrap(),
width: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ImageDetails<S> {
ImageDetails {
height: self._fields.0.unwrap(),
width: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_label_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type NegateLabelVals;
type CreateLabelVals;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type NegateLabelVals = Unset;
type CreateLabelVals = Unset;
}
pub struct SetNegateLabelVals<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetNegateLabelVals<St> {}
impl<St: State> State for SetNegateLabelVals<St> {
type NegateLabelVals = Set<members::negate_label_vals>;
type CreateLabelVals = St::CreateLabelVals;
}
pub struct SetCreateLabelVals<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreateLabelVals<St> {}
impl<St: State> State for SetCreateLabelVals<St> {
type NegateLabelVals = St::NegateLabelVals;
type CreateLabelVals = Set<members::create_label_vals>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct negate_label_vals(());
pub struct create_label_vals(());
}
}
pub struct ModEventLabelBuilder<S: BosStr, St: mod_event_label_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<Vec<S>>, Option<i64>, Option<Vec<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventLabel<S> {
pub fn new() -> ModEventLabelBuilder<S, mod_event_label_state::Empty> {
ModEventLabelBuilder::new()
}
}
impl<S: BosStr> ModEventLabelBuilder<S, mod_event_label_state::Empty> {
pub fn new() -> Self {
ModEventLabelBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_label_state::State> ModEventLabelBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> ModEventLabelBuilder<S, St>
where
St: mod_event_label_state::State,
St::CreateLabelVals: mod_event_label_state::IsUnset,
{
pub fn create_label_vals(
mut self,
value: impl Into<Vec<S>>,
) -> ModEventLabelBuilder<S, mod_event_label_state::SetCreateLabelVals<St>> {
self._fields.1 = Option::Some(value.into());
ModEventLabelBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_label_state::State> ModEventLabelBuilder<S, St> {
pub fn duration_in_hours(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_duration_in_hours(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> ModEventLabelBuilder<S, St>
where
St: mod_event_label_state::State,
St::NegateLabelVals: mod_event_label_state::IsUnset,
{
pub fn negate_label_vals(
mut self,
value: impl Into<Vec<S>>,
) -> ModEventLabelBuilder<S, mod_event_label_state::SetNegateLabelVals<St>> {
self._fields.3 = Option::Some(value.into());
ModEventLabelBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventLabelBuilder<S, St>
where
St: mod_event_label_state::State,
St::NegateLabelVals: mod_event_label_state::IsSet,
St::CreateLabelVals: mod_event_label_state::IsSet,
{
pub fn build(self) -> ModEventLabel<S> {
ModEventLabel {
comment: self._fields.0,
create_label_vals: self._fields.1.unwrap(),
duration_in_hours: self._fields.2,
negate_label_vals: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventLabel<S> {
ModEventLabel {
comment: self._fields.0,
create_label_vals: self._fields.1.unwrap(),
duration_in_hours: self._fields.2,
negate_label_vals: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_mute_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type DurationInHours;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type DurationInHours = Unset;
}
pub struct SetDurationInHours<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDurationInHours<St> {}
impl<St: State> State for SetDurationInHours<St> {
type DurationInHours = Set<members::duration_in_hours>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct duration_in_hours(());
}
}
pub struct ModEventMuteBuilder<S: BosStr, St: mod_event_mute_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventMute<S> {
pub fn new() -> ModEventMuteBuilder<S, mod_event_mute_state::Empty> {
ModEventMuteBuilder::new()
}
}
impl<S: BosStr> ModEventMuteBuilder<S, mod_event_mute_state::Empty> {
pub fn new() -> Self {
ModEventMuteBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_mute_state::State> ModEventMuteBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> ModEventMuteBuilder<S, St>
where
St: mod_event_mute_state::State,
St::DurationInHours: mod_event_mute_state::IsUnset,
{
pub fn duration_in_hours(
mut self,
value: impl Into<i64>,
) -> ModEventMuteBuilder<S, mod_event_mute_state::SetDurationInHours<St>> {
self._fields.1 = Option::Some(value.into());
ModEventMuteBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventMuteBuilder<S, St>
where
St: mod_event_mute_state::State,
St::DurationInHours: mod_event_mute_state::IsSet,
{
pub fn build(self) -> ModEventMute<S> {
ModEventMute {
comment: self._fields.0,
duration_in_hours: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventMute<S> {
ModEventMute {
comment: self._fields.0,
duration_in_hours: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_priority_score_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Score;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Score = Unset;
}
pub struct SetScore<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetScore<St> {}
impl<St: State> State for SetScore<St> {
type Score = Set<members::score>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct score(());
}
}
pub struct ModEventPriorityScoreBuilder<S: BosStr, St: mod_event_priority_score_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventPriorityScore<S> {
pub fn new() -> ModEventPriorityScoreBuilder<S, mod_event_priority_score_state::Empty> {
ModEventPriorityScoreBuilder::new()
}
}
impl<S: BosStr> ModEventPriorityScoreBuilder<S, mod_event_priority_score_state::Empty> {
pub fn new() -> Self {
ModEventPriorityScoreBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_priority_score_state::State> ModEventPriorityScoreBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> ModEventPriorityScoreBuilder<S, St>
where
St: mod_event_priority_score_state::State,
St::Score: mod_event_priority_score_state::IsUnset,
{
pub fn score(
mut self,
value: impl Into<i64>,
) -> ModEventPriorityScoreBuilder<S, mod_event_priority_score_state::SetScore<St>> {
self._fields.1 = Option::Some(value.into());
ModEventPriorityScoreBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventPriorityScoreBuilder<S, St>
where
St: mod_event_priority_score_state::State,
St::Score: mod_event_priority_score_state::IsSet,
{
pub fn build(self) -> ModEventPriorityScore<S> {
ModEventPriorityScore {
comment: self._fields.0,
score: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ModEventPriorityScore<S> {
ModEventPriorityScore {
comment: self._fields.0,
score: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_report_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type ReportType;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ReportType = Unset;
}
pub struct SetReportType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetReportType<St> {}
impl<St: State> State for SetReportType<St> {
type ReportType = Set<members::report_type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct report_type(());
}
}
pub struct ModEventReportBuilder<S: BosStr, St: mod_event_report_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<bool>, Option<ReasonType<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventReport<S> {
pub fn new() -> ModEventReportBuilder<S, mod_event_report_state::Empty> {
ModEventReportBuilder::new()
}
}
impl<S: BosStr> ModEventReportBuilder<S, mod_event_report_state::Empty> {
pub fn new() -> Self {
ModEventReportBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_report_state::State> ModEventReportBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: mod_event_report_state::State> ModEventReportBuilder<S, St> {
pub fn is_reporter_muted(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_is_reporter_muted(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> ModEventReportBuilder<S, St>
where
St: mod_event_report_state::State,
St::ReportType: mod_event_report_state::IsUnset,
{
pub fn report_type(
mut self,
value: impl Into<ReasonType<S>>,
) -> ModEventReportBuilder<S, mod_event_report_state::SetReportType<St>> {
self._fields.2 = Option::Some(value.into());
ModEventReportBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventReportBuilder<S, St>
where
St: mod_event_report_state::State,
St::ReportType: mod_event_report_state::IsSet,
{
pub fn build(self) -> ModEventReport<S> {
ModEventReport {
comment: self._fields.0,
is_reporter_muted: self._fields.1,
report_type: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventReport<S> {
ModEventReport {
comment: self._fields.0,
is_reporter_muted: self._fields.1,
report_type: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_tag_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Add;
type Remove;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Add = Unset;
type Remove = Unset;
}
pub struct SetAdd<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAdd<St> {}
impl<St: State> State for SetAdd<St> {
type Add = Set<members::add>;
type Remove = St::Remove;
}
pub struct SetRemove<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRemove<St> {}
impl<St: State> State for SetRemove<St> {
type Add = St::Add;
type Remove = Set<members::remove>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct add(());
pub struct remove(());
}
}
pub struct ModEventTagBuilder<S: BosStr, St: mod_event_tag_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<S>>, Option<S>, Option<Vec<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventTag<S> {
pub fn new() -> ModEventTagBuilder<S, mod_event_tag_state::Empty> {
ModEventTagBuilder::new()
}
}
impl<S: BosStr> ModEventTagBuilder<S, mod_event_tag_state::Empty> {
pub fn new() -> Self {
ModEventTagBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventTagBuilder<S, St>
where
St: mod_event_tag_state::State,
St::Add: mod_event_tag_state::IsUnset,
{
pub fn add(
mut self,
value: impl Into<Vec<S>>,
) -> ModEventTagBuilder<S, mod_event_tag_state::SetAdd<St>> {
self._fields.0 = Option::Some(value.into());
ModEventTagBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_tag_state::State> ModEventTagBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> ModEventTagBuilder<S, St>
where
St: mod_event_tag_state::State,
St::Remove: mod_event_tag_state::IsUnset,
{
pub fn remove(
mut self,
value: impl Into<Vec<S>>,
) -> ModEventTagBuilder<S, mod_event_tag_state::SetRemove<St>> {
self._fields.2 = Option::Some(value.into());
ModEventTagBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventTagBuilder<S, St>
where
St: mod_event_tag_state::State,
St::Add: mod_event_tag_state::IsSet,
St::Remove: mod_event_tag_state::IsSet,
{
pub fn build(self) -> ModEventTag<S> {
ModEventTag {
add: self._fields.0.unwrap(),
comment: self._fields.1,
remove: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventTag<S> {
ModEventTag {
add: self._fields.0.unwrap(),
comment: self._fields.1,
remove: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type Subject;
type CreatedBy;
type Event;
type SubjectBlobCids;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Subject = Unset;
type CreatedBy = Unset;
type Event = Unset;
type SubjectBlobCids = Unset;
type CreatedAt = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Subject = St::Subject;
type CreatedBy = St::CreatedBy;
type Event = St::Event;
type SubjectBlobCids = St::SubjectBlobCids;
type CreatedAt = St::CreatedAt;
}
pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubject<St> {}
impl<St: State> State for SetSubject<St> {
type Id = St::Id;
type Subject = Set<members::subject>;
type CreatedBy = St::CreatedBy;
type Event = St::Event;
type SubjectBlobCids = St::SubjectBlobCids;
type CreatedAt = St::CreatedAt;
}
pub struct SetCreatedBy<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedBy<St> {}
impl<St: State> State for SetCreatedBy<St> {
type Id = St::Id;
type Subject = St::Subject;
type CreatedBy = Set<members::created_by>;
type Event = St::Event;
type SubjectBlobCids = St::SubjectBlobCids;
type CreatedAt = St::CreatedAt;
}
pub struct SetEvent<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEvent<St> {}
impl<St: State> State for SetEvent<St> {
type Id = St::Id;
type Subject = St::Subject;
type CreatedBy = St::CreatedBy;
type Event = Set<members::event>;
type SubjectBlobCids = St::SubjectBlobCids;
type CreatedAt = St::CreatedAt;
}
pub struct SetSubjectBlobCids<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubjectBlobCids<St> {}
impl<St: State> State for SetSubjectBlobCids<St> {
type Id = St::Id;
type Subject = St::Subject;
type CreatedBy = St::CreatedBy;
type Event = St::Event;
type SubjectBlobCids = Set<members::subject_blob_cids>;
type CreatedAt = St::CreatedAt;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Id = St::Id;
type Subject = St::Subject;
type CreatedBy = St::CreatedBy;
type Event = St::Event;
type SubjectBlobCids = St::SubjectBlobCids;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct subject(());
pub struct created_by(());
pub struct event(());
pub struct subject_blob_cids(());
pub struct created_at(());
}
}
pub struct ModEventViewBuilder<S: BosStr, St: mod_event_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<Did<S>>,
Option<S>,
Option<ModEventViewEvent<S>>,
Option<i64>,
Option<moderation::ModTool<S>>,
Option<ModEventViewSubject<S>>,
Option<Vec<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventView<S> {
pub fn new() -> ModEventViewBuilder<S, mod_event_view_state::Empty> {
ModEventViewBuilder::new()
}
}
impl<S: BosStr> ModEventViewBuilder<S, mod_event_view_state::Empty> {
pub fn new() -> Self {
ModEventViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::CreatedAt: mod_event_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::CreatedBy: mod_event_view_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<S>>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetCreatedBy<St>> {
self._fields.1 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_view_state::State> ModEventViewBuilder<S, St> {
pub fn creator_handle(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_creator_handle(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::Event: mod_event_view_state::IsUnset,
{
pub fn event(
mut self,
value: impl Into<ModEventViewEvent<S>>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetEvent<St>> {
self._fields.3 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::Id: mod_event_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetId<St>> {
self._fields.4 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_view_state::State> ModEventViewBuilder<S, St> {
pub fn mod_tool(mut self, value: impl Into<Option<moderation::ModTool<S>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<S>>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::Subject: mod_event_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<ModEventViewSubject<S>>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetSubject<St>> {
self._fields.6 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::SubjectBlobCids: mod_event_view_state::IsUnset,
{
pub fn subject_blob_cids(
mut self,
value: impl Into<Vec<S>>,
) -> ModEventViewBuilder<S, mod_event_view_state::SetSubjectBlobCids<St>> {
self._fields.7 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_view_state::State> ModEventViewBuilder<S, St> {
pub fn subject_handle(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_subject_handle(mut self, value: Option<S>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> ModEventViewBuilder<S, St>
where
St: mod_event_view_state::State,
St::Id: mod_event_view_state::IsSet,
St::Subject: mod_event_view_state::IsSet,
St::CreatedBy: mod_event_view_state::IsSet,
St::Event: mod_event_view_state::IsSet,
St::SubjectBlobCids: mod_event_view_state::IsSet,
St::CreatedAt: mod_event_view_state::IsSet,
{
pub fn build(self) -> ModEventView<S> {
ModEventView {
created_at: self._fields.0.unwrap(),
created_by: self._fields.1.unwrap(),
creator_handle: self._fields.2,
event: self._fields.3.unwrap(),
id: self._fields.4.unwrap(),
mod_tool: self._fields.5,
subject: self._fields.6.unwrap(),
subject_blob_cids: self._fields.7.unwrap(),
subject_handle: self._fields.8,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventView<S> {
ModEventView {
created_at: self._fields.0.unwrap(),
created_by: self._fields.1.unwrap(),
creator_handle: self._fields.2,
event: self._fields.3.unwrap(),
id: self._fields.4.unwrap(),
mod_tool: self._fields.5,
subject: self._fields.6.unwrap(),
subject_blob_cids: self._fields.7.unwrap(),
subject_handle: self._fields.8,
extra_data: Some(extra_data),
}
}
}
pub mod mod_event_view_detail_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Subject;
type Id;
type CreatedBy;
type SubjectBlobs;
type CreatedAt;
type Event;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Subject = Unset;
type Id = Unset;
type CreatedBy = Unset;
type SubjectBlobs = Unset;
type CreatedAt = Unset;
type Event = Unset;
}
pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubject<St> {}
impl<St: State> State for SetSubject<St> {
type Subject = Set<members::subject>;
type Id = St::Id;
type CreatedBy = St::CreatedBy;
type SubjectBlobs = St::SubjectBlobs;
type CreatedAt = St::CreatedAt;
type Event = St::Event;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Subject = St::Subject;
type Id = Set<members::id>;
type CreatedBy = St::CreatedBy;
type SubjectBlobs = St::SubjectBlobs;
type CreatedAt = St::CreatedAt;
type Event = St::Event;
}
pub struct SetCreatedBy<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedBy<St> {}
impl<St: State> State for SetCreatedBy<St> {
type Subject = St::Subject;
type Id = St::Id;
type CreatedBy = Set<members::created_by>;
type SubjectBlobs = St::SubjectBlobs;
type CreatedAt = St::CreatedAt;
type Event = St::Event;
}
pub struct SetSubjectBlobs<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubjectBlobs<St> {}
impl<St: State> State for SetSubjectBlobs<St> {
type Subject = St::Subject;
type Id = St::Id;
type CreatedBy = St::CreatedBy;
type SubjectBlobs = Set<members::subject_blobs>;
type CreatedAt = St::CreatedAt;
type Event = St::Event;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Subject = St::Subject;
type Id = St::Id;
type CreatedBy = St::CreatedBy;
type SubjectBlobs = St::SubjectBlobs;
type CreatedAt = Set<members::created_at>;
type Event = St::Event;
}
pub struct SetEvent<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEvent<St> {}
impl<St: State> State for SetEvent<St> {
type Subject = St::Subject;
type Id = St::Id;
type CreatedBy = St::CreatedBy;
type SubjectBlobs = St::SubjectBlobs;
type CreatedAt = St::CreatedAt;
type Event = Set<members::event>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct subject(());
pub struct id(());
pub struct created_by(());
pub struct subject_blobs(());
pub struct created_at(());
pub struct event(());
}
}
pub struct ModEventViewDetailBuilder<S: BosStr, St: mod_event_view_detail_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<Did<S>>,
Option<ModEventViewDetailEvent<S>>,
Option<i64>,
Option<moderation::ModTool<S>>,
Option<ModEventViewDetailSubject<S>>,
Option<Vec<moderation::BlobView<S>>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ModEventViewDetail<S> {
pub fn new() -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::Empty> {
ModEventViewDetailBuilder::new()
}
}
impl<S: BosStr> ModEventViewDetailBuilder<S, mod_event_view_detail_state::Empty> {
pub fn new() -> Self {
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::CreatedAt: mod_event_view_detail_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::CreatedBy: mod_event_view_detail_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<S>>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetCreatedBy<St>> {
self._fields.1 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::Event: mod_event_view_detail_state::IsUnset,
{
pub fn event(
mut self,
value: impl Into<ModEventViewDetailEvent<S>>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetEvent<St>> {
self._fields.2 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::Id: mod_event_view_detail_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetId<St>> {
self._fields.3 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: mod_event_view_detail_state::State> ModEventViewDetailBuilder<S, St> {
pub fn mod_tool(mut self, value: impl Into<Option<moderation::ModTool<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::Subject: mod_event_view_detail_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<ModEventViewDetailSubject<S>>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetSubject<St>> {
self._fields.5 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::SubjectBlobs: mod_event_view_detail_state::IsUnset,
{
pub fn subject_blobs(
mut self,
value: impl Into<Vec<moderation::BlobView<S>>>,
) -> ModEventViewDetailBuilder<S, mod_event_view_detail_state::SetSubjectBlobs<St>> {
self._fields.6 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ModEventViewDetailBuilder<S, St>
where
St: mod_event_view_detail_state::State,
St::Subject: mod_event_view_detail_state::IsSet,
St::Id: mod_event_view_detail_state::IsSet,
St::CreatedBy: mod_event_view_detail_state::IsSet,
St::SubjectBlobs: mod_event_view_detail_state::IsSet,
St::CreatedAt: mod_event_view_detail_state::IsSet,
St::Event: mod_event_view_detail_state::IsSet,
{
pub fn build(self) -> ModEventViewDetail<S> {
ModEventViewDetail {
created_at: self._fields.0.unwrap(),
created_by: self._fields.1.unwrap(),
event: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
mod_tool: self._fields.4,
subject: self._fields.5.unwrap(),
subject_blobs: self._fields.6.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ModEventViewDetail<S> {
ModEventViewDetail {
created_at: self._fields.0.unwrap(),
created_by: self._fields.1.unwrap(),
event: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
mod_tool: self._fields.4,
subject: self._fields.5.unwrap(),
subject_blobs: self._fields.6.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod record_event_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Op;
type Timestamp;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Op = Unset;
type Timestamp = Unset;
}
pub struct SetOp<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetOp<St> {}
impl<St: State> State for SetOp<St> {
type Op = Set<members::op>;
type Timestamp = St::Timestamp;
}
pub struct SetTimestamp<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTimestamp<St> {}
impl<St: State> State for SetTimestamp<St> {
type Op = St::Op;
type Timestamp = Set<members::timestamp>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct op(());
pub struct timestamp(());
}
}
pub struct RecordEventBuilder<S: BosStr, St: record_event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Cid<S>>,
Option<S>,
Option<RecordEventOp<S>>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RecordEvent<S> {
pub fn new() -> RecordEventBuilder<S, record_event_state::Empty> {
RecordEventBuilder::new()
}
}
impl<S: BosStr> RecordEventBuilder<S, record_event_state::Empty> {
pub fn new() -> Self {
RecordEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: record_event_state::State> RecordEventBuilder<S, St> {
pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: record_event_state::State> RecordEventBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> RecordEventBuilder<S, St>
where
St: record_event_state::State,
St::Op: record_event_state::IsUnset,
{
pub fn op(
mut self,
value: impl Into<RecordEventOp<S>>,
) -> RecordEventBuilder<S, record_event_state::SetOp<St>> {
self._fields.2 = Option::Some(value.into());
RecordEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordEventBuilder<S, St>
where
St: record_event_state::State,
St::Timestamp: record_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> RecordEventBuilder<S, record_event_state::SetTimestamp<St>> {
self._fields.3 = Option::Some(value.into());
RecordEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordEventBuilder<S, St>
where
St: record_event_state::State,
St::Op: record_event_state::IsSet,
St::Timestamp: record_event_state::IsSet,
{
pub fn build(self) -> RecordEvent<S> {
RecordEvent {
cid: self._fields.0,
comment: self._fields.1,
op: self._fields.2.unwrap(),
timestamp: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RecordEvent<S> {
RecordEvent {
cid: self._fields.0,
comment: self._fields.1,
op: self._fields.2.unwrap(),
timestamp: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod record_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
type BlobCids;
type Value;
type IndexedAt;
type Moderation;
type Repo;
type Cid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type BlobCids = Unset;
type Value = Unset;
type IndexedAt = Unset;
type Moderation = Unset;
type Repo = Unset;
type Cid = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
type BlobCids = St::BlobCids;
type Value = St::Value;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
type Repo = St::Repo;
type Cid = St::Cid;
}
pub struct SetBlobCids<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBlobCids<St> {}
impl<St: State> State for SetBlobCids<St> {
type Uri = St::Uri;
type BlobCids = Set<members::blob_cids>;
type Value = St::Value;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
type Repo = St::Repo;
type Cid = St::Cid;
}
pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetValue<St> {}
impl<St: State> State for SetValue<St> {
type Uri = St::Uri;
type BlobCids = St::BlobCids;
type Value = Set<members::value>;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
type Repo = St::Repo;
type Cid = St::Cid;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Uri = St::Uri;
type BlobCids = St::BlobCids;
type Value = St::Value;
type IndexedAt = Set<members::indexed_at>;
type Moderation = St::Moderation;
type Repo = St::Repo;
type Cid = St::Cid;
}
pub struct SetModeration<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetModeration<St> {}
impl<St: State> State for SetModeration<St> {
type Uri = St::Uri;
type BlobCids = St::BlobCids;
type Value = St::Value;
type IndexedAt = St::IndexedAt;
type Moderation = Set<members::moderation>;
type Repo = St::Repo;
type Cid = St::Cid;
}
pub struct SetRepo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Uri = St::Uri;
type BlobCids = St::BlobCids;
type Value = St::Value;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
type Repo = Set<members::repo>;
type Cid = St::Cid;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Uri = St::Uri;
type BlobCids = St::BlobCids;
type Value = St::Value;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
type Repo = St::Repo;
type Cid = Set<members::cid>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct blob_cids(());
pub struct value(());
pub struct indexed_at(());
pub struct moderation(());
pub struct repo(());
pub struct cid(());
}
}
pub struct RecordViewBuilder<S: BosStr, St: record_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<Cid<S>>>,
Option<Cid<S>>,
Option<Datetime>,
Option<moderation::Moderation<S>>,
Option<moderation::RepoView<S>>,
Option<AtUri<S>>,
Option<Data<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RecordView<S> {
pub fn new() -> RecordViewBuilder<S, record_view_state::Empty> {
RecordViewBuilder::new()
}
}
impl<S: BosStr> RecordViewBuilder<S, record_view_state::Empty> {
pub fn new() -> Self {
RecordViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::BlobCids: record_view_state::IsUnset,
{
pub fn blob_cids(
mut self,
value: impl Into<Vec<Cid<S>>>,
) -> RecordViewBuilder<S, record_view_state::SetBlobCids<St>> {
self._fields.0 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Cid: record_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> RecordViewBuilder<S, record_view_state::SetCid<St>> {
self._fields.1 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::IndexedAt: record_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RecordViewBuilder<S, record_view_state::SetIndexedAt<St>> {
self._fields.2 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Moderation: record_view_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::Moderation<S>>,
) -> RecordViewBuilder<S, record_view_state::SetModeration<St>> {
self._fields.3 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Repo: record_view_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<moderation::RepoView<S>>,
) -> RecordViewBuilder<S, record_view_state::SetRepo<St>> {
self._fields.4 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Uri: record_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> RecordViewBuilder<S, record_view_state::SetUri<St>> {
self._fields.5 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Value: record_view_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<Data<S>>,
) -> RecordViewBuilder<S, record_view_state::SetValue<St>> {
self._fields.6 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewBuilder<S, St>
where
St: record_view_state::State,
St::Uri: record_view_state::IsSet,
St::BlobCids: record_view_state::IsSet,
St::Value: record_view_state::IsSet,
St::IndexedAt: record_view_state::IsSet,
St::Moderation: record_view_state::IsSet,
St::Repo: record_view_state::IsSet,
St::Cid: record_view_state::IsSet,
{
pub fn build(self) -> RecordView<S> {
RecordView {
blob_cids: self._fields.0.unwrap(),
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
moderation: self._fields.3.unwrap(),
repo: self._fields.4.unwrap(),
uri: self._fields.5.unwrap(),
value: self._fields.6.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RecordView<S> {
RecordView {
blob_cids: self._fields.0.unwrap(),
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
moderation: self._fields.3.unwrap(),
repo: self._fields.4.unwrap(),
uri: self._fields.5.unwrap(),
value: self._fields.6.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod record_view_detail_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
type Blobs;
type Cid;
type Moderation;
type IndexedAt;
type Repo;
type Value;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Blobs = Unset;
type Cid = Unset;
type Moderation = Unset;
type IndexedAt = Unset;
type Repo = Unset;
type Value = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
type Blobs = St::Blobs;
type Cid = St::Cid;
type Moderation = St::Moderation;
type IndexedAt = St::IndexedAt;
type Repo = St::Repo;
type Value = St::Value;
}
pub struct SetBlobs<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBlobs<St> {}
impl<St: State> State for SetBlobs<St> {
type Uri = St::Uri;
type Blobs = Set<members::blobs>;
type Cid = St::Cid;
type Moderation = St::Moderation;
type IndexedAt = St::IndexedAt;
type Repo = St::Repo;
type Value = St::Value;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Uri = St::Uri;
type Blobs = St::Blobs;
type Cid = Set<members::cid>;
type Moderation = St::Moderation;
type IndexedAt = St::IndexedAt;
type Repo = St::Repo;
type Value = St::Value;
}
pub struct SetModeration<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetModeration<St> {}
impl<St: State> State for SetModeration<St> {
type Uri = St::Uri;
type Blobs = St::Blobs;
type Cid = St::Cid;
type Moderation = Set<members::moderation>;
type IndexedAt = St::IndexedAt;
type Repo = St::Repo;
type Value = St::Value;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Uri = St::Uri;
type Blobs = St::Blobs;
type Cid = St::Cid;
type Moderation = St::Moderation;
type IndexedAt = Set<members::indexed_at>;
type Repo = St::Repo;
type Value = St::Value;
}
pub struct SetRepo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Uri = St::Uri;
type Blobs = St::Blobs;
type Cid = St::Cid;
type Moderation = St::Moderation;
type IndexedAt = St::IndexedAt;
type Repo = Set<members::repo>;
type Value = St::Value;
}
pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetValue<St> {}
impl<St: State> State for SetValue<St> {
type Uri = St::Uri;
type Blobs = St::Blobs;
type Cid = St::Cid;
type Moderation = St::Moderation;
type IndexedAt = St::IndexedAt;
type Repo = St::Repo;
type Value = Set<members::value>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct blobs(());
pub struct cid(());
pub struct moderation(());
pub struct indexed_at(());
pub struct repo(());
pub struct value(());
}
}
pub struct RecordViewDetailBuilder<S: BosStr, St: record_view_detail_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<moderation::BlobView<S>>>,
Option<Cid<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<moderation::ModerationDetail<S>>,
Option<moderation::RepoView<S>>,
Option<AtUri<S>>,
Option<Data<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RecordViewDetail<S> {
pub fn new() -> RecordViewDetailBuilder<S, record_view_detail_state::Empty> {
RecordViewDetailBuilder::new()
}
}
impl<S: BosStr> RecordViewDetailBuilder<S, record_view_detail_state::Empty> {
pub fn new() -> Self {
RecordViewDetailBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Blobs: record_view_detail_state::IsUnset,
{
pub fn blobs(
mut self,
value: impl Into<Vec<moderation::BlobView<S>>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetBlobs<St>> {
self._fields.0 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Cid: record_view_detail_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetCid<St>> {
self._fields.1 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::IndexedAt: record_view_detail_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetIndexedAt<St>> {
self._fields.2 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: record_view_detail_state::State> RecordViewDetailBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Moderation: record_view_detail_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::ModerationDetail<S>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetModeration<St>> {
self._fields.4 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Repo: record_view_detail_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<moderation::RepoView<S>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetRepo<St>> {
self._fields.5 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Uri: record_view_detail_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetUri<St>> {
self._fields.6 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Value: record_view_detail_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<Data<S>>,
) -> RecordViewDetailBuilder<S, record_view_detail_state::SetValue<St>> {
self._fields.7 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewDetailBuilder<S, St>
where
St: record_view_detail_state::State,
St::Uri: record_view_detail_state::IsSet,
St::Blobs: record_view_detail_state::IsSet,
St::Cid: record_view_detail_state::IsSet,
St::Moderation: record_view_detail_state::IsSet,
St::IndexedAt: record_view_detail_state::IsSet,
St::Repo: record_view_detail_state::IsSet,
St::Value: record_view_detail_state::IsSet,
{
pub fn build(self) -> RecordViewDetail<S> {
RecordViewDetail {
blobs: self._fields.0.unwrap(),
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
labels: self._fields.3,
moderation: self._fields.4.unwrap(),
repo: self._fields.5.unwrap(),
uri: self._fields.6.unwrap(),
value: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RecordViewDetail<S> {
RecordViewDetail {
blobs: self._fields.0.unwrap(),
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
labels: self._fields.3,
moderation: self._fields.4.unwrap(),
repo: self._fields.5.unwrap(),
uri: self._fields.6.unwrap(),
value: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod record_view_not_found_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct RecordViewNotFoundBuilder<S: BosStr, St: record_view_not_found_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RecordViewNotFound<S> {
pub fn new() -> RecordViewNotFoundBuilder<S, record_view_not_found_state::Empty> {
RecordViewNotFoundBuilder::new()
}
}
impl<S: BosStr> RecordViewNotFoundBuilder<S, record_view_not_found_state::Empty> {
pub fn new() -> Self {
RecordViewNotFoundBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewNotFoundBuilder<S, St>
where
St: record_view_not_found_state::State,
St::Uri: record_view_not_found_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> RecordViewNotFoundBuilder<S, record_view_not_found_state::SetUri<St>> {
self._fields.0 = Option::Some(value.into());
RecordViewNotFoundBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RecordViewNotFoundBuilder<S, St>
where
St: record_view_not_found_state::State,
St::Uri: record_view_not_found_state::IsSet,
{
pub fn build(self) -> RecordViewNotFound<S> {
RecordViewNotFound {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RecordViewNotFound<S> {
RecordViewNotFound {
uri: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod repo_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Handle;
type RelatedRecords;
type Did;
type IndexedAt;
type Moderation;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Handle = Unset;
type RelatedRecords = Unset;
type Did = Unset;
type IndexedAt = Unset;
type Moderation = Unset;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Handle = Set<members::handle>;
type RelatedRecords = St::RelatedRecords;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
}
pub struct SetRelatedRecords<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRelatedRecords<St> {}
impl<St: State> State for SetRelatedRecords<St> {
type Handle = St::Handle;
type RelatedRecords = Set<members::related_records>;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Handle = St::Handle;
type RelatedRecords = St::RelatedRecords;
type Did = Set<members::did>;
type IndexedAt = St::IndexedAt;
type Moderation = St::Moderation;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Handle = St::Handle;
type RelatedRecords = St::RelatedRecords;
type Did = St::Did;
type IndexedAt = Set<members::indexed_at>;
type Moderation = St::Moderation;
}
pub struct SetModeration<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetModeration<St> {}
impl<St: State> State for SetModeration<St> {
type Handle = St::Handle;
type RelatedRecords = St::RelatedRecords;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type Moderation = Set<members::moderation>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct related_records(());
pub struct did(());
pub struct indexed_at(());
pub struct moderation(());
}
}
pub struct RepoViewBuilder<S: BosStr, St: repo_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<Did<S>>,
Option<S>,
Option<Handle<S>>,
Option<Datetime>,
Option<S>,
Option<InviteCode<S>>,
Option<bool>,
Option<moderation::Moderation<S>>,
Option<Vec<Data<S>>>,
Option<Vec<ThreatSignature<S>>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RepoView<S> {
pub fn new() -> RepoViewBuilder<S, repo_view_state::Empty> {
RepoViewBuilder::new()
}
}
impl<S: BosStr> RepoViewBuilder<S, repo_view_state::Empty> {
pub fn new() -> Self {
RepoViewBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn deactivated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_deactivated_at(mut self, value: Option<Datetime>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::Did: repo_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> RepoViewBuilder<S, repo_view_state::SetDid<St>> {
self._fields.1 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn email(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::Handle: repo_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> RepoViewBuilder<S, repo_view_state::SetHandle<St>> {
self._fields.3 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::IndexedAt: repo_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RepoViewBuilder<S, repo_view_state::SetIndexedAt<St>> {
self._fields.4 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn invite_note(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_invite_note(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn invited_by(mut self, value: impl Into<Option<InviteCode<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_invited_by(mut self, value: Option<InviteCode<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn invites_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_invites_disabled(mut self, value: Option<bool>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::Moderation: repo_view_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::Moderation<S>>,
) -> RepoViewBuilder<S, repo_view_state::SetModeration<St>> {
self._fields.8 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::RelatedRecords: repo_view_state::IsUnset,
{
pub fn related_records(
mut self,
value: impl Into<Vec<Data<S>>>,
) -> RepoViewBuilder<S, repo_view_state::SetRelatedRecords<St>> {
self._fields.9 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_state::State> RepoViewBuilder<S, St> {
pub fn threat_signatures(mut self, value: impl Into<Option<Vec<ThreatSignature<S>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_threat_signatures(mut self, value: Option<Vec<ThreatSignature<S>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St> RepoViewBuilder<S, St>
where
St: repo_view_state::State,
St::Handle: repo_view_state::IsSet,
St::RelatedRecords: repo_view_state::IsSet,
St::Did: repo_view_state::IsSet,
St::IndexedAt: repo_view_state::IsSet,
St::Moderation: repo_view_state::IsSet,
{
pub fn build(self) -> RepoView<S> {
RepoView {
deactivated_at: self._fields.0,
did: self._fields.1.unwrap(),
email: self._fields.2,
handle: self._fields.3.unwrap(),
indexed_at: self._fields.4.unwrap(),
invite_note: self._fields.5,
invited_by: self._fields.6,
invites_disabled: self._fields.7,
moderation: self._fields.8.unwrap(),
related_records: self._fields.9.unwrap(),
threat_signatures: self._fields.10,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RepoView<S> {
RepoView {
deactivated_at: self._fields.0,
did: self._fields.1.unwrap(),
email: self._fields.2,
handle: self._fields.3.unwrap(),
indexed_at: self._fields.4.unwrap(),
invite_note: self._fields.5,
invited_by: self._fields.6,
invites_disabled: self._fields.7,
moderation: self._fields.8.unwrap(),
related_records: self._fields.9.unwrap(),
threat_signatures: self._fields.10,
extra_data: Some(extra_data),
}
}
}
pub mod repo_view_detail_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Handle;
type Moderation;
type Did;
type IndexedAt;
type RelatedRecords;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Handle = Unset;
type Moderation = Unset;
type Did = Unset;
type IndexedAt = Unset;
type RelatedRecords = Unset;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Handle = Set<members::handle>;
type Moderation = St::Moderation;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type RelatedRecords = St::RelatedRecords;
}
pub struct SetModeration<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetModeration<St> {}
impl<St: State> State for SetModeration<St> {
type Handle = St::Handle;
type Moderation = Set<members::moderation>;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type RelatedRecords = St::RelatedRecords;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Handle = St::Handle;
type Moderation = St::Moderation;
type Did = Set<members::did>;
type IndexedAt = St::IndexedAt;
type RelatedRecords = St::RelatedRecords;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Handle = St::Handle;
type Moderation = St::Moderation;
type Did = St::Did;
type IndexedAt = Set<members::indexed_at>;
type RelatedRecords = St::RelatedRecords;
}
pub struct SetRelatedRecords<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRelatedRecords<St> {}
impl<St: State> State for SetRelatedRecords<St> {
type Handle = St::Handle;
type Moderation = St::Moderation;
type Did = St::Did;
type IndexedAt = St::IndexedAt;
type RelatedRecords = Set<members::related_records>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct moderation(());
pub struct did(());
pub struct indexed_at(());
pub struct related_records(());
}
}
pub struct RepoViewDetailBuilder<S: BosStr, St: repo_view_detail_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<Did<S>>,
Option<S>,
Option<Datetime>,
Option<Handle<S>>,
Option<Datetime>,
Option<S>,
Option<InviteCode<S>>,
Option<Vec<InviteCode<S>>>,
Option<bool>,
Option<Vec<Label<S>>>,
Option<moderation::ModerationDetail<S>>,
Option<Vec<Data<S>>>,
Option<Vec<ThreatSignature<S>>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RepoViewDetail<S> {
pub fn new() -> RepoViewDetailBuilder<S, repo_view_detail_state::Empty> {
RepoViewDetailBuilder::new()
}
}
impl<S: BosStr> RepoViewDetailBuilder<S, repo_view_detail_state::Empty> {
pub fn new() -> Self {
RepoViewDetailBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn deactivated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_deactivated_at(mut self, value: Option<Datetime>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::Did: repo_view_detail_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> RepoViewDetailBuilder<S, repo_view_detail_state::SetDid<St>> {
self._fields.1 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn email(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn email_confirmed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_email_confirmed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::Handle: repo_view_detail_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> RepoViewDetailBuilder<S, repo_view_detail_state::SetHandle<St>> {
self._fields.4 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::IndexedAt: repo_view_detail_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RepoViewDetailBuilder<S, repo_view_detail_state::SetIndexedAt<St>> {
self._fields.5 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn invite_note(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_invite_note(mut self, value: Option<S>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn invited_by(mut self, value: impl Into<Option<InviteCode<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_invited_by(mut self, value: Option<InviteCode<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn invites(mut self, value: impl Into<Option<Vec<InviteCode<S>>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_invites(mut self, value: Option<Vec<InviteCode<S>>>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn invites_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_invites_disabled(mut self, value: Option<bool>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::Moderation: repo_view_detail_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::ModerationDetail<S>>,
) -> RepoViewDetailBuilder<S, repo_view_detail_state::SetModeration<St>> {
self._fields.11 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::RelatedRecords: repo_view_detail_state::IsUnset,
{
pub fn related_records(
mut self,
value: impl Into<Vec<Data<S>>>,
) -> RepoViewDetailBuilder<S, repo_view_detail_state::SetRelatedRecords<St>> {
self._fields.12 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: repo_view_detail_state::State> RepoViewDetailBuilder<S, St> {
pub fn threat_signatures(mut self, value: impl Into<Option<Vec<ThreatSignature<S>>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_threat_signatures(mut self, value: Option<Vec<ThreatSignature<S>>>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St> RepoViewDetailBuilder<S, St>
where
St: repo_view_detail_state::State,
St::Handle: repo_view_detail_state::IsSet,
St::Moderation: repo_view_detail_state::IsSet,
St::Did: repo_view_detail_state::IsSet,
St::IndexedAt: repo_view_detail_state::IsSet,
St::RelatedRecords: repo_view_detail_state::IsSet,
{
pub fn build(self) -> RepoViewDetail<S> {
RepoViewDetail {
deactivated_at: self._fields.0,
did: self._fields.1.unwrap(),
email: self._fields.2,
email_confirmed_at: self._fields.3,
handle: self._fields.4.unwrap(),
indexed_at: self._fields.5.unwrap(),
invite_note: self._fields.6,
invited_by: self._fields.7,
invites: self._fields.8,
invites_disabled: self._fields.9,
labels: self._fields.10,
moderation: self._fields.11.unwrap(),
related_records: self._fields.12.unwrap(),
threat_signatures: self._fields.13,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RepoViewDetail<S> {
RepoViewDetail {
deactivated_at: self._fields.0,
did: self._fields.1.unwrap(),
email: self._fields.2,
email_confirmed_at: self._fields.3,
handle: self._fields.4.unwrap(),
indexed_at: self._fields.5.unwrap(),
invite_note: self._fields.6,
invited_by: self._fields.7,
invites: self._fields.8,
invites_disabled: self._fields.9,
labels: self._fields.10,
moderation: self._fields.11.unwrap(),
related_records: self._fields.12.unwrap(),
threat_signatures: self._fields.13,
extra_data: Some(extra_data),
}
}
}
pub mod repo_view_not_found_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct RepoViewNotFoundBuilder<S: BosStr, St: repo_view_not_found_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RepoViewNotFound<S> {
pub fn new() -> RepoViewNotFoundBuilder<S, repo_view_not_found_state::Empty> {
RepoViewNotFoundBuilder::new()
}
}
impl<S: BosStr> RepoViewNotFoundBuilder<S, repo_view_not_found_state::Empty> {
pub fn new() -> Self {
RepoViewNotFoundBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewNotFoundBuilder<S, St>
where
St: repo_view_not_found_state::State,
St::Did: repo_view_not_found_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> RepoViewNotFoundBuilder<S, repo_view_not_found_state::SetDid<St>> {
self._fields.0 = Option::Some(value.into());
RepoViewNotFoundBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RepoViewNotFoundBuilder<S, St>
where
St: repo_view_not_found_state::State,
St::Did: repo_view_not_found_state::IsSet,
{
pub fn build(self) -> RepoViewNotFound<S> {
RepoViewNotFound {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RepoViewNotFound<S> {
RepoViewNotFound {
did: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod reporter_stats_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type LabeledRecordCount;
type ReportedRecordCount;
type TakendownAccountCount;
type TakendownRecordCount;
type ReportedAccountCount;
type LabeledAccountCount;
type AccountReportCount;
type RecordReportCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type LabeledRecordCount = Unset;
type ReportedRecordCount = Unset;
type TakendownAccountCount = Unset;
type TakendownRecordCount = Unset;
type ReportedAccountCount = Unset;
type LabeledAccountCount = Unset;
type AccountReportCount = Unset;
type RecordReportCount = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetLabeledRecordCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLabeledRecordCount<St> {}
impl<St: State> State for SetLabeledRecordCount<St> {
type Did = St::Did;
type LabeledRecordCount = Set<members::labeled_record_count>;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetReportedRecordCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetReportedRecordCount<St> {}
impl<St: State> State for SetReportedRecordCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = Set<members::reported_record_count>;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetTakendownAccountCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTakendownAccountCount<St> {}
impl<St: State> State for SetTakendownAccountCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = Set<members::takendown_account_count>;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetTakendownRecordCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTakendownRecordCount<St> {}
impl<St: State> State for SetTakendownRecordCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = Set<members::takendown_record_count>;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetReportedAccountCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetReportedAccountCount<St> {}
impl<St: State> State for SetReportedAccountCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = Set<members::reported_account_count>;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetLabeledAccountCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLabeledAccountCount<St> {}
impl<St: State> State for SetLabeledAccountCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = Set<members::labeled_account_count>;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetAccountReportCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAccountReportCount<St> {}
impl<St: State> State for SetAccountReportCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = Set<members::account_report_count>;
type RecordReportCount = St::RecordReportCount;
}
pub struct SetRecordReportCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRecordReportCount<St> {}
impl<St: State> State for SetRecordReportCount<St> {
type Did = St::Did;
type LabeledRecordCount = St::LabeledRecordCount;
type ReportedRecordCount = St::ReportedRecordCount;
type TakendownAccountCount = St::TakendownAccountCount;
type TakendownRecordCount = St::TakendownRecordCount;
type ReportedAccountCount = St::ReportedAccountCount;
type LabeledAccountCount = St::LabeledAccountCount;
type AccountReportCount = St::AccountReportCount;
type RecordReportCount = Set<members::record_report_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct labeled_record_count(());
pub struct reported_record_count(());
pub struct takendown_account_count(());
pub struct takendown_record_count(());
pub struct reported_account_count(());
pub struct labeled_account_count(());
pub struct account_report_count(());
pub struct record_report_count(());
}
}
pub struct ReporterStatsBuilder<S: BosStr, St: reporter_stats_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<i64>,
Option<Did<S>>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ReporterStats<S> {
pub fn new() -> ReporterStatsBuilder<S, reporter_stats_state::Empty> {
ReporterStatsBuilder::new()
}
}
impl<S: BosStr> ReporterStatsBuilder<S, reporter_stats_state::Empty> {
pub fn new() -> Self {
ReporterStatsBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::AccountReportCount: reporter_stats_state::IsUnset,
{
pub fn account_report_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetAccountReportCount<St>> {
self._fields.0 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::Did: reporter_stats_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetDid<St>> {
self._fields.1 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::LabeledAccountCount: reporter_stats_state::IsUnset,
{
pub fn labeled_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetLabeledAccountCount<St>> {
self._fields.2 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::LabeledRecordCount: reporter_stats_state::IsUnset,
{
pub fn labeled_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetLabeledRecordCount<St>> {
self._fields.3 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::RecordReportCount: reporter_stats_state::IsUnset,
{
pub fn record_report_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetRecordReportCount<St>> {
self._fields.4 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::ReportedAccountCount: reporter_stats_state::IsUnset,
{
pub fn reported_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetReportedAccountCount<St>> {
self._fields.5 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::ReportedRecordCount: reporter_stats_state::IsUnset,
{
pub fn reported_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetReportedRecordCount<St>> {
self._fields.6 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::TakendownAccountCount: reporter_stats_state::IsUnset,
{
pub fn takendown_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetTakendownAccountCount<St>> {
self._fields.7 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::TakendownRecordCount: reporter_stats_state::IsUnset,
{
pub fn takendown_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<S, reporter_stats_state::SetTakendownRecordCount<St>> {
self._fields.8 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReporterStatsBuilder<S, St>
where
St: reporter_stats_state::State,
St::Did: reporter_stats_state::IsSet,
St::LabeledRecordCount: reporter_stats_state::IsSet,
St::ReportedRecordCount: reporter_stats_state::IsSet,
St::TakendownAccountCount: reporter_stats_state::IsSet,
St::TakendownRecordCount: reporter_stats_state::IsSet,
St::ReportedAccountCount: reporter_stats_state::IsSet,
St::LabeledAccountCount: reporter_stats_state::IsSet,
St::AccountReportCount: reporter_stats_state::IsSet,
St::RecordReportCount: reporter_stats_state::IsSet,
{
pub fn build(self) -> ReporterStats<S> {
ReporterStats {
account_report_count: self._fields.0.unwrap(),
did: self._fields.1.unwrap(),
labeled_account_count: self._fields.2.unwrap(),
labeled_record_count: self._fields.3.unwrap(),
record_report_count: self._fields.4.unwrap(),
reported_account_count: self._fields.5.unwrap(),
reported_record_count: self._fields.6.unwrap(),
takendown_account_count: self._fields.7.unwrap(),
takendown_record_count: self._fields.8.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ReporterStats<S> {
ReporterStats {
account_report_count: self._fields.0.unwrap(),
did: self._fields.1.unwrap(),
labeled_account_count: self._fields.2.unwrap(),
labeled_record_count: self._fields.3.unwrap(),
record_report_count: self._fields.4.unwrap(),
reported_account_count: self._fields.5.unwrap(),
reported_record_count: self._fields.6.unwrap(),
takendown_account_count: self._fields.7.unwrap(),
takendown_record_count: self._fields.8.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod scheduled_action_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type Status;
type CreatedBy;
type Id;
type CreatedAt;
type Action;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Status = Unset;
type CreatedBy = Unset;
type Id = Unset;
type CreatedAt = Unset;
type Action = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
type Status = St::Status;
type CreatedBy = St::CreatedBy;
type Id = St::Id;
type CreatedAt = St::CreatedAt;
type Action = St::Action;
}
pub struct SetStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStatus<St> {}
impl<St: State> State for SetStatus<St> {
type Did = St::Did;
type Status = Set<members::status>;
type CreatedBy = St::CreatedBy;
type Id = St::Id;
type CreatedAt = St::CreatedAt;
type Action = St::Action;
}
pub struct SetCreatedBy<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedBy<St> {}
impl<St: State> State for SetCreatedBy<St> {
type Did = St::Did;
type Status = St::Status;
type CreatedBy = Set<members::created_by>;
type Id = St::Id;
type CreatedAt = St::CreatedAt;
type Action = St::Action;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Did = St::Did;
type Status = St::Status;
type CreatedBy = St::CreatedBy;
type Id = Set<members::id>;
type CreatedAt = St::CreatedAt;
type Action = St::Action;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Did = St::Did;
type Status = St::Status;
type CreatedBy = St::CreatedBy;
type Id = St::Id;
type CreatedAt = Set<members::created_at>;
type Action = St::Action;
}
pub struct SetAction<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAction<St> {}
impl<St: State> State for SetAction<St> {
type Did = St::Did;
type Status = St::Status;
type CreatedBy = St::CreatedBy;
type Id = St::Id;
type CreatedAt = St::CreatedAt;
type Action = Set<members::action>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct status(());
pub struct created_by(());
pub struct id(());
pub struct created_at(());
pub struct action(());
}
}
pub struct ScheduledActionViewBuilder<S: BosStr, St: scheduled_action_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ScheduledActionViewAction<S>>,
Option<Datetime>,
Option<Did<S>>,
Option<Did<S>>,
Option<Data<S>>,
Option<Datetime>,
Option<Datetime>,
Option<Datetime>,
Option<i64>,
Option<i64>,
Option<Datetime>,
Option<S>,
Option<bool>,
Option<ScheduledActionViewStatus<S>>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ScheduledActionView<S> {
pub fn new() -> ScheduledActionViewBuilder<S, scheduled_action_view_state::Empty> {
ScheduledActionViewBuilder::new()
}
}
impl<S: BosStr> ScheduledActionViewBuilder<S, scheduled_action_view_state::Empty> {
pub fn new() -> Self {
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::Action: scheduled_action_view_state::IsUnset,
{
pub fn action(
mut self,
value: impl Into<ScheduledActionViewAction<S>>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetAction<St>> {
self._fields.0 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::CreatedAt: scheduled_action_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetCreatedAt<St>> {
self._fields.1 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::CreatedBy: scheduled_action_view_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<S>>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetCreatedBy<St>> {
self._fields.2 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::Did: scheduled_action_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetDid<St>> {
self._fields.3 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn event_data(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_event_data(mut self, value: Option<Data<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn execute_after(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_execute_after(mut self, value: Option<Datetime>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn execute_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_execute_at(mut self, value: Option<Datetime>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn execute_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_execute_until(mut self, value: Option<Datetime>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn execution_event_id(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_execution_event_id(mut self, value: Option<i64>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::Id: scheduled_action_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetId<St>> {
self._fields.9 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn last_executed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_last_executed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn last_failure_reason(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_last_failure_reason(mut self, value: Option<S>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn randomize_execution(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_randomize_execution(mut self, value: Option<bool>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::Status: scheduled_action_view_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<ScheduledActionViewStatus<S>>,
) -> ScheduledActionViewBuilder<S, scheduled_action_view_state::SetStatus<St>> {
self._fields.13 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_action_view_state::State> ScheduledActionViewBuilder<S, St> {
pub fn updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_updated_at(mut self, value: Option<Datetime>) -> Self {
self._fields.14 = value;
self
}
}
impl<S: BosStr, St> ScheduledActionViewBuilder<S, St>
where
St: scheduled_action_view_state::State,
St::Did: scheduled_action_view_state::IsSet,
St::Status: scheduled_action_view_state::IsSet,
St::CreatedBy: scheduled_action_view_state::IsSet,
St::Id: scheduled_action_view_state::IsSet,
St::CreatedAt: scheduled_action_view_state::IsSet,
St::Action: scheduled_action_view_state::IsSet,
{
pub fn build(self) -> ScheduledActionView<S> {
ScheduledActionView {
action: self._fields.0.unwrap(),
created_at: self._fields.1.unwrap(),
created_by: self._fields.2.unwrap(),
did: self._fields.3.unwrap(),
event_data: self._fields.4,
execute_after: self._fields.5,
execute_at: self._fields.6,
execute_until: self._fields.7,
execution_event_id: self._fields.8,
id: self._fields.9.unwrap(),
last_executed_at: self._fields.10,
last_failure_reason: self._fields.11,
randomize_execution: self._fields.12,
status: self._fields.13.unwrap(),
updated_at: self._fields.14,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ScheduledActionView<S> {
ScheduledActionView {
action: self._fields.0.unwrap(),
created_at: self._fields.1.unwrap(),
created_by: self._fields.2.unwrap(),
did: self._fields.3.unwrap(),
event_data: self._fields.4,
execute_after: self._fields.5,
execute_at: self._fields.6,
execute_until: self._fields.7,
execution_event_id: self._fields.8,
id: self._fields.9.unwrap(),
last_executed_at: self._fields.10,
last_failure_reason: self._fields.11,
randomize_execution: self._fields.12,
status: self._fields.13.unwrap(),
updated_at: self._fields.14,
extra_data: Some(extra_data),
}
}
}
pub mod subject_status_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type UpdatedAt;
type ReviewState;
type CreatedAt;
type Subject;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type UpdatedAt = Unset;
type ReviewState = Unset;
type CreatedAt = Unset;
type Subject = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type UpdatedAt = St::UpdatedAt;
type ReviewState = St::ReviewState;
type CreatedAt = St::CreatedAt;
type Subject = St::Subject;
}
pub struct SetUpdatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUpdatedAt<St> {}
impl<St: State> State for SetUpdatedAt<St> {
type Id = St::Id;
type UpdatedAt = Set<members::updated_at>;
type ReviewState = St::ReviewState;
type CreatedAt = St::CreatedAt;
type Subject = St::Subject;
}
pub struct SetReviewState<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetReviewState<St> {}
impl<St: State> State for SetReviewState<St> {
type Id = St::Id;
type UpdatedAt = St::UpdatedAt;
type ReviewState = Set<members::review_state>;
type CreatedAt = St::CreatedAt;
type Subject = St::Subject;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Id = St::Id;
type UpdatedAt = St::UpdatedAt;
type ReviewState = St::ReviewState;
type CreatedAt = Set<members::created_at>;
type Subject = St::Subject;
}
pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubject<St> {}
impl<St: State> State for SetSubject<St> {
type Id = St::Id;
type UpdatedAt = St::UpdatedAt;
type ReviewState = St::ReviewState;
type CreatedAt = St::CreatedAt;
type Subject = Set<members::subject>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct updated_at(());
pub struct review_state(());
pub struct created_at(());
pub struct subject(());
}
}
pub struct SubjectStatusViewBuilder<S: BosStr, St: subject_status_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<moderation::AccountStats<S>>,
Option<moderation::AccountStrike<S>>,
Option<SubjectStatusViewAgeAssuranceState<S>>,
Option<SubjectStatusViewAgeAssuranceUpdatedBy<S>>,
Option<bool>,
Option<S>,
Option<Datetime>,
Option<SubjectStatusViewHosting<S>>,
Option<i64>,
Option<Datetime>,
Option<Datetime>,
Option<Datetime>,
Option<Did<S>>,
Option<Datetime>,
Option<Datetime>,
Option<i64>,
Option<moderation::RecordsStats<S>>,
Option<moderation::SubjectReviewState<S>>,
Option<SubjectStatusViewSubject<S>>,
Option<Vec<Cid<S>>>,
Option<S>,
Option<Datetime>,
Option<Vec<S>>,
Option<bool>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SubjectStatusView<S> {
pub fn new() -> SubjectStatusViewBuilder<S, subject_status_view_state::Empty> {
SubjectStatusViewBuilder::new()
}
}
impl<S: BosStr> SubjectStatusViewBuilder<S, subject_status_view_state::Empty> {
pub fn new() -> Self {
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn account_stats(mut self, value: impl Into<Option<moderation::AccountStats<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_account_stats(mut self, value: Option<moderation::AccountStats<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn account_strike(
mut self,
value: impl Into<Option<moderation::AccountStrike<S>>>,
) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_account_strike(mut self, value: Option<moderation::AccountStrike<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn age_assurance_state(
mut self,
value: impl Into<Option<SubjectStatusViewAgeAssuranceState<S>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_age_assurance_state(
mut self,
value: Option<SubjectStatusViewAgeAssuranceState<S>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn age_assurance_updated_by(
mut self,
value: impl Into<Option<SubjectStatusViewAgeAssuranceUpdatedBy<S>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_age_assurance_updated_by(
mut self,
value: Option<SubjectStatusViewAgeAssuranceUpdatedBy<S>>,
) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn appealed(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_appealed(mut self, value: Option<bool>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn comment(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::CreatedAt: subject_status_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> SubjectStatusViewBuilder<S, subject_status_view_state::SetCreatedAt<St>> {
self._fields.6 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn hosting(mut self, value: impl Into<Option<SubjectStatusViewHosting<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_hosting(mut self, value: Option<SubjectStatusViewHosting<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::Id: subject_status_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> SubjectStatusViewBuilder<S, subject_status_view_state::SetId<St>> {
self._fields.8 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn last_appealed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_last_appealed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn last_reported_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_last_reported_at(mut self, value: Option<Datetime>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn last_reviewed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_last_reviewed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn last_reviewed_by(mut self, value: impl Into<Option<Did<S>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_last_reviewed_by(mut self, value: Option<Did<S>>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn mute_reporting_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_mute_reporting_until(mut self, value: Option<Datetime>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn mute_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_mute_until(mut self, value: Option<Datetime>) -> Self {
self._fields.14 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn priority_score(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.15 = value.into();
self
}
pub fn maybe_priority_score(mut self, value: Option<i64>) -> Self {
self._fields.15 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn records_stats(mut self, value: impl Into<Option<moderation::RecordsStats<S>>>) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_records_stats(mut self, value: Option<moderation::RecordsStats<S>>) -> Self {
self._fields.16 = value;
self
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::ReviewState: subject_status_view_state::IsUnset,
{
pub fn review_state(
mut self,
value: impl Into<moderation::SubjectReviewState<S>>,
) -> SubjectStatusViewBuilder<S, subject_status_view_state::SetReviewState<St>> {
self._fields.17 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::Subject: subject_status_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<SubjectStatusViewSubject<S>>,
) -> SubjectStatusViewBuilder<S, subject_status_view_state::SetSubject<St>> {
self._fields.18 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn subject_blob_cids(mut self, value: impl Into<Option<Vec<Cid<S>>>>) -> Self {
self._fields.19 = value.into();
self
}
pub fn maybe_subject_blob_cids(mut self, value: Option<Vec<Cid<S>>>) -> Self {
self._fields.19 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn subject_repo_handle(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.20 = value.into();
self
}
pub fn maybe_subject_repo_handle(mut self, value: Option<S>) -> Self {
self._fields.20 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn suspend_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.21 = value.into();
self
}
pub fn maybe_suspend_until(mut self, value: Option<Datetime>) -> Self {
self._fields.21 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn tags(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
self._fields.22 = value.into();
self
}
pub fn maybe_tags(mut self, value: Option<Vec<S>>) -> Self {
self._fields.22 = value;
self
}
}
impl<S: BosStr, St: subject_status_view_state::State> SubjectStatusViewBuilder<S, St> {
pub fn takendown(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.23 = value.into();
self
}
pub fn maybe_takendown(mut self, value: Option<bool>) -> Self {
self._fields.23 = value;
self
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::UpdatedAt: subject_status_view_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> SubjectStatusViewBuilder<S, subject_status_view_state::SetUpdatedAt<St>> {
self._fields.24 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SubjectStatusViewBuilder<S, St>
where
St: subject_status_view_state::State,
St::Id: subject_status_view_state::IsSet,
St::UpdatedAt: subject_status_view_state::IsSet,
St::ReviewState: subject_status_view_state::IsSet,
St::CreatedAt: subject_status_view_state::IsSet,
St::Subject: subject_status_view_state::IsSet,
{
pub fn build(self) -> SubjectStatusView<S> {
SubjectStatusView {
account_stats: self._fields.0,
account_strike: self._fields.1,
age_assurance_state: self._fields.2,
age_assurance_updated_by: self._fields.3,
appealed: self._fields.4,
comment: self._fields.5,
created_at: self._fields.6.unwrap(),
hosting: self._fields.7,
id: self._fields.8.unwrap(),
last_appealed_at: self._fields.9,
last_reported_at: self._fields.10,
last_reviewed_at: self._fields.11,
last_reviewed_by: self._fields.12,
mute_reporting_until: self._fields.13,
mute_until: self._fields.14,
priority_score: self._fields.15,
records_stats: self._fields.16,
review_state: self._fields.17.unwrap(),
subject: self._fields.18.unwrap(),
subject_blob_cids: self._fields.19,
subject_repo_handle: self._fields.20,
suspend_until: self._fields.21,
tags: self._fields.22,
takendown: self._fields.23,
updated_at: self._fields.24.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> SubjectStatusView<S> {
SubjectStatusView {
account_stats: self._fields.0,
account_strike: self._fields.1,
age_assurance_state: self._fields.2,
age_assurance_updated_by: self._fields.3,
appealed: self._fields.4,
comment: self._fields.5,
created_at: self._fields.6.unwrap(),
hosting: self._fields.7,
id: self._fields.8.unwrap(),
last_appealed_at: self._fields.9,
last_reported_at: self._fields.10,
last_reviewed_at: self._fields.11,
last_reviewed_by: self._fields.12,
mute_reporting_until: self._fields.13,
mute_until: self._fields.14,
priority_score: self._fields.15,
records_stats: self._fields.16,
review_state: self._fields.17.unwrap(),
subject: self._fields.18.unwrap(),
subject_blob_cids: self._fields.19,
subject_repo_handle: self._fields.20,
suspend_until: self._fields.21,
tags: self._fields.22,
takendown: self._fields.23,
updated_at: self._fields.24.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod subject_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Subject;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Subject = Unset;
type Type = Unset;
}
pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubject<St> {}
impl<St: State> State for SetSubject<St> {
type Subject = Set<members::subject>;
type Type = St::Type;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Subject = St::Subject;
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct subject(());
pub struct r#type(());
}
}
pub struct SubjectViewBuilder<S: BosStr, St: subject_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Data<S>>,
Option<moderation::RecordViewDetail<S>>,
Option<moderation::RepoViewDetail<S>>,
Option<moderation::SubjectStatusView<S>>,
Option<S>,
Option<SubjectType<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SubjectView<S> {
pub fn new() -> SubjectViewBuilder<S, subject_view_state::Empty> {
SubjectViewBuilder::new()
}
}
impl<S: BosStr> SubjectViewBuilder<S, subject_view_state::Empty> {
pub fn new() -> Self {
SubjectViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subject_view_state::State> SubjectViewBuilder<S, St> {
pub fn profile(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_profile(mut self, value: Option<Data<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: subject_view_state::State> SubjectViewBuilder<S, St> {
pub fn record(mut self, value: impl Into<Option<moderation::RecordViewDetail<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_record(mut self, value: Option<moderation::RecordViewDetail<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: subject_view_state::State> SubjectViewBuilder<S, St> {
pub fn repo(mut self, value: impl Into<Option<moderation::RepoViewDetail<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_repo(mut self, value: Option<moderation::RepoViewDetail<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: subject_view_state::State> SubjectViewBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<moderation::SubjectStatusView<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<moderation::SubjectStatusView<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> SubjectViewBuilder<S, St>
where
St: subject_view_state::State,
St::Subject: subject_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<S>,
) -> SubjectViewBuilder<S, subject_view_state::SetSubject<St>> {
self._fields.4 = Option::Some(value.into());
SubjectViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SubjectViewBuilder<S, St>
where
St: subject_view_state::State,
St::Type: subject_view_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<SubjectType<S>>,
) -> SubjectViewBuilder<S, subject_view_state::SetType<St>> {
self._fields.5 = Option::Some(value.into());
SubjectViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SubjectViewBuilder<S, St>
where
St: subject_view_state::State,
St::Subject: subject_view_state::IsSet,
St::Type: subject_view_state::IsSet,
{
pub fn build(self) -> SubjectView<S> {
SubjectView {
profile: self._fields.0,
record: self._fields.1,
repo: self._fields.2,
status: self._fields.3,
subject: self._fields.4.unwrap(),
r#type: self._fields.5.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> SubjectView<S> {
SubjectView {
profile: self._fields.0,
record: self._fields.1,
repo: self._fields.2,
status: self._fields.3,
subject: self._fields.4.unwrap(),
r#type: self._fields.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod video_details_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Length;
type Width;
type Height;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Length = Unset;
type Width = Unset;
type Height = Unset;
}
pub struct SetLength<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLength<St> {}
impl<St: State> State for SetLength<St> {
type Length = Set<members::length>;
type Width = St::Width;
type Height = St::Height;
}
pub struct SetWidth<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWidth<St> {}
impl<St: State> State for SetWidth<St> {
type Length = St::Length;
type Width = Set<members::width>;
type Height = St::Height;
}
pub struct SetHeight<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHeight<St> {}
impl<St: State> State for SetHeight<St> {
type Length = St::Length;
type Width = St::Width;
type Height = Set<members::height>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct length(());
pub struct width(());
pub struct height(());
}
}
pub struct VideoDetailsBuilder<S: BosStr, St: video_details_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> VideoDetails<S> {
pub fn new() -> VideoDetailsBuilder<S, video_details_state::Empty> {
VideoDetailsBuilder::new()
}
}
impl<S: BosStr> VideoDetailsBuilder<S, video_details_state::Empty> {
pub fn new() -> Self {
VideoDetailsBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VideoDetailsBuilder<S, St>
where
St: video_details_state::State,
St::Height: video_details_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<S, video_details_state::SetHeight<St>> {
self._fields.0 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VideoDetailsBuilder<S, St>
where
St: video_details_state::State,
St::Length: video_details_state::IsUnset,
{
pub fn length(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<S, video_details_state::SetLength<St>> {
self._fields.1 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VideoDetailsBuilder<S, St>
where
St: video_details_state::State,
St::Width: video_details_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<S, video_details_state::SetWidth<St>> {
self._fields.2 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VideoDetailsBuilder<S, St>
where
St: video_details_state::State,
St::Length: video_details_state::IsSet,
St::Width: video_details_state::IsSet,
St::Height: video_details_state::IsSet,
{
pub fn build(self) -> VideoDetails<S> {
VideoDetails {
height: self._fields.0.unwrap(),
length: self._fields.1.unwrap(),
width: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> VideoDetails<S> {
VideoDetails {
height: self._fields.0.unwrap(),
length: self._fields.1.unwrap(),
width: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}