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::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
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;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AccountEvent<'a> {
pub active: bool,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<AccountEventStatus<'a>>,
pub timestamp: Datetime,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccountEventStatus<'a> {
Unknown,
Deactivated,
Deleted,
Takendown,
Suspended,
Tombstoned,
Other(CowStr<'a>),
}
impl<'a> AccountEventStatus<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for AccountEventStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"unknown" => Self::Unknown,
"deactivated" => Self::Deactivated,
"deleted" => Self::Deleted,
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"tombstoned" => Self::Tombstoned,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AccountEventStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"unknown" => Self::Unknown,
"deactivated" => Self::Deactivated,
"deleted" => Self::Deleted,
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"tombstoned" => Self::Tombstoned,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AccountEventStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AccountEventStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AccountEventStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for AccountEventStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for AccountEventStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AccountEventStatus<'_> {
type Output = AccountEventStatus<'static>;
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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AccountHosting<'a> {
#[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>,
#[serde(borrow)]
pub status: AccountHostingStatus<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccountHostingStatus<'a> {
Takendown,
Suspended,
Deleted,
Deactivated,
Unknown,
Other(CowStr<'a>),
}
impl<'a> AccountHostingStatus<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for AccountHostingStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"deleted" => Self::Deleted,
"deactivated" => Self::Deactivated,
"unknown" => Self::Unknown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AccountHostingStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"takendown" => Self::Takendown,
"suspended" => Self::Suspended,
"deleted" => Self::Deleted,
"deactivated" => Self::Deactivated,
"unknown" => Self::Unknown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AccountHostingStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AccountHostingStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AccountHostingStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for AccountHostingStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for AccountHostingStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AccountHostingStatus<'_> {
type Output = AccountHostingStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AccountStats<'a> {
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AccountStrike<'a> {
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub access: Option<Access<'a>>,
#[serde(borrow)]
pub attempt_id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub complete_ip: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub complete_ua: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub country_code: Option<CowStr<'a>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub init_ip: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub init_ua: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub region_code: Option<CowStr<'a>>,
#[serde(borrow)]
pub status: AgeAssuranceEventStatus<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceEventStatus<'a> {
Unknown,
Pending,
Assured,
Other(CowStr<'a>),
}
impl<'a> AgeAssuranceEventStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Pending => "pending",
Self::Assured => "assured",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for AgeAssuranceEventStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AgeAssuranceEventStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AgeAssuranceEventStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AgeAssuranceEventStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AgeAssuranceEventStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for AgeAssuranceEventStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for AgeAssuranceEventStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AgeAssuranceEventStatus<'_> {
type Output = AgeAssuranceEventStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceOverrideEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub access: Option<Access<'a>>,
#[serde(borrow)]
pub comment: CowStr<'a>,
#[serde(borrow)]
pub status: AgeAssuranceOverrideEventStatus<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceOverrideEventStatus<'a> {
Assured,
Reset,
Blocked,
Other(CowStr<'a>),
}
impl<'a> AgeAssuranceOverrideEventStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Assured => "assured",
Self::Reset => "reset",
Self::Blocked => "blocked",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for AgeAssuranceOverrideEventStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"assured" => Self::Assured,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AgeAssuranceOverrideEventStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"assured" => Self::Assured,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AgeAssuranceOverrideEventStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AgeAssuranceOverrideEventStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AgeAssuranceOverrideEventStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for AgeAssuranceOverrideEventStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for AgeAssuranceOverrideEventStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AgeAssuranceOverrideEventStatus<'_> {
type Output = AgeAssuranceOverrideEventStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssurancePurgeEvent<'a> {
#[serde(borrow)]
pub comment: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct BlobView<'a> {
#[serde(borrow)]
pub cid: Cid<'a>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub details: Option<BlobViewDetails<'a>>,
#[serde(borrow)]
pub mime_type: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub moderation: Option<moderation::Moderation<'a>>,
pub size: i64,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum BlobViewDetails<'a> {
#[serde(rename = "tools.ozone.moderation.defs#imageDetails")]
ImageDetails(Box<moderation::ImageDetails<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#videoDetails")]
VideoDetails(Box<moderation::VideoDetails<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct CancelScheduledTakedownEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct IdentityEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub handle: Option<Handle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pds_host: Option<UriValue<'a>>,
pub timestamp: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub tombstone: Option<bool>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ImageDetails<'a> {
pub height: i64,
pub width: i64,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventAcknowledge<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub acknowledge_account_subjects: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventComment<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sticky: Option<bool>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventDivert<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventEmail<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub content: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_delivered: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub policies: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub severity_level: Option<CowStr<'a>>,
#[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(borrow)]
pub subject_line: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventEscalate<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventLabel<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(borrow)]
pub create_label_vals: Vec<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
#[serde(borrow)]
pub negate_label_vals: Vec<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventMute<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
pub duration_in_hours: i64,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventMuteReporter<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventPriorityScore<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
pub score: i64,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventReport<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_reporter_muted: Option<bool>,
#[serde(borrow)]
pub report_type: ReasonType<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventResolveAppeal<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventReverseTakedown<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub policies: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub severity_level: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strike_count: Option<i64>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventTag<'a> {
#[serde(borrow)]
pub add: Vec<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(borrow)]
pub remove: Vec<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventTakedown<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub acknowledge_account_subjects: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_hours: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub policies: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub severity_level: Option<CowStr<'a>>,
#[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")]
#[serde(borrow)]
pub target_services: Option<Vec<CowStr<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventUnmute<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModEventUnmuteReporter<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventView<'a> {
pub created_at: Datetime,
#[serde(borrow)]
pub created_by: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub creator_handle: Option<CowStr<'a>>,
#[serde(borrow)]
pub event: ModEventViewEvent<'a>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub mod_tool: Option<moderation::ModTool<'a>>,
#[serde(borrow)]
pub subject: ModEventViewSubject<'a>,
#[serde(borrow)]
pub subject_blob_cids: Vec<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subject_handle: Option<CowStr<'a>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ModEventViewEvent<'a> {
#[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
ModEventTakedown(Box<moderation::ModEventTakedown<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
ModEventComment(Box<moderation::ModEventComment<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
ModEventReport(Box<moderation::ModEventReport<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
ModEventLabel(Box<moderation::ModEventLabel<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
ModEventAcknowledge(Box<moderation::ModEventAcknowledge<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
ModEventEscalate(Box<moderation::ModEventEscalate<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
ModEventMute(Box<moderation::ModEventMute<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
ModEventUnmute(Box<moderation::ModEventUnmute<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
ModEventMuteReporter(Box<moderation::ModEventMuteReporter<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
ModEventEmail(Box<moderation::ModEventEmail<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
ModEventDivert(Box<moderation::ModEventDivert<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
ModEventTag(Box<moderation::ModEventTag<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
AccountEvent(Box<moderation::AccountEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
IdentityEvent(Box<moderation::IdentityEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
RecordEvent(Box<moderation::RecordEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
ModEventPriorityScore(Box<moderation::ModEventPriorityScore<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<'a>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ModEventViewSubject<'a> {
#[serde(rename = "com.atproto.admin.defs#repoRef")]
RepoRef(Box<RepoRef<'a>>),
#[serde(rename = "com.atproto.repo.strongRef")]
StrongRef(Box<StrongRef<'a>>),
#[serde(rename = "chat.bsky.convo.defs#messageRef")]
MessageRef(Box<MessageRef<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ModEventViewDetail<'a> {
pub created_at: Datetime,
#[serde(borrow)]
pub created_by: Did<'a>,
#[serde(borrow)]
pub event: ModEventViewDetailEvent<'a>,
pub id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub mod_tool: Option<moderation::ModTool<'a>>,
#[serde(borrow)]
pub subject: ModEventViewDetailSubject<'a>,
#[serde(borrow)]
pub subject_blobs: Vec<moderation::BlobView<'a>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ModEventViewDetailEvent<'a> {
#[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
ModEventTakedown(Box<moderation::ModEventTakedown<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
ModEventComment(Box<moderation::ModEventComment<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
ModEventReport(Box<moderation::ModEventReport<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
ModEventLabel(Box<moderation::ModEventLabel<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
ModEventAcknowledge(Box<moderation::ModEventAcknowledge<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
ModEventEscalate(Box<moderation::ModEventEscalate<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
ModEventMute(Box<moderation::ModEventMute<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
ModEventUnmute(Box<moderation::ModEventUnmute<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
ModEventMuteReporter(Box<moderation::ModEventMuteReporter<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
ModEventEmail(Box<moderation::ModEventEmail<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
ModEventDivert(Box<moderation::ModEventDivert<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
ModEventTag(Box<moderation::ModEventTag<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
AccountEvent(Box<moderation::AccountEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
IdentityEvent(Box<moderation::IdentityEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
RecordEvent(Box<moderation::RecordEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
ModEventPriorityScore(Box<moderation::ModEventPriorityScore<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<'a>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ModEventViewDetailSubject<'a> {
#[serde(rename = "tools.ozone.moderation.defs#repoView")]
RepoView(Box<moderation::RepoView<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")]
RepoViewNotFound(Box<moderation::RepoViewNotFound<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#recordView")]
RecordView(Box<moderation::RecordView<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")]
RecordViewNotFound(Box<moderation::RecordViewNotFound<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModTool<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub meta: Option<Data<'a>>,
#[serde(borrow)]
pub name: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Moderation<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subject_status: Option<moderation::SubjectStatusView<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ModerationDetail<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subject_status: Option<moderation::SubjectStatusView<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RecordEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cid: Option<Cid<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[serde(borrow)]
pub op: RecordEventOp<'a>,
pub timestamp: Datetime,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RecordEventOp<'a> {
Create,
Update,
Delete,
Other(CowStr<'a>),
}
impl<'a> RecordEventOp<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Create => "create",
Self::Update => "update",
Self::Delete => "delete",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for RecordEventOp<'a> {
fn from(s: &'a str) -> Self {
match s {
"create" => Self::Create,
"update" => Self::Update,
"delete" => Self::Delete,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for RecordEventOp<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"create" => Self::Create,
"update" => Self::Update,
"delete" => Self::Delete,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for RecordEventOp<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for RecordEventOp<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for RecordEventOp<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for RecordEventOp<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for RecordEventOp<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for RecordEventOp<'_> {
type Output = RecordEventOp<'static>;
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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct RecordHosting<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<Datetime>,
#[serde(borrow)]
pub status: RecordHostingStatus<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RecordHostingStatus<'a> {
Deleted,
Unknown,
Other(CowStr<'a>),
}
impl<'a> RecordHostingStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Deleted => "deleted",
Self::Unknown => "unknown",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for RecordHostingStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"deleted" => Self::Deleted,
"unknown" => Self::Unknown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for RecordHostingStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"deleted" => Self::Deleted,
"unknown" => Self::Unknown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for RecordHostingStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for RecordHostingStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for RecordHostingStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for RecordHostingStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for RecordHostingStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for RecordHostingStatus<'_> {
type Output = RecordHostingStatus<'static>;
fn into_static(self) -> Self::Output {
match self {
RecordHostingStatus::Deleted => RecordHostingStatus::Deleted,
RecordHostingStatus::Unknown => RecordHostingStatus::Unknown,
RecordHostingStatus::Other(v) => RecordHostingStatus::Other(v.into_static()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RecordView<'a> {
#[serde(borrow)]
pub blob_cids: Vec<Cid<'a>>,
#[serde(borrow)]
pub cid: Cid<'a>,
pub indexed_at: Datetime,
#[serde(borrow)]
pub moderation: moderation::Moderation<'a>,
#[serde(borrow)]
pub repo: moderation::RepoView<'a>,
#[serde(borrow)]
pub uri: AtUri<'a>,
#[serde(borrow)]
pub value: Data<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RecordViewDetail<'a> {
#[serde(borrow)]
pub blobs: Vec<moderation::BlobView<'a>>,
#[serde(borrow)]
pub cid: Cid<'a>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(borrow)]
pub moderation: moderation::ModerationDetail<'a>,
#[serde(borrow)]
pub repo: moderation::RepoView<'a>,
#[serde(borrow)]
pub uri: AtUri<'a>,
#[serde(borrow)]
pub value: Data<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RecordViewNotFound<'a> {
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct RecordsStats<'a> {
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RepoView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deactivated_at: Option<Datetime>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub email: Option<CowStr<'a>>,
#[serde(borrow)]
pub handle: Handle<'a>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub invite_note: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub invited_by: Option<InviteCode<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invites_disabled: Option<bool>,
#[serde(borrow)]
pub moderation: moderation::Moderation<'a>,
#[serde(borrow)]
pub related_records: Vec<Data<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub threat_signatures: Option<Vec<ThreatSignature<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RepoViewDetail<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deactivated_at: Option<Datetime>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub email: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email_confirmed_at: Option<Datetime>,
#[serde(borrow)]
pub handle: Handle<'a>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub invite_note: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub invited_by: Option<InviteCode<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub invites: Option<Vec<InviteCode<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invites_disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(borrow)]
pub moderation: moderation::ModerationDetail<'a>,
#[serde(borrow)]
pub related_records: Vec<Data<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub threat_signatures: Option<Vec<ThreatSignature<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct RepoViewNotFound<'a> {
#[serde(borrow)]
pub did: Did<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ReporterStats<'a> {
pub account_report_count: i64,
#[serde(borrow)]
pub did: Did<'a>,
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,
}
#[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")
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct RevokeAccountCredentialsEvent<'a> {
#[serde(borrow)]
pub comment: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ScheduleTakedownEvent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ScheduledActionView<'a> {
#[serde(borrow)]
pub action: ScheduledActionViewAction<'a>,
pub created_at: Datetime,
#[serde(borrow)]
pub created_by: Did<'a>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub event_data: Option<Data<'a>>,
#[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")]
#[serde(borrow)]
pub last_failure_reason: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub randomize_execution: Option<bool>,
#[serde(borrow)]
pub status: ScheduledActionViewStatus<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ScheduledActionViewAction<'a> {
Takedown,
Other(CowStr<'a>),
}
impl<'a> ScheduledActionViewAction<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Takedown => "takedown",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ScheduledActionViewAction<'a> {
fn from(s: &'a str) -> Self {
match s {
"takedown" => Self::Takedown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ScheduledActionViewAction<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"takedown" => Self::Takedown,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ScheduledActionViewAction<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ScheduledActionViewAction<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ScheduledActionViewAction<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ScheduledActionViewAction<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ScheduledActionViewAction<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ScheduledActionViewAction<'_> {
type Output = ScheduledActionViewAction<'static>;
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<'a> {
Pending,
Executed,
Cancelled,
Failed,
Other(CowStr<'a>),
}
impl<'a> ScheduledActionViewStatus<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for ScheduledActionViewStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"pending" => Self::Pending,
"executed" => Self::Executed,
"cancelled" => Self::Cancelled,
"failed" => Self::Failed,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ScheduledActionViewStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"pending" => Self::Pending,
"executed" => Self::Executed,
"cancelled" => Self::Cancelled,
"failed" => Self::Failed,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ScheduledActionViewStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ScheduledActionViewStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ScheduledActionViewStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ScheduledActionViewStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ScheduledActionViewStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ScheduledActionViewStatus<'_> {
type Output = ScheduledActionViewStatus<'static>;
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<'a> {
ToolsOzoneModerationDefsReviewOpen,
ToolsOzoneModerationDefsReviewEscalated,
ToolsOzoneModerationDefsReviewClosed,
ToolsOzoneModerationDefsReviewNone,
Other(CowStr<'a>),
}
impl<'a> SubjectReviewState<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for SubjectReviewState<'a> {
fn from(s: &'a str) -> Self {
match s {
"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(CowStr::from(s)),
}
}
}
impl<'a> From<String> for SubjectReviewState<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"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(CowStr::from(s)),
}
}
}
impl<'a> AsRef<str> for SubjectReviewState<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> core::fmt::Display for SubjectReviewState<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> serde::Serialize for SubjectReviewState<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for SubjectReviewState<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl jacquard_common::IntoStatic for SubjectReviewState<'_> {
type Output = SubjectReviewState<'static>;
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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SubjectStatusView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub account_stats: Option<moderation::AccountStats<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub account_strike: Option<moderation::AccountStrike<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub age_assurance_state: Option<SubjectStatusViewAgeAssuranceState<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub age_assurance_updated_by: Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub appealed: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub comment: Option<CowStr<'a>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub hosting: Option<SubjectStatusViewHosting<'a>>,
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")]
#[serde(borrow)]
pub last_reviewed_by: Option<Did<'a>>,
#[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")]
#[serde(borrow)]
pub records_stats: Option<moderation::RecordsStats<'a>>,
#[serde(borrow)]
pub review_state: moderation::SubjectReviewState<'a>,
#[serde(borrow)]
pub subject: SubjectStatusViewSubject<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subject_blob_cids: Option<Vec<Cid<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subject_repo_handle: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub suspend_until: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tags: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub takendown: Option<bool>,
pub updated_at: Datetime,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubjectStatusViewAgeAssuranceState<'a> {
Pending,
Assured,
Unknown,
Reset,
Blocked,
Other(CowStr<'a>),
}
impl<'a> SubjectStatusViewAgeAssuranceState<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for SubjectStatusViewAgeAssuranceState<'a> {
fn from(s: &'a str) -> Self {
match s {
"pending" => Self::Pending,
"assured" => Self::Assured,
"unknown" => Self::Unknown,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for SubjectStatusViewAgeAssuranceState<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"pending" => Self::Pending,
"assured" => Self::Assured,
"unknown" => Self::Unknown,
"reset" => Self::Reset,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for SubjectStatusViewAgeAssuranceState<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for SubjectStatusViewAgeAssuranceState<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for SubjectStatusViewAgeAssuranceState<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for SubjectStatusViewAgeAssuranceState<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for SubjectStatusViewAgeAssuranceState<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceState<'_> {
type Output = SubjectStatusViewAgeAssuranceState<'static>;
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<'a> {
Admin,
User,
Other(CowStr<'a>),
}
impl<'a> SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Admin => "admin",
Self::User => "user",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn from(s: &'a str) -> Self {
match s {
"admin" => Self::Admin,
"user" => Self::User,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"admin" => Self::Admin,
"user" => Self::User,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for SubjectStatusViewAgeAssuranceUpdatedBy<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceUpdatedBy<'_> {
type Output = SubjectStatusViewAgeAssuranceUpdatedBy<'static>;
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")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum SubjectStatusViewHosting<'a> {
#[serde(rename = "tools.ozone.moderation.defs#accountHosting")]
AccountHosting(Box<moderation::AccountHosting<'a>>),
#[serde(rename = "tools.ozone.moderation.defs#recordHosting")]
RecordHosting(Box<moderation::RecordHosting<'a>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum SubjectStatusViewSubject<'a> {
#[serde(rename = "com.atproto.admin.defs#repoRef")]
RepoRef(Box<RepoRef<'a>>),
#[serde(rename = "com.atproto.repo.strongRef")]
StrongRef(Box<StrongRef<'a>>),
#[serde(rename = "chat.bsky.convo.defs#messageRef")]
MessageRef(Box<MessageRef<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SubjectView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub profile: Option<Data<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub record: Option<moderation::RecordViewDetail<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub repo: Option<moderation::RepoViewDetail<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<moderation::SubjectStatusView<'a>>,
#[serde(borrow)]
pub subject: CowStr<'a>,
#[serde(borrow)]
pub r#type: SubjectType<'a>,
}
#[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")
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct VideoDetails<'a> {
pub height: i64,
pub length: i64,
pub width: i64,
}
impl<'a> LexiconSchema for AccountEvent<'a> {
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<'a> LexiconSchema for AccountHosting<'a> {
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<'a> LexiconSchema for AccountStats<'a> {
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<'a> LexiconSchema for AccountStrike<'a> {
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<'a> LexiconSchema for AgeAssuranceEvent<'a> {
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<'a> LexiconSchema for AgeAssuranceOverrideEvent<'a> {
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<'a> LexiconSchema for AgeAssurancePurgeEvent<'a> {
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<'a> LexiconSchema for BlobView<'a> {
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<'a> LexiconSchema for CancelScheduledTakedownEvent<'a> {
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<'a> LexiconSchema for IdentityEvent<'a> {
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<'a> LexiconSchema for ImageDetails<'a> {
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<'a> LexiconSchema for ModEventAcknowledge<'a> {
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<'a> LexiconSchema for ModEventComment<'a> {
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<'a> LexiconSchema for ModEventDivert<'a> {
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<'a> LexiconSchema for ModEventEmail<'a> {
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<'a> LexiconSchema for ModEventEscalate<'a> {
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<'a> LexiconSchema for ModEventLabel<'a> {
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<'a> LexiconSchema for ModEventMute<'a> {
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<'a> LexiconSchema for ModEventMuteReporter<'a> {
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<'a> LexiconSchema for ModEventPriorityScore<'a> {
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<'a> LexiconSchema for ModEventReport<'a> {
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<'a> LexiconSchema for ModEventResolveAppeal<'a> {
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<'a> LexiconSchema for ModEventReverseTakedown<'a> {
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<'a> LexiconSchema for ModEventTag<'a> {
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<'a> LexiconSchema for ModEventTakedown<'a> {
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<'a> LexiconSchema for ModEventUnmute<'a> {
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<'a> LexiconSchema for ModEventUnmuteReporter<'a> {
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<'a> LexiconSchema for ModEventView<'a> {
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<'a> LexiconSchema for ModEventViewDetail<'a> {
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<'a> LexiconSchema for ModTool<'a> {
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<'a> LexiconSchema for Moderation<'a> {
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<'a> LexiconSchema for ModerationDetail<'a> {
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<'a> LexiconSchema for RecordEvent<'a> {
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<'a> LexiconSchema for RecordHosting<'a> {
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<'a> LexiconSchema for RecordView<'a> {
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<'a> LexiconSchema for RecordViewDetail<'a> {
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<'a> LexiconSchema for RecordViewNotFound<'a> {
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<'a> LexiconSchema for RecordsStats<'a> {
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<'a> LexiconSchema for RepoView<'a> {
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<'a> LexiconSchema for RepoViewDetail<'a> {
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<'a> LexiconSchema for RepoViewNotFound<'a> {
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<'a> LexiconSchema for ReporterStats<'a> {
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<'a> LexiconSchema for RevokeAccountCredentialsEvent<'a> {
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<'a> LexiconSchema for ScheduleTakedownEvent<'a> {
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<'a> LexiconSchema for ScheduledActionView<'a> {
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<'a> LexiconSchema for SubjectStatusView<'a> {
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<'a> LexiconSchema for SubjectView<'a> {
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<'a> LexiconSchema for VideoDetails<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTimestamp<S> {}
impl<S: State> State for SetTimestamp<S> {
type Timestamp = Set<members::timestamp>;
type Active = S::Active;
}
pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetActive<S> {}
impl<S: State> State for SetActive<S> {
type Timestamp = S::Timestamp;
type Active = Set<members::active>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct timestamp(());
pub struct active(());
}
}
pub struct AccountEventBuilder<'a, S: account_event_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<bool>,
Option<CowStr<'a>>,
Option<AccountEventStatus<'a>>,
Option<Datetime>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> AccountEvent<'a> {
pub fn new() -> AccountEventBuilder<'a, account_event_state::Empty> {
AccountEventBuilder::new()
}
}
impl<'a> AccountEventBuilder<'a, account_event_state::Empty> {
pub fn new() -> Self {
AccountEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> AccountEventBuilder<'a, S>
where
S: account_event_state::State,
S::Active: account_event_state::IsUnset,
{
pub fn active(
mut self,
value: impl Into<bool>,
) -> AccountEventBuilder<'a, account_event_state::SetActive<S>> {
self._fields.0 = Option::Some(value.into());
AccountEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: account_event_state::State> AccountEventBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: account_event_state::State> AccountEventBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<AccountEventStatus<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<AccountEventStatus<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> AccountEventBuilder<'a, S>
where
S: account_event_state::State,
S::Timestamp: account_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> AccountEventBuilder<'a, account_event_state::SetTimestamp<S>> {
self._fields.3 = Option::Some(value.into());
AccountEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> AccountEventBuilder<'a, S>
where
S: account_event_state::State,
S::Timestamp: account_event_state::IsSet,
S::Active: account_event_state::IsSet,
{
pub fn build(self) -> AccountEvent<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> AccountEvent<'a> {
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> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type CreatedAt;
type AttemptId;
type Status;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type AttemptId = Unset;
type Status = Unset;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type CreatedAt = Set<members::created_at>;
type AttemptId = S::AttemptId;
type Status = S::Status;
}
pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAttemptId<S> {}
impl<S: State> State for SetAttemptId<S> {
type CreatedAt = S::CreatedAt;
type AttemptId = Set<members::attempt_id>;
type Status = S::Status;
}
pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStatus<S> {}
impl<S: State> State for SetStatus<S> {
type CreatedAt = S::CreatedAt;
type AttemptId = S::AttemptId;
type Status = Set<members::status>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct attempt_id(());
pub struct status(());
}
}
pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Access<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<AgeAssuranceEventStatus<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> AgeAssuranceEvent<'a> {
pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
AgeAssuranceEventBuilder::new()
}
}
impl<'a> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
pub fn new() -> Self {
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn access(mut self, value: impl Into<Option<Access<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_access(mut self, value: Option<Access<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::AttemptId: age_assurance_event_state::IsUnset,
{
pub fn attempt_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId<S>> {
self._fields.1 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn complete_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_complete_ip(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn complete_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_complete_ua(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn country_code(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_country_code(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::CreatedAt: age_assurance_event_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt<S>> {
self._fields.5 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn init_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_init_ip(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn init_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_init_ua(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn region_code(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_region_code(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::Status: age_assurance_event_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<AgeAssuranceEventStatus<'a>>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus<S>> {
self._fields.9 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::CreatedAt: age_assurance_event_state::IsSet,
S::AttemptId: age_assurance_event_state::IsSet,
S::Status: age_assurance_event_state::IsSet,
{
pub fn build(self) -> AgeAssuranceEvent<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> AgeAssuranceEvent<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type MimeType;
type Cid;
type Size;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type MimeType = Unset;
type Cid = Unset;
type Size = Unset;
type CreatedAt = Unset;
}
pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMimeType<S> {}
impl<S: State> State for SetMimeType<S> {
type MimeType = Set<members::mime_type>;
type Cid = S::Cid;
type Size = S::Size;
type CreatedAt = S::CreatedAt;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type MimeType = S::MimeType;
type Cid = Set<members::cid>;
type Size = S::Size;
type CreatedAt = S::CreatedAt;
}
pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSize<S> {}
impl<S: State> State for SetSize<S> {
type MimeType = S::MimeType;
type Cid = S::Cid;
type Size = Set<members::size>;
type CreatedAt = S::CreatedAt;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type MimeType = S::MimeType;
type Cid = S::Cid;
type Size = S::Size;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct mime_type(());
pub struct cid(());
pub struct size(());
pub struct created_at(());
}
}
pub struct BlobViewBuilder<'a, S: blob_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Cid<'a>>,
Option<Datetime>,
Option<BlobViewDetails<'a>>,
Option<CowStr<'a>>,
Option<moderation::Moderation<'a>>,
Option<i64>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> BlobView<'a> {
pub fn new() -> BlobViewBuilder<'a, blob_view_state::Empty> {
BlobViewBuilder::new()
}
}
impl<'a> BlobViewBuilder<'a, blob_view_state::Empty> {
pub fn new() -> Self {
BlobViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> BlobViewBuilder<'a, S>
where
S: blob_view_state::State,
S::Cid: blob_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<'a>>,
) -> BlobViewBuilder<'a, blob_view_state::SetCid<S>> {
self._fields.0 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> BlobViewBuilder<'a, S>
where
S: blob_view_state::State,
S::CreatedAt: blob_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> BlobViewBuilder<'a, blob_view_state::SetCreatedAt<S>> {
self._fields.1 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> {
pub fn details(mut self, value: impl Into<Option<BlobViewDetails<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_details(mut self, value: Option<BlobViewDetails<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> BlobViewBuilder<'a, S>
where
S: blob_view_state::State,
S::MimeType: blob_view_state::IsUnset,
{
pub fn mime_type(
mut self,
value: impl Into<CowStr<'a>>,
) -> BlobViewBuilder<'a, blob_view_state::SetMimeType<S>> {
self._fields.3 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> {
pub fn moderation(
mut self,
value: impl Into<Option<moderation::Moderation<'a>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_moderation(
mut self,
value: Option<moderation::Moderation<'a>>,
) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> BlobViewBuilder<'a, S>
where
S: blob_view_state::State,
S::Size: blob_view_state::IsUnset,
{
pub fn size(
mut self,
value: impl Into<i64>,
) -> BlobViewBuilder<'a, blob_view_state::SetSize<S>> {
self._fields.5 = Option::Some(value.into());
BlobViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> BlobViewBuilder<'a, S>
where
S: blob_view_state::State,
S::MimeType: blob_view_state::IsSet,
S::Cid: blob_view_state::IsSet,
S::Size: blob_view_state::IsSet,
S::CreatedAt: blob_view_state::IsSet,
{
pub fn build(self) -> BlobView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> BlobView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTimestamp<S> {}
impl<S: State> State for SetTimestamp<S> {
type Timestamp = Set<members::timestamp>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct timestamp(());
}
}
pub struct IdentityEventBuilder<'a, S: identity_event_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<UriValue<'a>>,
Option<Datetime>,
Option<bool>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> IdentityEvent<'a> {
pub fn new() -> IdentityEventBuilder<'a, identity_event_state::Empty> {
IdentityEventBuilder::new()
}
}
impl<'a> IdentityEventBuilder<'a, identity_event_state::Empty> {
pub fn new() -> Self {
IdentityEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
pub fn handle(mut self, value: impl Into<Option<Handle<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_handle(mut self, value: Option<Handle<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
pub fn pds_host(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_pds_host(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> IdentityEventBuilder<'a, S>
where
S: identity_event_state::State,
S::Timestamp: identity_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> IdentityEventBuilder<'a, identity_event_state::SetTimestamp<S>> {
self._fields.3 = Option::Some(value.into());
IdentityEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
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<'a, S> IdentityEventBuilder<'a, S>
where
S: identity_event_state::State,
S::Timestamp: identity_event_state::IsSet,
{
pub fn build(self) -> IdentityEvent<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> IdentityEvent<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Height;
type Width;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Height = Unset;
type Width = Unset;
}
pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHeight<S> {}
impl<S: State> State for SetHeight<S> {
type Height = Set<members::height>;
type Width = S::Width;
}
pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetWidth<S> {}
impl<S: State> State for SetWidth<S> {
type Height = S::Height;
type Width = Set<members::width>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct height(());
pub struct width(());
}
}
pub struct ImageDetailsBuilder<'a, S: image_details_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<i64>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ImageDetails<'a> {
pub fn new() -> ImageDetailsBuilder<'a, image_details_state::Empty> {
ImageDetailsBuilder::new()
}
}
impl<'a> ImageDetailsBuilder<'a, image_details_state::Empty> {
pub fn new() -> Self {
ImageDetailsBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageDetailsBuilder<'a, S>
where
S: image_details_state::State,
S::Height: image_details_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> ImageDetailsBuilder<'a, image_details_state::SetHeight<S>> {
self._fields.0 = Option::Some(value.into());
ImageDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageDetailsBuilder<'a, S>
where
S: image_details_state::State,
S::Width: image_details_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> ImageDetailsBuilder<'a, image_details_state::SetWidth<S>> {
self._fields.1 = Option::Some(value.into());
ImageDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageDetailsBuilder<'a, S>
where
S: image_details_state::State,
S::Height: image_details_state::IsSet,
S::Width: image_details_state::IsSet,
{
pub fn build(self) -> ImageDetails<'a> {
ImageDetails {
height: self._fields.0.unwrap(),
width: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ImageDetails<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type CreateLabelVals;
type NegateLabelVals;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreateLabelVals = Unset;
type NegateLabelVals = Unset;
}
pub struct SetCreateLabelVals<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreateLabelVals<S> {}
impl<S: State> State for SetCreateLabelVals<S> {
type CreateLabelVals = Set<members::create_label_vals>;
type NegateLabelVals = S::NegateLabelVals;
}
pub struct SetNegateLabelVals<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNegateLabelVals<S> {}
impl<S: State> State for SetNegateLabelVals<S> {
type CreateLabelVals = S::CreateLabelVals;
type NegateLabelVals = Set<members::negate_label_vals>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct create_label_vals(());
pub struct negate_label_vals(());
}
}
pub struct ModEventLabelBuilder<'a, S: mod_event_label_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<Vec<CowStr<'a>>>,
Option<i64>,
Option<Vec<CowStr<'a>>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventLabel<'a> {
pub fn new() -> ModEventLabelBuilder<'a, mod_event_label_state::Empty> {
ModEventLabelBuilder::new()
}
}
impl<'a> ModEventLabelBuilder<'a, mod_event_label_state::Empty> {
pub fn new() -> Self {
ModEventLabelBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> ModEventLabelBuilder<'a, S>
where
S: mod_event_label_state::State,
S::CreateLabelVals: mod_event_label_state::IsUnset,
{
pub fn create_label_vals(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> ModEventLabelBuilder<'a, mod_event_label_state::SetCreateLabelVals<S>> {
self._fields.1 = Option::Some(value.into());
ModEventLabelBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> {
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<'a, S> ModEventLabelBuilder<'a, S>
where
S: mod_event_label_state::State,
S::NegateLabelVals: mod_event_label_state::IsUnset,
{
pub fn negate_label_vals(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> ModEventLabelBuilder<'a, mod_event_label_state::SetNegateLabelVals<S>> {
self._fields.3 = Option::Some(value.into());
ModEventLabelBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventLabelBuilder<'a, S>
where
S: mod_event_label_state::State,
S::CreateLabelVals: mod_event_label_state::IsSet,
S::NegateLabelVals: mod_event_label_state::IsSet,
{
pub fn build(self) -> ModEventLabel<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventLabel<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDurationInHours<S> {}
impl<S: State> State for SetDurationInHours<S> {
type DurationInHours = Set<members::duration_in_hours>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct duration_in_hours(());
}
}
pub struct ModEventMuteBuilder<'a, S: mod_event_mute_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventMute<'a> {
pub fn new() -> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> {
ModEventMuteBuilder::new()
}
}
impl<'a> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> {
pub fn new() -> Self {
ModEventMuteBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_mute_state::State> ModEventMuteBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> ModEventMuteBuilder<'a, S>
where
S: mod_event_mute_state::State,
S::DurationInHours: mod_event_mute_state::IsUnset,
{
pub fn duration_in_hours(
mut self,
value: impl Into<i64>,
) -> ModEventMuteBuilder<'a, mod_event_mute_state::SetDurationInHours<S>> {
self._fields.1 = Option::Some(value.into());
ModEventMuteBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventMuteBuilder<'a, S>
where
S: mod_event_mute_state::State,
S::DurationInHours: mod_event_mute_state::IsSet,
{
pub fn build(self) -> ModEventMute<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventMute<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetScore<S> {}
impl<S: State> State for SetScore<S> {
type Score = Set<members::score>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct score(());
}
}
pub struct ModEventPriorityScoreBuilder<'a, S: mod_event_priority_score_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventPriorityScore<'a> {
pub fn new() -> ModEventPriorityScoreBuilder<
'a,
mod_event_priority_score_state::Empty,
> {
ModEventPriorityScoreBuilder::new()
}
}
impl<'a> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::Empty> {
pub fn new() -> Self {
ModEventPriorityScoreBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_priority_score_state::State> ModEventPriorityScoreBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> ModEventPriorityScoreBuilder<'a, S>
where
S: mod_event_priority_score_state::State,
S::Score: mod_event_priority_score_state::IsUnset,
{
pub fn score(
mut self,
value: impl Into<i64>,
) -> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::SetScore<S>> {
self._fields.1 = Option::Some(value.into());
ModEventPriorityScoreBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventPriorityScoreBuilder<'a, S>
where
S: mod_event_priority_score_state::State,
S::Score: mod_event_priority_score_state::IsSet,
{
pub fn build(self) -> ModEventPriorityScore<'a> {
ModEventPriorityScore {
comment: self._fields.0,
score: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventPriorityScore<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReportType<S> {}
impl<S: State> State for SetReportType<S> {
type ReportType = Set<members::report_type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct report_type(());
}
}
pub struct ModEventReportBuilder<'a, S: mod_event_report_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>, Option<bool>, Option<ReasonType<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventReport<'a> {
pub fn new() -> ModEventReportBuilder<'a, mod_event_report_state::Empty> {
ModEventReportBuilder::new()
}
}
impl<'a> ModEventReportBuilder<'a, mod_event_report_state::Empty> {
pub fn new() -> Self {
ModEventReportBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> {
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<'a, S> ModEventReportBuilder<'a, S>
where
S: mod_event_report_state::State,
S::ReportType: mod_event_report_state::IsUnset,
{
pub fn report_type(
mut self,
value: impl Into<ReasonType<'a>>,
) -> ModEventReportBuilder<'a, mod_event_report_state::SetReportType<S>> {
self._fields.2 = Option::Some(value.into());
ModEventReportBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventReportBuilder<'a, S>
where
S: mod_event_report_state::State,
S::ReportType: mod_event_report_state::IsSet,
{
pub fn build(self) -> ModEventReport<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventReport<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAdd<S> {}
impl<S: State> State for SetAdd<S> {
type Add = Set<members::add>;
type Remove = S::Remove;
}
pub struct SetRemove<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRemove<S> {}
impl<S: State> State for SetRemove<S> {
type Add = S::Add;
type Remove = Set<members::remove>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct add(());
pub struct remove(());
}
}
pub struct ModEventTagBuilder<'a, S: mod_event_tag_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<CowStr<'a>>>, Option<CowStr<'a>>, Option<Vec<CowStr<'a>>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventTag<'a> {
pub fn new() -> ModEventTagBuilder<'a, mod_event_tag_state::Empty> {
ModEventTagBuilder::new()
}
}
impl<'a> ModEventTagBuilder<'a, mod_event_tag_state::Empty> {
pub fn new() -> Self {
ModEventTagBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventTagBuilder<'a, S>
where
S: mod_event_tag_state::State,
S::Add: mod_event_tag_state::IsUnset,
{
pub fn add(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> ModEventTagBuilder<'a, mod_event_tag_state::SetAdd<S>> {
self._fields.0 = Option::Some(value.into());
ModEventTagBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_tag_state::State> ModEventTagBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> ModEventTagBuilder<'a, S>
where
S: mod_event_tag_state::State,
S::Remove: mod_event_tag_state::IsUnset,
{
pub fn remove(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> ModEventTagBuilder<'a, mod_event_tag_state::SetRemove<S>> {
self._fields.2 = Option::Some(value.into());
ModEventTagBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventTagBuilder<'a, S>
where
S: mod_event_tag_state::State,
S::Add: mod_event_tag_state::IsSet,
S::Remove: mod_event_tag_state::IsSet,
{
pub fn build(self) -> ModEventTag<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventTag<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type Subject;
type Event;
type CreatedBy;
type SubjectBlobCids;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Subject = Unset;
type Event = Unset;
type CreatedBy = Unset;
type SubjectBlobCids = Unset;
type CreatedAt = Unset;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Id = Set<members::id>;
type Subject = S::Subject;
type Event = S::Event;
type CreatedBy = S::CreatedBy;
type SubjectBlobCids = S::SubjectBlobCids;
type CreatedAt = S::CreatedAt;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type Id = S::Id;
type Subject = Set<members::subject>;
type Event = S::Event;
type CreatedBy = S::CreatedBy;
type SubjectBlobCids = S::SubjectBlobCids;
type CreatedAt = S::CreatedAt;
}
pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEvent<S> {}
impl<S: State> State for SetEvent<S> {
type Id = S::Id;
type Subject = S::Subject;
type Event = Set<members::event>;
type CreatedBy = S::CreatedBy;
type SubjectBlobCids = S::SubjectBlobCids;
type CreatedAt = S::CreatedAt;
}
pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
impl<S: State> State for SetCreatedBy<S> {
type Id = S::Id;
type Subject = S::Subject;
type Event = S::Event;
type CreatedBy = Set<members::created_by>;
type SubjectBlobCids = S::SubjectBlobCids;
type CreatedAt = S::CreatedAt;
}
pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {}
impl<S: State> State for SetSubjectBlobCids<S> {
type Id = S::Id;
type Subject = S::Subject;
type Event = S::Event;
type CreatedBy = S::CreatedBy;
type SubjectBlobCids = Set<members::subject_blob_cids>;
type CreatedAt = S::CreatedAt;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Id = S::Id;
type Subject = S::Subject;
type Event = S::Event;
type CreatedBy = S::CreatedBy;
type SubjectBlobCids = S::SubjectBlobCids;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct subject(());
pub struct event(());
pub struct created_by(());
pub struct subject_blob_cids(());
pub struct created_at(());
}
}
pub struct ModEventViewBuilder<'a, S: mod_event_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<ModEventViewEvent<'a>>,
Option<i64>,
Option<moderation::ModTool<'a>>,
Option<ModEventViewSubject<'a>>,
Option<Vec<CowStr<'a>>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventView<'a> {
pub fn new() -> ModEventViewBuilder<'a, mod_event_view_state::Empty> {
ModEventViewBuilder::new()
}
}
impl<'a> ModEventViewBuilder<'a, mod_event_view_state::Empty> {
pub fn new() -> Self {
ModEventViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::CreatedAt: mod_event_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedAt<S>> {
self._fields.0 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::CreatedBy: mod_event_view_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<'a>>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedBy<S>> {
self._fields.1 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
pub fn creator_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_creator_handle(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::Event: mod_event_view_state::IsUnset,
{
pub fn event(
mut self,
value: impl Into<ModEventViewEvent<'a>>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetEvent<S>> {
self._fields.3 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::Id: mod_event_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetId<S>> {
self._fields.4 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
pub fn mod_tool(
mut self,
value: impl Into<Option<moderation::ModTool<'a>>>,
) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::Subject: mod_event_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<ModEventViewSubject<'a>>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubject<S>> {
self._fields.6 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::SubjectBlobCids: mod_event_view_state::IsUnset,
{
pub fn subject_blob_cids(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubjectBlobCids<S>> {
self._fields.7 = Option::Some(value.into());
ModEventViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
pub fn subject_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_subject_handle(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S> ModEventViewBuilder<'a, S>
where
S: mod_event_view_state::State,
S::Id: mod_event_view_state::IsSet,
S::Subject: mod_event_view_state::IsSet,
S::Event: mod_event_view_state::IsSet,
S::CreatedBy: mod_event_view_state::IsSet,
S::SubjectBlobCids: mod_event_view_state::IsSet,
S::CreatedAt: mod_event_view_state::IsSet,
{
pub fn build(self) -> ModEventView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type CreatedBy;
type SubjectBlobs;
type Subject;
type CreatedAt;
type Id;
type Event;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedBy = Unset;
type SubjectBlobs = Unset;
type Subject = Unset;
type CreatedAt = Unset;
type Id = Unset;
type Event = Unset;
}
pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
impl<S: State> State for SetCreatedBy<S> {
type CreatedBy = Set<members::created_by>;
type SubjectBlobs = S::SubjectBlobs;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Id = S::Id;
type Event = S::Event;
}
pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {}
impl<S: State> State for SetSubjectBlobs<S> {
type CreatedBy = S::CreatedBy;
type SubjectBlobs = Set<members::subject_blobs>;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Id = S::Id;
type Event = S::Event;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type CreatedBy = S::CreatedBy;
type SubjectBlobs = S::SubjectBlobs;
type Subject = Set<members::subject>;
type CreatedAt = S::CreatedAt;
type Id = S::Id;
type Event = S::Event;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type CreatedBy = S::CreatedBy;
type SubjectBlobs = S::SubjectBlobs;
type Subject = S::Subject;
type CreatedAt = Set<members::created_at>;
type Id = S::Id;
type Event = S::Event;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type CreatedBy = S::CreatedBy;
type SubjectBlobs = S::SubjectBlobs;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Id = Set<members::id>;
type Event = S::Event;
}
pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEvent<S> {}
impl<S: State> State for SetEvent<S> {
type CreatedBy = S::CreatedBy;
type SubjectBlobs = S::SubjectBlobs;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Id = S::Id;
type Event = Set<members::event>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_by(());
pub struct subject_blobs(());
pub struct subject(());
pub struct created_at(());
pub struct id(());
pub struct event(());
}
}
pub struct ModEventViewDetailBuilder<'a, S: mod_event_view_detail_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<Did<'a>>,
Option<ModEventViewDetailEvent<'a>>,
Option<i64>,
Option<moderation::ModTool<'a>>,
Option<ModEventViewDetailSubject<'a>>,
Option<Vec<moderation::BlobView<'a>>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ModEventViewDetail<'a> {
pub fn new() -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> {
ModEventViewDetailBuilder::new()
}
}
impl<'a> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> {
pub fn new() -> Self {
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::CreatedAt: mod_event_view_detail_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedAt<S>> {
self._fields.0 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::CreatedBy: mod_event_view_detail_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<'a>>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedBy<S>> {
self._fields.1 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::Event: mod_event_view_detail_state::IsUnset,
{
pub fn event(
mut self,
value: impl Into<ModEventViewDetailEvent<'a>>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetEvent<S>> {
self._fields.2 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::Id: mod_event_view_detail_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetId<S>> {
self._fields.3 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: mod_event_view_detail_state::State> ModEventViewDetailBuilder<'a, S> {
pub fn mod_tool(
mut self,
value: impl Into<Option<moderation::ModTool<'a>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::Subject: mod_event_view_detail_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<ModEventViewDetailSubject<'a>>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubject<S>> {
self._fields.5 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::SubjectBlobs: mod_event_view_detail_state::IsUnset,
{
pub fn subject_blobs(
mut self,
value: impl Into<Vec<moderation::BlobView<'a>>>,
) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubjectBlobs<S>> {
self._fields.6 = Option::Some(value.into());
ModEventViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ModEventViewDetailBuilder<'a, S>
where
S: mod_event_view_detail_state::State,
S::CreatedBy: mod_event_view_detail_state::IsSet,
S::SubjectBlobs: mod_event_view_detail_state::IsSet,
S::Subject: mod_event_view_detail_state::IsSet,
S::CreatedAt: mod_event_view_detail_state::IsSet,
S::Id: mod_event_view_detail_state::IsSet,
S::Event: mod_event_view_detail_state::IsSet,
{
pub fn build(self) -> ModEventViewDetail<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ModEventViewDetail<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Timestamp;
type Op;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Timestamp = Unset;
type Op = Unset;
}
pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTimestamp<S> {}
impl<S: State> State for SetTimestamp<S> {
type Timestamp = Set<members::timestamp>;
type Op = S::Op;
}
pub struct SetOp<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetOp<S> {}
impl<S: State> State for SetOp<S> {
type Timestamp = S::Timestamp;
type Op = Set<members::op>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct timestamp(());
pub struct op(());
}
}
pub struct RecordEventBuilder<'a, S: record_event_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Cid<'a>>,
Option<CowStr<'a>>,
Option<RecordEventOp<'a>>,
Option<Datetime>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RecordEvent<'a> {
pub fn new() -> RecordEventBuilder<'a, record_event_state::Empty> {
RecordEventBuilder::new()
}
}
impl<'a> RecordEventBuilder<'a, record_event_state::Empty> {
pub fn new() -> Self {
RecordEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> {
pub fn cid(mut self, value: impl Into<Option<Cid<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cid(mut self, value: Option<Cid<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> RecordEventBuilder<'a, S>
where
S: record_event_state::State,
S::Op: record_event_state::IsUnset,
{
pub fn op(
mut self,
value: impl Into<RecordEventOp<'a>>,
) -> RecordEventBuilder<'a, record_event_state::SetOp<S>> {
self._fields.2 = Option::Some(value.into());
RecordEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordEventBuilder<'a, S>
where
S: record_event_state::State,
S::Timestamp: record_event_state::IsUnset,
{
pub fn timestamp(
mut self,
value: impl Into<Datetime>,
) -> RecordEventBuilder<'a, record_event_state::SetTimestamp<S>> {
self._fields.3 = Option::Some(value.into());
RecordEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordEventBuilder<'a, S>
where
S: record_event_state::State,
S::Timestamp: record_event_state::IsSet,
S::Op: record_event_state::IsSet,
{
pub fn build(self) -> RecordEvent<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RecordEvent<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Cid;
type Value;
type IndexedAt;
type Uri;
type Moderation;
type Repo;
type BlobCids;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cid = Unset;
type Value = Unset;
type IndexedAt = Unset;
type Uri = Unset;
type Moderation = Unset;
type Repo = Unset;
type BlobCids = Unset;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Cid = Set<members::cid>;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Moderation = S::Moderation;
type Repo = S::Repo;
type BlobCids = S::BlobCids;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Cid = S::Cid;
type Value = Set<members::value>;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Moderation = S::Moderation;
type Repo = S::Repo;
type BlobCids = S::BlobCids;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Cid = S::Cid;
type Value = S::Value;
type IndexedAt = Set<members::indexed_at>;
type Uri = S::Uri;
type Moderation = S::Moderation;
type Repo = S::Repo;
type BlobCids = S::BlobCids;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Cid = S::Cid;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Uri = Set<members::uri>;
type Moderation = S::Moderation;
type Repo = S::Repo;
type BlobCids = S::BlobCids;
}
pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetModeration<S> {}
impl<S: State> State for SetModeration<S> {
type Cid = S::Cid;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Moderation = Set<members::moderation>;
type Repo = S::Repo;
type BlobCids = S::BlobCids;
}
pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepo<S> {}
impl<S: State> State for SetRepo<S> {
type Cid = S::Cid;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Moderation = S::Moderation;
type Repo = Set<members::repo>;
type BlobCids = S::BlobCids;
}
pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBlobCids<S> {}
impl<S: State> State for SetBlobCids<S> {
type Cid = S::Cid;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Moderation = S::Moderation;
type Repo = S::Repo;
type BlobCids = Set<members::blob_cids>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cid(());
pub struct value(());
pub struct indexed_at(());
pub struct uri(());
pub struct moderation(());
pub struct repo(());
pub struct blob_cids(());
}
}
pub struct RecordViewBuilder<'a, S: record_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Vec<Cid<'a>>>,
Option<Cid<'a>>,
Option<Datetime>,
Option<moderation::Moderation<'a>>,
Option<moderation::RepoView<'a>>,
Option<AtUri<'a>>,
Option<Data<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RecordView<'a> {
pub fn new() -> RecordViewBuilder<'a, record_view_state::Empty> {
RecordViewBuilder::new()
}
}
impl<'a> RecordViewBuilder<'a, record_view_state::Empty> {
pub fn new() -> Self {
RecordViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::BlobCids: record_view_state::IsUnset,
{
pub fn blob_cids(
mut self,
value: impl Into<Vec<Cid<'a>>>,
) -> RecordViewBuilder<'a, record_view_state::SetBlobCids<S>> {
self._fields.0 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Cid: record_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<'a>>,
) -> RecordViewBuilder<'a, record_view_state::SetCid<S>> {
self._fields.1 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::IndexedAt: record_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RecordViewBuilder<'a, record_view_state::SetIndexedAt<S>> {
self._fields.2 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Moderation: record_view_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::Moderation<'a>>,
) -> RecordViewBuilder<'a, record_view_state::SetModeration<S>> {
self._fields.3 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Repo: record_view_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<moderation::RepoView<'a>>,
) -> RecordViewBuilder<'a, record_view_state::SetRepo<S>> {
self._fields.4 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Uri: record_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> RecordViewBuilder<'a, record_view_state::SetUri<S>> {
self._fields.5 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Value: record_view_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<Data<'a>>,
) -> RecordViewBuilder<'a, record_view_state::SetValue<S>> {
self._fields.6 = Option::Some(value.into());
RecordViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewBuilder<'a, S>
where
S: record_view_state::State,
S::Cid: record_view_state::IsSet,
S::Value: record_view_state::IsSet,
S::IndexedAt: record_view_state::IsSet,
S::Uri: record_view_state::IsSet,
S::Moderation: record_view_state::IsSet,
S::Repo: record_view_state::IsSet,
S::BlobCids: record_view_state::IsSet,
{
pub fn build(self) -> RecordView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RecordView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Blobs;
type IndexedAt;
type Repo;
type Uri;
type Cid;
type Moderation;
type Value;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Blobs = Unset;
type IndexedAt = Unset;
type Repo = Unset;
type Uri = Unset;
type Cid = Unset;
type Moderation = Unset;
type Value = Unset;
}
pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBlobs<S> {}
impl<S: State> State for SetBlobs<S> {
type Blobs = Set<members::blobs>;
type IndexedAt = S::IndexedAt;
type Repo = S::Repo;
type Uri = S::Uri;
type Cid = S::Cid;
type Moderation = S::Moderation;
type Value = S::Value;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Blobs = S::Blobs;
type IndexedAt = Set<members::indexed_at>;
type Repo = S::Repo;
type Uri = S::Uri;
type Cid = S::Cid;
type Moderation = S::Moderation;
type Value = S::Value;
}
pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepo<S> {}
impl<S: State> State for SetRepo<S> {
type Blobs = S::Blobs;
type IndexedAt = S::IndexedAt;
type Repo = Set<members::repo>;
type Uri = S::Uri;
type Cid = S::Cid;
type Moderation = S::Moderation;
type Value = S::Value;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Blobs = S::Blobs;
type IndexedAt = S::IndexedAt;
type Repo = S::Repo;
type Uri = Set<members::uri>;
type Cid = S::Cid;
type Moderation = S::Moderation;
type Value = S::Value;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Blobs = S::Blobs;
type IndexedAt = S::IndexedAt;
type Repo = S::Repo;
type Uri = S::Uri;
type Cid = Set<members::cid>;
type Moderation = S::Moderation;
type Value = S::Value;
}
pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetModeration<S> {}
impl<S: State> State for SetModeration<S> {
type Blobs = S::Blobs;
type IndexedAt = S::IndexedAt;
type Repo = S::Repo;
type Uri = S::Uri;
type Cid = S::Cid;
type Moderation = Set<members::moderation>;
type Value = S::Value;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Blobs = S::Blobs;
type IndexedAt = S::IndexedAt;
type Repo = S::Repo;
type Uri = S::Uri;
type Cid = S::Cid;
type Moderation = S::Moderation;
type Value = Set<members::value>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct blobs(());
pub struct indexed_at(());
pub struct repo(());
pub struct uri(());
pub struct cid(());
pub struct moderation(());
pub struct value(());
}
}
pub struct RecordViewDetailBuilder<'a, S: record_view_detail_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Vec<moderation::BlobView<'a>>>,
Option<Cid<'a>>,
Option<Datetime>,
Option<Vec<Label<'a>>>,
Option<moderation::ModerationDetail<'a>>,
Option<moderation::RepoView<'a>>,
Option<AtUri<'a>>,
Option<Data<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RecordViewDetail<'a> {
pub fn new() -> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> {
RecordViewDetailBuilder::new()
}
}
impl<'a> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> {
pub fn new() -> Self {
RecordViewDetailBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Blobs: record_view_detail_state::IsUnset,
{
pub fn blobs(
mut self,
value: impl Into<Vec<moderation::BlobView<'a>>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetBlobs<S>> {
self._fields.0 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Cid: record_view_detail_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<'a>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetCid<S>> {
self._fields.1 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::IndexedAt: record_view_detail_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetIndexedAt<S>> {
self._fields.2 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: record_view_detail_state::State> RecordViewDetailBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Moderation: record_view_detail_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::ModerationDetail<'a>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetModeration<S>> {
self._fields.4 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Repo: record_view_detail_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<moderation::RepoView<'a>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetRepo<S>> {
self._fields.5 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Uri: record_view_detail_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetUri<S>> {
self._fields.6 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Value: record_view_detail_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<Data<'a>>,
) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetValue<S>> {
self._fields.7 = Option::Some(value.into());
RecordViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewDetailBuilder<'a, S>
where
S: record_view_detail_state::State,
S::Blobs: record_view_detail_state::IsSet,
S::IndexedAt: record_view_detail_state::IsSet,
S::Repo: record_view_detail_state::IsSet,
S::Uri: record_view_detail_state::IsSet,
S::Cid: record_view_detail_state::IsSet,
S::Moderation: record_view_detail_state::IsSet,
S::Value: record_view_detail_state::IsSet,
{
pub fn build(self) -> RecordViewDetail<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RecordViewDetail<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct RecordViewNotFoundBuilder<'a, S: record_view_not_found_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtUri<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RecordViewNotFound<'a> {
pub fn new() -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> {
RecordViewNotFoundBuilder::new()
}
}
impl<'a> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> {
pub fn new() -> Self {
RecordViewNotFoundBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewNotFoundBuilder<'a, S>
where
S: record_view_not_found_state::State,
S::Uri: record_view_not_found_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::SetUri<S>> {
self._fields.0 = Option::Some(value.into());
RecordViewNotFoundBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RecordViewNotFoundBuilder<'a, S>
where
S: record_view_not_found_state::State,
S::Uri: record_view_not_found_state::IsSet,
{
pub fn build(self) -> RecordViewNotFound<'a> {
RecordViewNotFound {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RecordViewNotFound<'a> {
RecordViewNotFound {
uri: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod repo_view_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Handle;
type Moderation;
type Did;
type RelatedRecords;
type IndexedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Handle = Unset;
type Moderation = Unset;
type Did = Unset;
type RelatedRecords = Unset;
type IndexedAt = Unset;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Handle = Set<members::handle>;
type Moderation = S::Moderation;
type Did = S::Did;
type RelatedRecords = S::RelatedRecords;
type IndexedAt = S::IndexedAt;
}
pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetModeration<S> {}
impl<S: State> State for SetModeration<S> {
type Handle = S::Handle;
type Moderation = Set<members::moderation>;
type Did = S::Did;
type RelatedRecords = S::RelatedRecords;
type IndexedAt = S::IndexedAt;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Handle = S::Handle;
type Moderation = S::Moderation;
type Did = Set<members::did>;
type RelatedRecords = S::RelatedRecords;
type IndexedAt = S::IndexedAt;
}
pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRelatedRecords<S> {}
impl<S: State> State for SetRelatedRecords<S> {
type Handle = S::Handle;
type Moderation = S::Moderation;
type Did = S::Did;
type RelatedRecords = Set<members::related_records>;
type IndexedAt = S::IndexedAt;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Handle = S::Handle;
type Moderation = S::Moderation;
type Did = S::Did;
type RelatedRecords = S::RelatedRecords;
type IndexedAt = Set<members::indexed_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct moderation(());
pub struct did(());
pub struct related_records(());
pub struct indexed_at(());
}
}
pub struct RepoViewBuilder<'a, S: repo_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<InviteCode<'a>>,
Option<bool>,
Option<moderation::Moderation<'a>>,
Option<Vec<Data<'a>>>,
Option<Vec<ThreatSignature<'a>>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RepoView<'a> {
pub fn new() -> RepoViewBuilder<'a, repo_view_state::Empty> {
RepoViewBuilder::new()
}
}
impl<'a> RepoViewBuilder<'a, repo_view_state::Empty> {
pub fn new() -> Self {
RepoViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
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<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::Did: repo_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> RepoViewBuilder<'a, repo_view_state::SetDid<S>> {
self._fields.1 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::Handle: repo_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> RepoViewBuilder<'a, repo_view_state::SetHandle<S>> {
self._fields.3 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::IndexedAt: repo_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RepoViewBuilder<'a, repo_view_state::SetIndexedAt<S>> {
self._fields.4 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
pub fn invite_note(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_invite_note(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
pub fn invited_by(mut self, value: impl Into<Option<InviteCode<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_invited_by(mut self, value: Option<InviteCode<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
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<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::Moderation: repo_view_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::Moderation<'a>>,
) -> RepoViewBuilder<'a, repo_view_state::SetModeration<S>> {
self._fields.8 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::RelatedRecords: repo_view_state::IsUnset,
{
pub fn related_records(
mut self,
value: impl Into<Vec<Data<'a>>>,
) -> RepoViewBuilder<'a, repo_view_state::SetRelatedRecords<S>> {
self._fields.9 = Option::Some(value.into());
RepoViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
pub fn threat_signatures(
mut self,
value: impl Into<Option<Vec<ThreatSignature<'a>>>>,
) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_threat_signatures(
mut self,
value: Option<Vec<ThreatSignature<'a>>>,
) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S> RepoViewBuilder<'a, S>
where
S: repo_view_state::State,
S::Handle: repo_view_state::IsSet,
S::Moderation: repo_view_state::IsSet,
S::Did: repo_view_state::IsSet,
S::RelatedRecords: repo_view_state::IsSet,
S::IndexedAt: repo_view_state::IsSet,
{
pub fn build(self) -> RepoView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RepoView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type IndexedAt;
type Handle;
type RelatedRecords;
type Moderation;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type IndexedAt = Unset;
type Handle = Unset;
type RelatedRecords = Unset;
type Moderation = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type IndexedAt = S::IndexedAt;
type Handle = S::Handle;
type RelatedRecords = S::RelatedRecords;
type Moderation = S::Moderation;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Did = S::Did;
type IndexedAt = Set<members::indexed_at>;
type Handle = S::Handle;
type RelatedRecords = S::RelatedRecords;
type Moderation = S::Moderation;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Did = S::Did;
type IndexedAt = S::IndexedAt;
type Handle = Set<members::handle>;
type RelatedRecords = S::RelatedRecords;
type Moderation = S::Moderation;
}
pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRelatedRecords<S> {}
impl<S: State> State for SetRelatedRecords<S> {
type Did = S::Did;
type IndexedAt = S::IndexedAt;
type Handle = S::Handle;
type RelatedRecords = Set<members::related_records>;
type Moderation = S::Moderation;
}
pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetModeration<S> {}
impl<S: State> State for SetModeration<S> {
type Did = S::Did;
type IndexedAt = S::IndexedAt;
type Handle = S::Handle;
type RelatedRecords = S::RelatedRecords;
type Moderation = Set<members::moderation>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct indexed_at(());
pub struct handle(());
pub struct related_records(());
pub struct moderation(());
}
}
pub struct RepoViewDetailBuilder<'a, S: repo_view_detail_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<Handle<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<InviteCode<'a>>,
Option<Vec<InviteCode<'a>>>,
Option<bool>,
Option<Vec<Label<'a>>>,
Option<moderation::ModerationDetail<'a>>,
Option<Vec<Data<'a>>>,
Option<Vec<ThreatSignature<'a>>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RepoViewDetail<'a> {
pub fn new() -> RepoViewDetailBuilder<'a, repo_view_detail_state::Empty> {
RepoViewDetailBuilder::new()
}
}
impl<'a> RepoViewDetailBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
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<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::Did: repo_view_detail_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetDid<S>> {
self._fields.1 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
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<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::Handle: repo_view_detail_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetHandle<S>> {
self._fields.4 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::IndexedAt: repo_view_detail_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetIndexedAt<S>> {
self._fields.5 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn invite_note(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_invite_note(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn invited_by(mut self, value: impl Into<Option<InviteCode<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_invited_by(mut self, value: Option<InviteCode<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn invites(mut self, value: impl Into<Option<Vec<InviteCode<'a>>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_invites(mut self, value: Option<Vec<InviteCode<'a>>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
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<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::Moderation: repo_view_detail_state::IsUnset,
{
pub fn moderation(
mut self,
value: impl Into<moderation::ModerationDetail<'a>>,
) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetModeration<S>> {
self._fields.11 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::RelatedRecords: repo_view_detail_state::IsUnset,
{
pub fn related_records(
mut self,
value: impl Into<Vec<Data<'a>>>,
) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetRelatedRecords<S>> {
self._fields.12 = Option::Some(value.into());
RepoViewDetailBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
pub fn threat_signatures(
mut self,
value: impl Into<Option<Vec<ThreatSignature<'a>>>>,
) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_threat_signatures(
mut self,
value: Option<Vec<ThreatSignature<'a>>>,
) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S> RepoViewDetailBuilder<'a, S>
where
S: repo_view_detail_state::State,
S::Did: repo_view_detail_state::IsSet,
S::IndexedAt: repo_view_detail_state::IsSet,
S::Handle: repo_view_detail_state::IsSet,
S::RelatedRecords: repo_view_detail_state::IsSet,
S::Moderation: repo_view_detail_state::IsSet,
{
pub fn build(self) -> RepoViewDetail<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RepoViewDetail<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct RepoViewNotFoundBuilder<'a, S: repo_view_not_found_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Did<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> RepoViewNotFound<'a> {
pub fn new() -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> {
RepoViewNotFoundBuilder::new()
}
}
impl<'a> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> {
pub fn new() -> Self {
RepoViewNotFoundBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewNotFoundBuilder<'a, S>
where
S: repo_view_not_found_state::State,
S::Did: repo_view_not_found_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::SetDid<S>> {
self._fields.0 = Option::Some(value.into());
RepoViewNotFoundBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> RepoViewNotFoundBuilder<'a, S>
where
S: repo_view_not_found_state::State,
S::Did: repo_view_not_found_state::IsSet,
{
pub fn build(self) -> RepoViewNotFound<'a> {
RepoViewNotFound {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> RepoViewNotFound<'a> {
RepoViewNotFound {
did: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod reporter_stats_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type LabeledRecordCount;
type LabeledAccountCount;
type TakendownAccountCount;
type TakendownRecordCount;
type ReportedAccountCount;
type RecordReportCount;
type AccountReportCount;
type ReportedRecordCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type LabeledRecordCount = Unset;
type LabeledAccountCount = Unset;
type TakendownAccountCount = Unset;
type TakendownRecordCount = Unset;
type ReportedAccountCount = Unset;
type RecordReportCount = Unset;
type AccountReportCount = Unset;
type ReportedRecordCount = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {}
impl<S: State> State for SetLabeledRecordCount<S> {
type Did = S::Did;
type LabeledRecordCount = Set<members::labeled_record_count>;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {}
impl<S: State> State for SetLabeledAccountCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = Set<members::labeled_account_count>;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {}
impl<S: State> State for SetTakendownAccountCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = Set<members::takendown_account_count>;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetTakendownRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTakendownRecordCount<S> {}
impl<S: State> State for SetTakendownRecordCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = Set<members::takendown_record_count>;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {}
impl<S: State> State for SetReportedAccountCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = Set<members::reported_account_count>;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecordReportCount<S> {}
impl<S: State> State for SetRecordReportCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = Set<members::record_report_count>;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAccountReportCount<S> {}
impl<S: State> State for SetAccountReportCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = Set<members::account_report_count>;
type ReportedRecordCount = S::ReportedRecordCount;
}
pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {}
impl<S: State> State for SetReportedRecordCount<S> {
type Did = S::Did;
type LabeledRecordCount = S::LabeledRecordCount;
type LabeledAccountCount = S::LabeledAccountCount;
type TakendownAccountCount = S::TakendownAccountCount;
type TakendownRecordCount = S::TakendownRecordCount;
type ReportedAccountCount = S::ReportedAccountCount;
type RecordReportCount = S::RecordReportCount;
type AccountReportCount = S::AccountReportCount;
type ReportedRecordCount = Set<members::reported_record_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct labeled_record_count(());
pub struct labeled_account_count(());
pub struct takendown_account_count(());
pub struct takendown_record_count(());
pub struct reported_account_count(());
pub struct record_report_count(());
pub struct account_report_count(());
pub struct reported_record_count(());
}
}
pub struct ReporterStatsBuilder<'a, S: reporter_stats_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<i64>,
Option<Did<'a>>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ReporterStats<'a> {
pub fn new() -> ReporterStatsBuilder<'a, reporter_stats_state::Empty> {
ReporterStatsBuilder::new()
}
}
impl<'a> ReporterStatsBuilder<'a, reporter_stats_state::Empty> {
pub fn new() -> Self {
ReporterStatsBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::AccountReportCount: reporter_stats_state::IsUnset,
{
pub fn account_report_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetAccountReportCount<S>> {
self._fields.0 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::Did: reporter_stats_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetDid<S>> {
self._fields.1 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::LabeledAccountCount: reporter_stats_state::IsUnset,
{
pub fn labeled_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledAccountCount<S>> {
self._fields.2 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::LabeledRecordCount: reporter_stats_state::IsUnset,
{
pub fn labeled_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledRecordCount<S>> {
self._fields.3 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::RecordReportCount: reporter_stats_state::IsUnset,
{
pub fn record_report_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetRecordReportCount<S>> {
self._fields.4 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::ReportedAccountCount: reporter_stats_state::IsUnset,
{
pub fn reported_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedAccountCount<S>> {
self._fields.5 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::ReportedRecordCount: reporter_stats_state::IsUnset,
{
pub fn reported_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedRecordCount<S>> {
self._fields.6 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::TakendownAccountCount: reporter_stats_state::IsUnset,
{
pub fn takendown_account_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownAccountCount<S>> {
self._fields.7 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::TakendownRecordCount: reporter_stats_state::IsUnset,
{
pub fn takendown_record_count(
mut self,
value: impl Into<i64>,
) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownRecordCount<S>> {
self._fields.8 = Option::Some(value.into());
ReporterStatsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ReporterStatsBuilder<'a, S>
where
S: reporter_stats_state::State,
S::Did: reporter_stats_state::IsSet,
S::LabeledRecordCount: reporter_stats_state::IsSet,
S::LabeledAccountCount: reporter_stats_state::IsSet,
S::TakendownAccountCount: reporter_stats_state::IsSet,
S::TakendownRecordCount: reporter_stats_state::IsSet,
S::ReportedAccountCount: reporter_stats_state::IsSet,
S::RecordReportCount: reporter_stats_state::IsSet,
S::AccountReportCount: reporter_stats_state::IsSet,
S::ReportedRecordCount: reporter_stats_state::IsSet,
{
pub fn build(self) -> ReporterStats<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ReporterStats<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Action;
type CreatedBy;
type Did;
type Id;
type CreatedAt;
type Status;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Action = Unset;
type CreatedBy = Unset;
type Did = Unset;
type Id = Unset;
type CreatedAt = Unset;
type Status = Unset;
}
pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAction<S> {}
impl<S: State> State for SetAction<S> {
type Action = Set<members::action>;
type CreatedBy = S::CreatedBy;
type Did = S::Did;
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
}
pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
impl<S: State> State for SetCreatedBy<S> {
type Action = S::Action;
type CreatedBy = Set<members::created_by>;
type Did = S::Did;
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Action = S::Action;
type CreatedBy = S::CreatedBy;
type Did = Set<members::did>;
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Action = S::Action;
type CreatedBy = S::CreatedBy;
type Did = S::Did;
type Id = Set<members::id>;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Action = S::Action;
type CreatedBy = S::CreatedBy;
type Did = S::Did;
type Id = S::Id;
type CreatedAt = Set<members::created_at>;
type Status = S::Status;
}
pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStatus<S> {}
impl<S: State> State for SetStatus<S> {
type Action = S::Action;
type CreatedBy = S::CreatedBy;
type Did = S::Did;
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Status = Set<members::status>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct action(());
pub struct created_by(());
pub struct did(());
pub struct id(());
pub struct created_at(());
pub struct status(());
}
}
pub struct ScheduledActionViewBuilder<'a, S: scheduled_action_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<ScheduledActionViewAction<'a>>,
Option<Datetime>,
Option<Did<'a>>,
Option<Did<'a>>,
Option<Data<'a>>,
Option<Datetime>,
Option<Datetime>,
Option<Datetime>,
Option<i64>,
Option<i64>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<bool>,
Option<ScheduledActionViewStatus<'a>>,
Option<Datetime>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ScheduledActionView<'a> {
pub fn new() -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::Empty> {
ScheduledActionViewBuilder::new()
}
}
impl<'a> ScheduledActionViewBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::Action: scheduled_action_view_state::IsUnset,
{
pub fn action(
mut self,
value: impl Into<ScheduledActionViewAction<'a>>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetAction<S>> {
self._fields.0 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::CreatedAt: scheduled_action_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedAt<S>> {
self._fields.1 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::CreatedBy: scheduled_action_view_state::IsUnset,
{
pub fn created_by(
mut self,
value: impl Into<Did<'a>>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedBy<S>> {
self._fields.2 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::Did: scheduled_action_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetDid<S>> {
self._fields.3 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
pub fn event_data(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_event_data(mut self, value: Option<Data<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::Id: scheduled_action_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetId<S>> {
self._fields.9 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
pub fn last_failure_reason(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_last_failure_reason(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::Status: scheduled_action_view_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<ScheduledActionViewStatus<'a>>,
) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetStatus<S>> {
self._fields.13 = Option::Some(value.into());
ScheduledActionViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
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<'a, S> ScheduledActionViewBuilder<'a, S>
where
S: scheduled_action_view_state::State,
S::Action: scheduled_action_view_state::IsSet,
S::CreatedBy: scheduled_action_view_state::IsSet,
S::Did: scheduled_action_view_state::IsSet,
S::Id: scheduled_action_view_state::IsSet,
S::CreatedAt: scheduled_action_view_state::IsSet,
S::Status: scheduled_action_view_state::IsSet,
{
pub fn build(self) -> ScheduledActionView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ScheduledActionView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type UpdatedAt;
type Id;
type ReviewState;
type Subject;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type UpdatedAt = Unset;
type Id = Unset;
type ReviewState = Unset;
type Subject = Unset;
type CreatedAt = Unset;
}
pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUpdatedAt<S> {}
impl<S: State> State for SetUpdatedAt<S> {
type UpdatedAt = Set<members::updated_at>;
type Id = S::Id;
type ReviewState = S::ReviewState;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type UpdatedAt = S::UpdatedAt;
type Id = Set<members::id>;
type ReviewState = S::ReviewState;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
}
pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReviewState<S> {}
impl<S: State> State for SetReviewState<S> {
type UpdatedAt = S::UpdatedAt;
type Id = S::Id;
type ReviewState = Set<members::review_state>;
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type UpdatedAt = S::UpdatedAt;
type Id = S::Id;
type ReviewState = S::ReviewState;
type Subject = Set<members::subject>;
type CreatedAt = S::CreatedAt;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type UpdatedAt = S::UpdatedAt;
type Id = S::Id;
type ReviewState = S::ReviewState;
type Subject = S::Subject;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct updated_at(());
pub struct id(());
pub struct review_state(());
pub struct subject(());
pub struct created_at(());
}
}
pub struct SubjectStatusViewBuilder<'a, S: subject_status_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<moderation::AccountStats<'a>>,
Option<moderation::AccountStrike<'a>>,
Option<SubjectStatusViewAgeAssuranceState<'a>>,
Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
Option<bool>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<SubjectStatusViewHosting<'a>>,
Option<i64>,
Option<Datetime>,
Option<Datetime>,
Option<Datetime>,
Option<Did<'a>>,
Option<Datetime>,
Option<Datetime>,
Option<i64>,
Option<moderation::RecordsStats<'a>>,
Option<moderation::SubjectReviewState<'a>>,
Option<SubjectStatusViewSubject<'a>>,
Option<Vec<Cid<'a>>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<Vec<CowStr<'a>>>,
Option<bool>,
Option<Datetime>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SubjectStatusView<'a> {
pub fn new() -> SubjectStatusViewBuilder<'a, subject_status_view_state::Empty> {
SubjectStatusViewBuilder::new()
}
}
impl<'a> SubjectStatusViewBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn account_stats(
mut self,
value: impl Into<Option<moderation::AccountStats<'a>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_account_stats(
mut self,
value: Option<moderation::AccountStats<'a>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn account_strike(
mut self,
value: impl Into<Option<moderation::AccountStrike<'a>>>,
) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_account_strike(
mut self,
value: Option<moderation::AccountStrike<'a>>,
) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn age_assurance_state(
mut self,
value: impl Into<Option<SubjectStatusViewAgeAssuranceState<'a>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_age_assurance_state(
mut self,
value: Option<SubjectStatusViewAgeAssuranceState<'a>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn age_assurance_updated_by(
mut self,
value: impl Into<Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_age_assurance_updated_by(
mut self,
value: Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::CreatedAt: subject_status_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetCreatedAt<S>> {
self._fields.6 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn hosting(
mut self,
value: impl Into<Option<SubjectStatusViewHosting<'a>>>,
) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_hosting(mut self, value: Option<SubjectStatusViewHosting<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::Id: subject_status_view_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetId<S>> {
self._fields.8 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn last_reviewed_by(mut self, value: impl Into<Option<Did<'a>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_last_reviewed_by(mut self, value: Option<Did<'a>>) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn records_stats(
mut self,
value: impl Into<Option<moderation::RecordsStats<'a>>>,
) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_records_stats(
mut self,
value: Option<moderation::RecordsStats<'a>>,
) -> Self {
self._fields.16 = value;
self
}
}
impl<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::ReviewState: subject_status_view_state::IsUnset,
{
pub fn review_state(
mut self,
value: impl Into<moderation::SubjectReviewState<'a>>,
) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetReviewState<S>> {
self._fields.17 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::Subject: subject_status_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<SubjectStatusViewSubject<'a>>,
) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetSubject<S>> {
self._fields.18 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn subject_blob_cids(mut self, value: impl Into<Option<Vec<Cid<'a>>>>) -> Self {
self._fields.19 = value.into();
self
}
pub fn maybe_subject_blob_cids(mut self, value: Option<Vec<Cid<'a>>>) -> Self {
self._fields.19 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn subject_repo_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.20 = value.into();
self
}
pub fn maybe_subject_repo_handle(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.20 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
pub fn tags(mut self, value: impl Into<Option<Vec<CowStr<'a>>>>) -> Self {
self._fields.22 = value.into();
self
}
pub fn maybe_tags(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
self._fields.22 = value;
self
}
}
impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
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<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::UpdatedAt: subject_status_view_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetUpdatedAt<S>> {
self._fields.24 = Option::Some(value.into());
SubjectStatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SubjectStatusViewBuilder<'a, S>
where
S: subject_status_view_state::State,
S::UpdatedAt: subject_status_view_state::IsSet,
S::Id: subject_status_view_state::IsSet,
S::ReviewState: subject_status_view_state::IsSet,
S::Subject: subject_status_view_state::IsSet,
S::CreatedAt: subject_status_view_state::IsSet,
{
pub fn build(self) -> SubjectStatusView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> SubjectStatusView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type Subject = Set<members::subject>;
type Type = S::Type;
}
pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetType<S> {}
impl<S: State> State for SetType<S> {
type Subject = S::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<'a, S: subject_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Data<'a>>,
Option<moderation::RecordViewDetail<'a>>,
Option<moderation::RepoViewDetail<'a>>,
Option<moderation::SubjectStatusView<'a>>,
Option<CowStr<'a>>,
Option<SubjectType<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SubjectView<'a> {
pub fn new() -> SubjectViewBuilder<'a, subject_view_state::Empty> {
SubjectViewBuilder::new()
}
}
impl<'a> SubjectViewBuilder<'a, subject_view_state::Empty> {
pub fn new() -> Self {
SubjectViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
pub fn profile(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_profile(mut self, value: Option<Data<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
pub fn record(
mut self,
value: impl Into<Option<moderation::RecordViewDetail<'a>>>,
) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_record(
mut self,
value: Option<moderation::RecordViewDetail<'a>>,
) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
pub fn repo(
mut self,
value: impl Into<Option<moderation::RepoViewDetail<'a>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_repo(mut self, value: Option<moderation::RepoViewDetail<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
pub fn status(
mut self,
value: impl Into<Option<moderation::SubjectStatusView<'a>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_status(
mut self,
value: Option<moderation::SubjectStatusView<'a>>,
) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> SubjectViewBuilder<'a, S>
where
S: subject_view_state::State,
S::Subject: subject_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<CowStr<'a>>,
) -> SubjectViewBuilder<'a, subject_view_state::SetSubject<S>> {
self._fields.4 = Option::Some(value.into());
SubjectViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SubjectViewBuilder<'a, S>
where
S: subject_view_state::State,
S::Type: subject_view_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<SubjectType<'a>>,
) -> SubjectViewBuilder<'a, subject_view_state::SetType<S>> {
self._fields.5 = Option::Some(value.into());
SubjectViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SubjectViewBuilder<'a, S>
where
S: subject_view_state::State,
S::Subject: subject_view_state::IsSet,
S::Type: subject_view_state::IsSet,
{
pub fn build(self) -> SubjectView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> SubjectView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Height;
type Length;
type Width;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Height = Unset;
type Length = Unset;
type Width = Unset;
}
pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHeight<S> {}
impl<S: State> State for SetHeight<S> {
type Height = Set<members::height>;
type Length = S::Length;
type Width = S::Width;
}
pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLength<S> {}
impl<S: State> State for SetLength<S> {
type Height = S::Height;
type Length = Set<members::length>;
type Width = S::Width;
}
pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetWidth<S> {}
impl<S: State> State for SetWidth<S> {
type Height = S::Height;
type Length = S::Length;
type Width = Set<members::width>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct height(());
pub struct length(());
pub struct width(());
}
}
pub struct VideoDetailsBuilder<'a, S: video_details_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<i64>, Option<i64>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> VideoDetails<'a> {
pub fn new() -> VideoDetailsBuilder<'a, video_details_state::Empty> {
VideoDetailsBuilder::new()
}
}
impl<'a> VideoDetailsBuilder<'a, video_details_state::Empty> {
pub fn new() -> Self {
VideoDetailsBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> VideoDetailsBuilder<'a, S>
where
S: video_details_state::State,
S::Height: video_details_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<'a, video_details_state::SetHeight<S>> {
self._fields.0 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VideoDetailsBuilder<'a, S>
where
S: video_details_state::State,
S::Length: video_details_state::IsUnset,
{
pub fn length(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<'a, video_details_state::SetLength<S>> {
self._fields.1 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VideoDetailsBuilder<'a, S>
where
S: video_details_state::State,
S::Width: video_details_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> VideoDetailsBuilder<'a, video_details_state::SetWidth<S>> {
self._fields.2 = Option::Some(value.into());
VideoDetailsBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VideoDetailsBuilder<'a, S>
where
S: video_details_state::State,
S::Height: video_details_state::IsSet,
S::Length: video_details_state::IsSet,
S::Width: video_details_state::IsSet,
{
pub fn build(self) -> VideoDetails<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> VideoDetails<'a> {
VideoDetails {
height: self._fields.0.unwrap(),
length: self._fields.1.unwrap(),
width: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}