Something went wrong. Try again.
Something went wrong. Try again.
59 kB · 1554 lines
Rust
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554// @generated by jacquard-lexicon. DO NOT EDIT.//// Lexicon: tools.ozone.queue.defs//// This file was automatically generated from Lexicon schemas.// Any manual changes will be overwritten on the next regeneration.
//! Generated bindings for the `tools.ozone.queue` Lexicon namespace/module.pub mod assign_moderator;pub mod create_queue;pub mod delete_queue;pub mod get_assignments;pub mod list_queues;pub mod route_reports;pub mod unassign_moderator;pub mod update_queue;
#[allow(unused_imports)]use alloc::collections::BTreeMap;
#[allow(unused_imports)]use core::marker::PhantomData;use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;use jacquard_common::deps::smol_str::SmolStr;use jacquard_common::types::string::{Did, Nsid, Datetime};use jacquard_common::types::value::Data;use jacquard_derive::IntoStatic;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::tools_ozone::team::Member;use crate::tools_ozone::queue;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct AssignmentView<S: BosStr = DefaultStr> { pub did: Did<S>, #[serde(skip_serializing_if = "Option::is_none")] pub end_at: Option<Datetime>, pub id: i64, ///The moderator assigned to this queue #[serde(skip_serializing_if = "Option::is_none")] pub moderator: Option<Member<S>>, pub queue: queue::QueueView<S>, pub start_at: Datetime, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct QueueStats<S: BosStr = DefaultStr> { ///Number of closures whose last report action is not label, tag, or takedown. #[serde(skip_serializing_if = "Option::is_none")] pub acknowledged_count: Option<i64>, ///Percentage of closures actioned (actionedCount / closedCount * 100), rounded to nearest integer. #[serde(skip_serializing_if = "Option::is_none")] pub action_rate: Option<i64>, ///Number of closures whose last report action is label, tag, or takedown. #[serde(skip_serializing_if = "Option::is_none")] pub actioned_count: Option<i64>, ///Sum of report assignment-to-close seconds. #[serde(skip_serializing_if = "Option::is_none")] pub aht_duration_sec: Option<i64>, ///Number of assigned closed-report samples in ahtDurationSec. #[serde(skip_serializing_if = "Option::is_none")] pub aht_sample_count: Option<i64>, ///Average handling time in seconds from report assignment to close. #[serde(skip_serializing_if = "Option::is_none")] pub avg_handling_time_sec: Option<i64>, ///Average resolution time in seconds from report creation to close. #[serde(skip_serializing_if = "Option::is_none")] pub avg_resolution_time_sec: Option<i64>, ///Number of reports whose current closure falls within this UTC calendar day. #[serde(skip_serializing_if = "Option::is_none")] pub closed_count: Option<i64>, ///Reports whose closure meets their closure target. #[serde(skip_serializing_if = "Option::is_none")] pub closure_target_met_count: Option<i64>, ///Percent of reports meeting their closure target. #[serde(skip_serializing_if = "Option::is_none")] pub closure_target_met_rate: Option<i64>, ///Reports whose closure exceeds their closure target. #[serde(skip_serializing_if = "Option::is_none")] pub closure_target_missed_count: Option<i64>, ///Unmuted pending reports past their closure target. #[serde(skip_serializing_if = "Option::is_none")] pub closure_target_overdue_count: Option<i64>, ///Number of report escalation events during this UTC calendar day. #[serde(skip_serializing_if = "Option::is_none")] pub escalated_count: Option<i64>, ///Reports received in this queue during this UTC calendar day. #[serde(skip_serializing_if = "Option::is_none")] pub inbound_count: Option<i64>, ///Closures whose last report action is a label event. #[serde(skip_serializing_if = "Option::is_none")] pub label_action_count: Option<i64>, ///When these statistics were last computed. #[serde(skip_serializing_if = "Option::is_none")] pub last_updated: Option<Datetime>, ///Number of unmuted reports currently not closed. #[serde(skip_serializing_if = "Option::is_none")] pub pending_count: Option<i64>, ///Sum of report creation-to-close seconds. #[serde(skip_serializing_if = "Option::is_none")] pub resolution_duration_sec: Option<i64>, ///Number of closed-report samples in resolutionDurationSec. #[serde(skip_serializing_if = "Option::is_none")] pub resolution_sample_count: Option<i64>, ///Closures whose last report action is a tag event. #[serde(skip_serializing_if = "Option::is_none")] pub tag_action_count: Option<i64>, ///Closures whose last report action is a takedown event. #[serde(skip_serializing_if = "Option::is_none")] pub takedown_action_count: Option<i64>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct QueueView<S: BosStr = DefaultStr> { ///Match tags on the account that is being reported against. For record subjects, use the author account. Match any listed tag. #[serde(skip_serializing_if = "Option::is_none")] pub account_tags: Option<Vec<S>>, ///Collection name for record subjects. Omit to accept every collection. #[serde(skip_serializing_if = "Option::is_none")] pub collection: Option<Nsid<S>>, pub created_at: Datetime, ///DID of moderator who created this queue pub created_by: Did<S>, ///When the queue was deleted, if applicable #[serde(skip_serializing_if = "Option::is_none")] pub deleted_at: Option<Datetime>, ///Optional description of the queue #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<S>, ///Whether this queue is currently active pub enabled: bool, ///Queue ID pub id: i64, ///Display name of the queue pub name: S, ///Labels recommended for this queue and used as a fallback when routing label appeals #[serde(skip_serializing_if = "Option::is_none")] pub recommended_labels: Option<Vec<S>>, ///Policy keys recommended when actioning reports in this queue #[serde(skip_serializing_if = "Option::is_none")] pub recommended_policies: Option<Vec<S>>, ///Report reason types this queue accepts (fully qualified NSIDs) #[serde(skip_serializing_if = "Option::is_none")] pub report_types: Option<Vec<S>>, ///Match any listed tag on the account submitting the report. #[serde(skip_serializing_if = "Option::is_none")] pub reporter_tags: Option<Vec<S>>, ///Statistics about this queue pub stats: queue::QueueStats<S>, ///Admins can always list this queue and browse its reports. Other roles require an active queue assignment. Individual report and moderation event access is unchanged. #[serde(skip_serializing_if = "Option::is_none")] pub strict_access: Option<bool>, ///Subject types this queue accepts. #[serde(skip_serializing_if = "Option::is_none")] pub subject_types: Option<Vec<S>>, pub updated_at: Datetime, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
impl<S: BosStr> LexiconSchema for AssignmentView<S> { fn nsid() -> &'static str { "tools.ozone.queue.defs" } fn def_name() -> &'static str { "assignmentView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_tools_ozone_queue_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) }}
impl<S: BosStr> LexiconSchema for QueueStats<S> { fn nsid() -> &'static str { "tools.ozone.queue.defs" } fn def_name() -> &'static str { "queueStats" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_tools_ozone_queue_defs() } fn validate(&self) -> Result<(), ConstraintError> { if let Some(ref value) = self.closure_target_met_count { if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("closure_target_met_count"), min: 0i64, actual: *value, }); } } if let Some(ref value) = self.closure_target_met_rate { if *value > 100i64 { return Err(ConstraintError::Maximum { path: ValidationPath::from_field("closure_target_met_rate"), max: 100i64, actual: *value, }); } } if let Some(ref value) = self.closure_target_met_rate { if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("closure_target_met_rate"), min: 0i64, actual: *value, }); } } if let Some(ref value) = self.closure_target_missed_count { if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("closure_target_missed_count"), min: 0i64, actual: *value, }); } } if let Some(ref value) = self.closure_target_overdue_count { if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("closure_target_overdue_count"), min: 0i64, actual: *value, }); } } Ok(()) }}
impl<S: BosStr> LexiconSchema for QueueView<S> { fn nsid() -> &'static str { "tools.ozone.queue.defs" } fn def_name() -> &'static str { "queueView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_tools_ozone_queue_defs() } fn validate(&self) -> Result<(), ConstraintError> { if let Some(ref value) = self.account_tags { #[allow(unused_comparisons)] if value.len() > 25usize { return Err(ConstraintError::MaxLength { path: ValidationPath::from_field("account_tags"), max: 25usize, actual: value.len(), }); } } if let Some(values) = &self.account_tags { for value in values { #[allow(unused_comparisons)] if <str>::len(value.as_ref()) < 1usize { return Err(ConstraintError::MinLength { path: ValidationPath::from_field("account_tags"), min: 1usize, actual: <str>::len(value.as_ref()), }); } } } if let Some(ref value) = self.reporter_tags { #[allow(unused_comparisons)] if value.len() > 25usize { return Err(ConstraintError::MaxLength { path: ValidationPath::from_field("reporter_tags"), max: 25usize, actual: value.len(), }); } } if let Some(values) = &self.reporter_tags { for value in values { #[allow(unused_comparisons)] if <str>::len(value.as_ref()) < 1usize { return Err(ConstraintError::MinLength { path: ValidationPath::from_field("reporter_tags"), min: 1usize, actual: <str>::len(value.as_ref()), }); } } } Ok(()) }}
pub mod assignment_view_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; type Id; type Queue; type StartAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type Id = Unset; type Queue = Unset; type StartAt = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetDid<St> {} impl<St: State> State for SetDid<St> { type Did = Set<members::did>; type Id = St::Id; type Queue = St::Queue; type StartAt = St::StartAt; } ///State transition - sets the `id` field to Set pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetId<St> {} impl<St: State> State for SetId<St> { type Did = St::Did; type Id = Set<members::id>; type Queue = St::Queue; type StartAt = St::StartAt; } ///State transition - sets the `queue` field to Set pub struct SetQueue<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetQueue<St> {} impl<St: State> State for SetQueue<St> { type Did = St::Did; type Id = St::Id; type Queue = Set<members::queue>; type StartAt = St::StartAt; } ///State transition - sets the `start_at` field to Set pub struct SetStartAt<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetStartAt<St> {} impl<St: State> State for SetStartAt<St> { type Did = St::Did; type Id = St::Id; type Queue = St::Queue; type StartAt = Set<members::start_at>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `queue` field pub struct queue(()); ///Marker type for the `start_at` field pub struct start_at(()); }}
/// Builder for constructing an instance of this type.pub struct AssignmentViewBuilder< St: assignment_view_state::State, S: BosStr = DefaultStr,> { _state: PhantomData<fn() -> St>, _fields: ( Option<Did<S>>, Option<Datetime>, Option<i64>, Option<Member<S>>, Option<queue::QueueView<S>>, Option<Datetime>, ), _type: PhantomData<fn() -> S>,}
impl AssignmentView<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> AssignmentViewBuilder<assignment_view_state::Empty, DefaultStr> { AssignmentViewBuilder::new() }}
impl<S: BosStr> AssignmentView<S> { /// Create a new builder for this type pub fn builder() -> AssignmentViewBuilder<assignment_view_state::Empty, S> { AssignmentViewBuilder::builder() }}
impl AssignmentViewBuilder<assignment_view_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { AssignmentViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None), _type: PhantomData, } }}
impl<S: BosStr> AssignmentViewBuilder<assignment_view_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { AssignmentViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None), _type: PhantomData, } }}
impl<St, S: BosStr> AssignmentViewBuilder<St, S>where St: assignment_view_state::State, St::Did: assignment_view_state::IsUnset,{ /// Set the `did` field (required) pub fn did( mut self, value: impl Into<Did<S>>, ) -> AssignmentViewBuilder<assignment_view_state::SetDid<St>, S> { self._fields.0 = Option::Some(value.into()); AssignmentViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: assignment_view_state::State, S: BosStr> AssignmentViewBuilder<St, S> { /// Set the `endAt` field (optional) pub fn end_at(mut self, value: impl Into<Option<Datetime>>) -> Self { self._fields.1 = value.into(); self } /// Set the `endAt` field to an Option value (optional) pub fn maybe_end_at(mut self, value: Option<Datetime>) -> Self { self._fields.1 = value; self }}
impl<St, S: BosStr> AssignmentViewBuilder<St, S>where St: assignment_view_state::State, St::Id: assignment_view_state::IsUnset,{ /// Set the `id` field (required) pub fn id( mut self, value: impl Into<i64>, ) -> AssignmentViewBuilder<assignment_view_state::SetId<St>, S> { self._fields.2 = Option::Some(value.into()); AssignmentViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: assignment_view_state::State, S: BosStr> AssignmentViewBuilder<St, S> { /// Set the `moderator` field (optional) pub fn moderator(mut self, value: impl Into<Option<Member<S>>>) -> Self { self._fields.3 = value.into(); self } /// Set the `moderator` field to an Option value (optional) pub fn maybe_moderator(mut self, value: Option<Member<S>>) -> Self { self._fields.3 = value; self }}
impl<St, S: BosStr> AssignmentViewBuilder<St, S>where St: assignment_view_state::State, St::Queue: assignment_view_state::IsUnset,{ /// Set the `queue` field (required) pub fn queue( mut self, value: impl Into<queue::QueueView<S>>, ) -> AssignmentViewBuilder<assignment_view_state::SetQueue<St>, S> { self._fields.4 = Option::Some(value.into()); AssignmentViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> AssignmentViewBuilder<St, S>where St: assignment_view_state::State, St::StartAt: assignment_view_state::IsUnset,{ /// Set the `startAt` field (required) pub fn start_at( mut self, value: impl Into<Datetime>, ) -> AssignmentViewBuilder<assignment_view_state::SetStartAt<St>, S> { self._fields.5 = Option::Some(value.into()); AssignmentViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> AssignmentViewBuilder<St, S>where St: assignment_view_state::State, St::Did: assignment_view_state::IsSet, St::Id: assignment_view_state::IsSet, St::Queue: assignment_view_state::IsSet, St::StartAt: assignment_view_state::IsSet,{ /// Build the final struct. pub fn build(self) -> AssignmentView<S> { AssignmentView { did: self._fields.0.unwrap(), end_at: self._fields.1, id: self._fields.2.unwrap(), moderator: self._fields.3, queue: self._fields.4.unwrap(), start_at: self._fields.5.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap<SmolStr, Data<S>>, ) -> AssignmentView<S> { AssignmentView { did: self._fields.0.unwrap(), end_at: self._fields.1, id: self._fields.2.unwrap(), moderator: self._fields.3, queue: self._fields.4.unwrap(), start_at: self._fields.5.unwrap(), extra_data: Some(extra_data), } }}
fn lexicon_doc_tools_ozone_queue_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.queue.defs"), defs: { let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("assignmentView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("id"), SmolStr::new_static("did"), SmolStr::new_static("queue"), SmolStr::new_static("startAt") ], ), 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.insert( SmolStr::new_static("endAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("id"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("moderator"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("tools.ozone.team.defs#member"), ..Default::default() }), ); map.insert( SmolStr::new_static("queue"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#queueView"), ..Default::default() }), ); map.insert( SmolStr::new_static("startAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("queueStats"), LexUserType::Object(LexObject { required: Some(vec![]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("acknowledgedCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("actionRate"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("actionedCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("ahtDurationSec"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("ahtSampleCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("avgHandlingTimeSec"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("avgResolutionTimeSec"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("closedCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("closureTargetMetCount"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), ..Default::default() }), ); map.insert( SmolStr::new_static("closureTargetMetRate"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), maximum: Some(100i64), ..Default::default() }), ); map.insert( SmolStr::new_static("closureTargetMissedCount"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), ..Default::default() }), ); map.insert( SmolStr::new_static("closureTargetOverdueCount"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), ..Default::default() }), ); map.insert( SmolStr::new_static("escalatedCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("inboundCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("labelActionCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("lastUpdated"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "When these statistics were last computed.", ), ), format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("pendingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("resolutionDurationSec"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("resolutionSampleCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("tagActionCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("takedownActionCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("queueView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("id"), SmolStr::new_static("name"), SmolStr::new_static("createdBy"), SmolStr::new_static("createdAt"), SmolStr::new_static("updatedAt"), SmolStr::new_static("enabled"), SmolStr::new_static("stats") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("accountTags"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Match tags on the account that is being reported against. For record subjects, use the author account. Match any listed tag.", ), ), items: LexArrayItem::String(LexString { min_length: Some(1usize), ..Default::default() }), max_length: Some(25usize), ..Default::default() }), ); map.insert( SmolStr::new_static("collection"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Collection name for record subjects. Omit to accept every collection.", ), ), format: Some(LexStringFormat::Nsid), ..Default::default() }), ); map.insert( SmolStr::new_static("createdAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("createdBy"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "DID of moderator who created this queue", ), ), format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("deletedAt"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "When the queue was deleted, if applicable", ), ), format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static("Optional description of the queue"), ), ..Default::default() }), ); map.insert( SmolStr::new_static("enabled"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("id"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static("Display name of the queue"), ), ..Default::default() }), ); map.insert( SmolStr::new_static("recommendedLabels"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Labels recommended for this queue and used as a fallback when routing label appeals", ), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("recommendedPolicies"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Policy keys recommended when actioning reports in this queue", ), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("reportTypes"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Report reason types this queue accepts (fully qualified NSIDs)", ), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("reporterTags"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Match any listed tag on the account submitting the report.", ), ), items: LexArrayItem::String(LexString { min_length: Some(1usize), ..Default::default() }), max_length: Some(25usize), ..Default::default() }), ); map.insert( SmolStr::new_static("stats"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#queueStats"), ..Default::default() }), ); map.insert( SmolStr::new_static("strictAccess"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("subjectTypes"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static("Subject types this queue accepts."), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("updatedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map }, ..Default::default() }), ); map }, ..Default::default() }}
pub mod queue_view_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; type CreatedBy; type Enabled; type Id; type Name; type Stats; type UpdatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; type CreatedBy = Unset; type Enabled = Unset; type Id = Unset; type Name = Unset; type Stats = Unset; type UpdatedAt = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCreatedAt<St> {} impl<St: State> State for SetCreatedAt<St> { type CreatedAt = Set<members::created_at>; type CreatedBy = St::CreatedBy; type Enabled = St::Enabled; type Id = St::Id; type Name = St::Name; type Stats = St::Stats; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCreatedBy<St> {} impl<St: State> State for SetCreatedBy<St> { type CreatedAt = St::CreatedAt; type CreatedBy = Set<members::created_by>; type Enabled = St::Enabled; type Id = St::Id; type Name = St::Name; type Stats = St::Stats; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `enabled` field to Set pub struct SetEnabled<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetEnabled<St> {} impl<St: State> State for SetEnabled<St> { type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Enabled = Set<members::enabled>; type Id = St::Id; type Name = St::Name; type Stats = St::Stats; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `id` field to Set pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetId<St> {} impl<St: State> State for SetId<St> { type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Enabled = St::Enabled; type Id = Set<members::id>; type Name = St::Name; type Stats = St::Stats; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `name` field to Set pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetName<St> {} impl<St: State> State for SetName<St> { type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Enabled = St::Enabled; type Id = St::Id; type Name = Set<members::name>; type Stats = St::Stats; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `stats` field to Set pub struct SetStats<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetStats<St> {} impl<St: State> State for SetStats<St> { type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Enabled = St::Enabled; type Id = St::Id; type Name = St::Name; type Stats = Set<members::stats>; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetUpdatedAt<St> {} impl<St: State> State for SetUpdatedAt<St> { type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Enabled = St::Enabled; type Id = St::Id; type Name = St::Name; type Stats = St::Stats; type UpdatedAt = Set<members::updated_at>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `enabled` field pub struct enabled(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `stats` field pub struct stats(()); ///Marker type for the `updated_at` field pub struct updated_at(()); }}
/// Builder for constructing an instance of this type.pub struct QueueViewBuilder<St: queue_view_state::State, S: BosStr = DefaultStr> { _state: PhantomData<fn() -> St>, _fields: ( Option<Vec<S>>, Option<Nsid<S>>, Option<Datetime>, Option<Did<S>>, Option<Datetime>, Option<S>, Option<bool>, Option<i64>, Option<S>, Option<Vec<S>>, Option<Vec<S>>, Option<Vec<S>>, Option<Vec<S>>, Option<queue::QueueStats<S>>, Option<bool>, Option<Vec<S>>, Option<Datetime>, ), _type: PhantomData<fn() -> S>,}
impl QueueView<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> QueueViewBuilder<queue_view_state::Empty, DefaultStr> { QueueViewBuilder::new() }}
impl<S: BosStr> QueueView<S> { /// Create a new builder for this type pub fn builder() -> QueueViewBuilder<queue_view_state::Empty, S> { QueueViewBuilder::builder() }}
impl QueueViewBuilder<queue_view_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { QueueViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } }}
impl<S: BosStr> QueueViewBuilder<queue_view_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { QueueViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `accountTags` field (optional) pub fn account_tags(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.0 = value.into(); self } /// Set the `accountTags` field to an Option value (optional) pub fn maybe_account_tags(mut self, value: Option<Vec<S>>) -> Self { self._fields.0 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `collection` field (optional) pub fn collection(mut self, value: impl Into<Option<Nsid<S>>>) -> Self { self._fields.1 = value.into(); self } /// Set the `collection` field to an Option value (optional) pub fn maybe_collection(mut self, value: Option<Nsid<S>>) -> Self { self._fields.1 = value; self }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::CreatedAt: queue_view_state::IsUnset,{ /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into<Datetime>, ) -> QueueViewBuilder<queue_view_state::SetCreatedAt<St>, S> { self._fields.2 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::CreatedBy: queue_view_state::IsUnset,{ /// Set the `createdBy` field (required) pub fn created_by( mut self, value: impl Into<Did<S>>, ) -> QueueViewBuilder<queue_view_state::SetCreatedBy<St>, S> { self._fields.3 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `deletedAt` field (optional) pub fn deleted_at(mut self, value: impl Into<Option<Datetime>>) -> Self { self._fields.4 = value.into(); self } /// Set the `deletedAt` field to an Option value (optional) pub fn maybe_deleted_at(mut self, value: Option<Datetime>) -> Self { self._fields.4 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into<Option<S>>) -> Self { self._fields.5 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option<S>) -> Self { self._fields.5 = value; self }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::Enabled: queue_view_state::IsUnset,{ /// Set the `enabled` field (required) pub fn enabled( mut self, value: impl Into<bool>, ) -> QueueViewBuilder<queue_view_state::SetEnabled<St>, S> { self._fields.6 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::Id: queue_view_state::IsUnset,{ /// Set the `id` field (required) pub fn id( mut self, value: impl Into<i64>, ) -> QueueViewBuilder<queue_view_state::SetId<St>, S> { self._fields.7 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::Name: queue_view_state::IsUnset,{ /// Set the `name` field (required) pub fn name( mut self, value: impl Into<S>, ) -> QueueViewBuilder<queue_view_state::SetName<St>, S> { self._fields.8 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `recommendedLabels` field (optional) pub fn recommended_labels(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.9 = value.into(); self } /// Set the `recommendedLabels` field to an Option value (optional) pub fn maybe_recommended_labels(mut self, value: Option<Vec<S>>) -> Self { self._fields.9 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `recommendedPolicies` field (optional) pub fn recommended_policies(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.10 = value.into(); self } /// Set the `recommendedPolicies` field to an Option value (optional) pub fn maybe_recommended_policies(mut self, value: Option<Vec<S>>) -> Self { self._fields.10 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `reportTypes` field (optional) pub fn report_types(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.11 = value.into(); self } /// Set the `reportTypes` field to an Option value (optional) pub fn maybe_report_types(mut self, value: Option<Vec<S>>) -> Self { self._fields.11 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `reporterTags` field (optional) pub fn reporter_tags(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.12 = value.into(); self } /// Set the `reporterTags` field to an Option value (optional) pub fn maybe_reporter_tags(mut self, value: Option<Vec<S>>) -> Self { self._fields.12 = value; self }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::Stats: queue_view_state::IsUnset,{ /// Set the `stats` field (required) pub fn stats( mut self, value: impl Into<queue::QueueStats<S>>, ) -> QueueViewBuilder<queue_view_state::SetStats<St>, S> { self._fields.13 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `strictAccess` field (optional) pub fn strict_access(mut self, value: impl Into<Option<bool>>) -> Self { self._fields.14 = value.into(); self } /// Set the `strictAccess` field to an Option value (optional) pub fn maybe_strict_access(mut self, value: Option<bool>) -> Self { self._fields.14 = value; self }}
impl<St: queue_view_state::State, S: BosStr> QueueViewBuilder<St, S> { /// Set the `subjectTypes` field (optional) pub fn subject_types(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.15 = value.into(); self } /// Set the `subjectTypes` field to an Option value (optional) pub fn maybe_subject_types(mut self, value: Option<Vec<S>>) -> Self { self._fields.15 = value; self }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::UpdatedAt: queue_view_state::IsUnset,{ /// Set the `updatedAt` field (required) pub fn updated_at( mut self, value: impl Into<Datetime>, ) -> QueueViewBuilder<queue_view_state::SetUpdatedAt<St>, S> { self._fields.16 = Option::Some(value.into()); QueueViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> QueueViewBuilder<St, S>where St: queue_view_state::State, St::CreatedAt: queue_view_state::IsSet, St::CreatedBy: queue_view_state::IsSet, St::Enabled: queue_view_state::IsSet, St::Id: queue_view_state::IsSet, St::Name: queue_view_state::IsSet, St::Stats: queue_view_state::IsSet, St::UpdatedAt: queue_view_state::IsSet,{ /// Build the final struct. pub fn build(self) -> QueueView<S> { QueueView { account_tags: self._fields.0, collection: self._fields.1, created_at: self._fields.2.unwrap(), created_by: self._fields.3.unwrap(), deleted_at: self._fields.4, description: self._fields.5, enabled: self._fields.6.unwrap(), id: self._fields.7.unwrap(), name: self._fields.8.unwrap(), recommended_labels: self._fields.9, recommended_policies: self._fields.10, report_types: self._fields.11, reporter_tags: self._fields.12, stats: self._fields.13.unwrap(), strict_access: self._fields.14, subject_types: self._fields.15, updated_at: self._fields.16.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap<SmolStr, Data<S>>, ) -> QueueView<S> { QueueView { account_tags: self._fields.0, collection: self._fields.1, created_at: self._fields.2.unwrap(), created_by: self._fields.3.unwrap(), deleted_at: self._fields.4, description: self._fields.5, enabled: self._fields.6.unwrap(), id: self._fields.7.unwrap(), name: self._fields.8.unwrap(), recommended_labels: self._fields.9, recommended_policies: self._fields.10, report_types: self._fields.11, reporter_tags: self._fields.12, stats: self._fields.13.unwrap(), strict_access: self._fields.14, subject_types: self._fields.15, updated_at: self._fields.16.unwrap(), extra_data: Some(extra_data), } }}