A better Rust ATProto crate
at lifetimes 4.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: network.slices.slice.getJobStatus 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 JobStatus<'a> { 20 ///When the job completed 21 #[serde(skip_serializing_if = "std::option::Option::is_none")] 22 pub completed_at: std::option::Option<jacquard_common::types::string::Datetime>, 23 ///When the job was created 24 pub created_at: jacquard_common::types::string::Datetime, 25 ///Error message if job failed 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 #[serde(borrow)] 28 pub error: std::option::Option<jacquard_common::CowStr<'a>>, 29 ///UUID of the job 30 #[serde(borrow)] 31 pub job_id: jacquard_common::CowStr<'a>, 32 ///Job result if completed successfully 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[serde(borrow)] 35 pub result: std::option::Option< 36 crate::network_slices::slice::get_job_status::SyncJobResult<'a>, 37 >, 38 ///Number of times the job has been retried 39 pub retry_count: i64, 40 ///When the job started executing 41 #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 pub started_at: std::option::Option<jacquard_common::types::string::Datetime>, 43 ///Current status of the job 44 #[serde(borrow)] 45 pub status: jacquard_common::CowStr<'a>, 46} 47 48#[derive( 49 serde::Serialize, 50 serde::Deserialize, 51 Debug, 52 Clone, 53 PartialEq, 54 Eq, 55 bon::Builder, 56 jacquard_derive::IntoStatic 57)] 58#[builder(start_fn = new)] 59#[serde(rename_all = "camelCase")] 60pub struct GetJobStatus<'a> { 61 #[serde(borrow)] 62 #[builder(into)] 63 pub job_id: jacquard_common::CowStr<'a>, 64} 65 66#[jacquard_derive::lexicon] 67#[derive( 68 serde::Serialize, 69 serde::Deserialize, 70 Debug, 71 Clone, 72 PartialEq, 73 Eq, 74 jacquard_derive::IntoStatic 75)] 76#[serde(rename_all = "camelCase")] 77pub struct GetJobStatusOutput<'a> { 78 #[serde(flatten)] 79 #[serde(borrow)] 80 pub value: jacquard_common::types::value::Data<'a>, 81} 82 83///Response type for 84///network.slices.slice.getJobStatus 85pub struct GetJobStatusResponse; 86impl jacquard_common::xrpc::XrpcResp for GetJobStatusResponse { 87 const NSID: &'static str = "network.slices.slice.getJobStatus"; 88 const ENCODING: &'static str = "application/json"; 89 type Output<'de> = GetJobStatusOutput<'de>; 90 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 91} 92 93impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for GetJobStatus<'de> { 94 const NSID: &'static str = "network.slices.slice.getJobStatus"; 95 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 96 type Response = GetJobStatusResponse; 97} 98 99///Endpoint type for 100///network.slices.slice.getJobStatus 101pub struct GetJobStatusRequest; 102impl jacquard_common::xrpc::XrpcEndpoint for GetJobStatusRequest { 103 const PATH: &'static str = "/xrpc/network.slices.slice.getJobStatus"; 104 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 105 type Request<'de> = GetJobStatus<'de>; 106 type Response = GetJobStatusResponse; 107} 108 109#[jacquard_derive::lexicon] 110#[derive( 111 serde::Serialize, 112 serde::Deserialize, 113 Debug, 114 Clone, 115 PartialEq, 116 Eq, 117 jacquard_derive::IntoStatic 118)] 119#[serde(rename_all = "camelCase")] 120pub struct SyncJobResult<'a> { 121 ///List of collection NSIDs that were synced 122 #[serde(borrow)] 123 pub collections_synced: Vec<jacquard_common::types::string::Nsid<'a>>, 124 ///Human-readable message about the job completion 125 #[serde(borrow)] 126 pub message: jacquard_common::CowStr<'a>, 127 ///Number of repositories processed 128 pub repos_processed: i64, 129 ///Whether the sync job completed successfully 130 pub success: bool, 131 ///Total number of records synced 132 pub total_records: i64, 133}