A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.moderation.scheduleAction 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[jacquard_derive::lexicon] 9#[derive( 10 serde::Serialize, 11 serde::Deserialize, 12 Debug, 13 Clone, 14 PartialEq, 15 Eq, 16 jacquard_derive::IntoStatic 17)] 18#[serde(rename_all = "camelCase")] 19pub struct FailedScheduling<'a> { 20 #[serde(borrow)] 21 pub error: jacquard_common::CowStr<'a>, 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 pub error_code: std::option::Option<jacquard_common::CowStr<'a>>, 25 #[serde(borrow)] 26 pub subject: jacquard_common::types::string::Did<'a>, 27} 28 29#[jacquard_derive::lexicon] 30#[derive( 31 serde::Serialize, 32 serde::Deserialize, 33 Debug, 34 Clone, 35 PartialEq, 36 Eq, 37 bon::Builder, 38 jacquard_derive::IntoStatic 39)] 40#[serde(rename_all = "camelCase")] 41#[builder(start_fn = new)] 42pub struct ScheduleAction<'a> { 43 #[serde(borrow)] 44 pub action: jacquard_common::types::value::Data<'a>, 45 #[serde(borrow)] 46 pub created_by: jacquard_common::types::string::Did<'a>, 47 ///This will be propagated to the moderation event when it is applied 48 #[serde(skip_serializing_if = "std::option::Option::is_none")] 49 #[serde(borrow)] 50 pub mod_tool: std::option::Option<crate::tools_ozone::moderation::ModTool<'a>>, 51 #[serde(borrow)] 52 pub scheduling: jacquard_common::types::value::Data<'a>, 53 ///Array of DID subjects to schedule the action for 54 #[serde(borrow)] 55 pub subjects: Vec<jacquard_common::types::string::Did<'a>>, 56 #[serde(flatten)] 57 #[serde(borrow)] 58 #[builder(default)] 59 pub extra_data: ::std::collections::BTreeMap< 60 ::jacquard_common::smol_str::SmolStr, 61 ::jacquard_common::types::value::Data<'a>, 62 >, 63} 64 65#[jacquard_derive::lexicon] 66#[derive( 67 serde::Serialize, 68 serde::Deserialize, 69 Debug, 70 Clone, 71 PartialEq, 72 Eq, 73 jacquard_derive::IntoStatic 74)] 75#[serde(rename_all = "camelCase")] 76pub struct ScheduleActionOutput<'a> { 77 #[serde(flatten)] 78 #[serde(borrow)] 79 pub value: jacquard_common::types::value::Data<'a>, 80} 81 82///Response type for 83///tools.ozone.moderation.scheduleAction 84pub struct ScheduleActionResponse; 85impl jacquard_common::xrpc::XrpcResp for ScheduleActionResponse { 86 const NSID: &'static str = "tools.ozone.moderation.scheduleAction"; 87 const ENCODING: &'static str = "application/json"; 88 type Output<'de> = ScheduleActionOutput<'de>; 89 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 90} 91 92impl<'a> jacquard_common::xrpc::XrpcRequest for ScheduleAction<'a> { 93 const NSID: &'static str = "tools.ozone.moderation.scheduleAction"; 94 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 95 "application/json", 96 ); 97 type Response = ScheduleActionResponse; 98} 99 100///Endpoint type for 101///tools.ozone.moderation.scheduleAction 102pub struct ScheduleActionRequest; 103impl jacquard_common::xrpc::XrpcEndpoint for ScheduleActionRequest { 104 const PATH: &'static str = "/xrpc/tools.ozone.moderation.scheduleAction"; 105 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 106 "application/json", 107 ); 108 type Request<'de> = ScheduleAction<'de>; 109 type Response = ScheduleActionResponse; 110} 111 112#[jacquard_derive::lexicon] 113#[derive( 114 serde::Serialize, 115 serde::Deserialize, 116 Debug, 117 Clone, 118 PartialEq, 119 Eq, 120 jacquard_derive::IntoStatic 121)] 122#[serde(rename_all = "camelCase")] 123pub struct ScheduledActionResults<'a> { 124 #[serde(borrow)] 125 pub failed: Vec< 126 crate::tools_ozone::moderation::schedule_action::FailedScheduling<'a>, 127 >, 128 #[serde(borrow)] 129 pub succeeded: Vec<jacquard_common::types::string::Did<'a>>, 130} 131 132///Configuration for when the action should be executed 133#[jacquard_derive::lexicon] 134#[derive( 135 serde::Serialize, 136 serde::Deserialize, 137 Debug, 138 Clone, 139 PartialEq, 140 Eq, 141 jacquard_derive::IntoStatic 142)] 143#[serde(rename_all = "camelCase")] 144pub struct SchedulingConfig<'a> { 145 ///Earliest time to execute the action (for randomized scheduling) 146 #[serde(skip_serializing_if = "std::option::Option::is_none")] 147 pub execute_after: std::option::Option<jacquard_common::types::string::Datetime>, 148 ///Exact time to execute the action 149 #[serde(skip_serializing_if = "std::option::Option::is_none")] 150 pub execute_at: std::option::Option<jacquard_common::types::string::Datetime>, 151 ///Latest time to execute the action (for randomized scheduling) 152 #[serde(skip_serializing_if = "std::option::Option::is_none")] 153 pub execute_until: std::option::Option<jacquard_common::types::string::Datetime>, 154} 155 156///Schedule a takedown action 157#[jacquard_derive::lexicon] 158#[derive( 159 serde::Serialize, 160 serde::Deserialize, 161 Debug, 162 Clone, 163 PartialEq, 164 Eq, 165 jacquard_derive::IntoStatic 166)] 167#[serde(rename_all = "camelCase")] 168pub struct Takedown<'a> { 169 ///If true, all other reports on content authored by this account will be resolved (acknowledged). 170 #[serde(skip_serializing_if = "std::option::Option::is_none")] 171 pub acknowledge_account_subjects: std::option::Option<bool>, 172 #[serde(skip_serializing_if = "std::option::Option::is_none")] 173 #[serde(borrow)] 174 pub comment: std::option::Option<jacquard_common::CowStr<'a>>, 175 ///Indicates how long the takedown should be in effect before automatically expiring. 176 #[serde(skip_serializing_if = "std::option::Option::is_none")] 177 pub duration_in_hours: std::option::Option<i64>, 178 ///Names/Keywords of the policies that drove the decision. 179 #[serde(skip_serializing_if = "std::option::Option::is_none")] 180 #[serde(borrow)] 181 pub policies: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 182}