atproto blogging
at main 152 lines 4.6 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.video.getJobStatus 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 jacquard_derive::IntoStatic 16)] 17#[serde(rename_all = "camelCase")] 18pub struct GetJobStatus<'a> { 19 #[serde(borrow)] 20 pub job_id: jacquard_common::CowStr<'a>, 21} 22 23pub mod get_job_status_state { 24 25 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 26 #[allow(unused)] 27 use ::core::marker::PhantomData; 28 mod sealed { 29 pub trait Sealed {} 30 } 31 /// State trait tracking which required fields have been set 32 pub trait State: sealed::Sealed { 33 type JobId; 34 } 35 /// Empty state - all required fields are unset 36 pub struct Empty(()); 37 impl sealed::Sealed for Empty {} 38 impl State for Empty { 39 type JobId = Unset; 40 } 41 ///State transition - sets the `job_id` field to Set 42 pub struct SetJobId<S: State = Empty>(PhantomData<fn() -> S>); 43 impl<S: State> sealed::Sealed for SetJobId<S> {} 44 impl<S: State> State for SetJobId<S> { 45 type JobId = Set<members::job_id>; 46 } 47 /// Marker types for field names 48 #[allow(non_camel_case_types)] 49 pub mod members { 50 ///Marker type for the `job_id` field 51 pub struct job_id(()); 52 } 53} 54 55/// Builder for constructing an instance of this type 56pub struct GetJobStatusBuilder<'a, S: get_job_status_state::State> { 57 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 __unsafe_private_named: (::core::option::Option<jacquard_common::CowStr<'a>>,), 59 _phantom: ::core::marker::PhantomData<&'a ()>, 60} 61 62impl<'a> GetJobStatus<'a> { 63 /// Create a new builder for this type 64 pub fn new() -> GetJobStatusBuilder<'a, get_job_status_state::Empty> { 65 GetJobStatusBuilder::new() 66 } 67} 68 69impl<'a> GetJobStatusBuilder<'a, get_job_status_state::Empty> { 70 /// Create a new builder with all fields unset 71 pub fn new() -> Self { 72 GetJobStatusBuilder { 73 _phantom_state: ::core::marker::PhantomData, 74 __unsafe_private_named: (None,), 75 _phantom: ::core::marker::PhantomData, 76 } 77 } 78} 79 80impl<'a, S> GetJobStatusBuilder<'a, S> 81where 82 S: get_job_status_state::State, 83 S::JobId: get_job_status_state::IsUnset, 84{ 85 /// Set the `jobId` field (required) 86 pub fn job_id( 87 mut self, 88 value: impl Into<jacquard_common::CowStr<'a>>, 89 ) -> GetJobStatusBuilder<'a, get_job_status_state::SetJobId<S>> { 90 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 91 GetJobStatusBuilder { 92 _phantom_state: ::core::marker::PhantomData, 93 __unsafe_private_named: self.__unsafe_private_named, 94 _phantom: ::core::marker::PhantomData, 95 } 96 } 97} 98 99impl<'a, S> GetJobStatusBuilder<'a, S> 100where 101 S: get_job_status_state::State, 102 S::JobId: get_job_status_state::IsSet, 103{ 104 /// Build the final struct 105 pub fn build(self) -> GetJobStatus<'a> { 106 GetJobStatus { 107 job_id: self.__unsafe_private_named.0.unwrap(), 108 } 109 } 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 GetJobStatusOutput<'a> { 124 #[serde(borrow)] 125 pub job_status: crate::app_bsky::video::JobStatus<'a>, 126} 127 128/// Response type for 129///app.bsky.video.getJobStatus 130pub struct GetJobStatusResponse; 131impl jacquard_common::xrpc::XrpcResp for GetJobStatusResponse { 132 const NSID: &'static str = "app.bsky.video.getJobStatus"; 133 const ENCODING: &'static str = "application/json"; 134 type Output<'de> = GetJobStatusOutput<'de>; 135 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 136} 137 138impl<'a> jacquard_common::xrpc::XrpcRequest for GetJobStatus<'a> { 139 const NSID: &'static str = "app.bsky.video.getJobStatus"; 140 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 141 type Response = GetJobStatusResponse; 142} 143 144/// Endpoint type for 145///app.bsky.video.getJobStatus 146pub struct GetJobStatusRequest; 147impl jacquard_common::xrpc::XrpcEndpoint for GetJobStatusRequest { 148 const PATH: &'static str = "/xrpc/app.bsky.video.getJobStatus"; 149 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 150 type Request<'de> = GetJobStatus<'de>; 151 type Response = GetJobStatusResponse; 152}