jacquard_api/tools_ozone/setting/
remove_options.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: tools.ozone.setting.removeOptions
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 RemoveOptions<'a> {
20    #[serde(borrow)]
21    pub keys: Vec<jacquard_common::types::string::Nsid<'a>>,
22    #[serde(borrow)]
23    pub scope: jacquard_common::CowStr<'a>,
24}
25
26pub mod remove_options_state {
27
28    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
29    #[allow(unused)]
30    use ::core::marker::PhantomData;
31    mod sealed {
32        pub trait Sealed {}
33    }
34    /// State trait tracking which required fields have been set
35    pub trait State: sealed::Sealed {
36        type Keys;
37        type Scope;
38    }
39    /// Empty state - all required fields are unset
40    pub struct Empty(());
41    impl sealed::Sealed for Empty {}
42    impl State for Empty {
43        type Keys = Unset;
44        type Scope = Unset;
45    }
46    ///State transition - sets the `keys` field to Set
47    pub struct SetKeys<S: State = Empty>(PhantomData<fn() -> S>);
48    impl<S: State> sealed::Sealed for SetKeys<S> {}
49    impl<S: State> State for SetKeys<S> {
50        type Keys = Set<members::keys>;
51        type Scope = S::Scope;
52    }
53    ///State transition - sets the `scope` field to Set
54    pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>);
55    impl<S: State> sealed::Sealed for SetScope<S> {}
56    impl<S: State> State for SetScope<S> {
57        type Keys = S::Keys;
58        type Scope = Set<members::scope>;
59    }
60    /// Marker types for field names
61    #[allow(non_camel_case_types)]
62    pub mod members {
63        ///Marker type for the `keys` field
64        pub struct keys(());
65        ///Marker type for the `scope` field
66        pub struct scope(());
67    }
68}
69
70/// Builder for constructing an instance of this type
71pub struct RemoveOptionsBuilder<'a, S: remove_options_state::State> {
72    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
73    __unsafe_private_named: (
74        ::core::option::Option<Vec<jacquard_common::types::string::Nsid<'a>>>,
75        ::core::option::Option<jacquard_common::CowStr<'a>>,
76    ),
77    _phantom: ::core::marker::PhantomData<&'a ()>,
78}
79
80impl<'a> RemoveOptions<'a> {
81    /// Create a new builder for this type
82    pub fn new() -> RemoveOptionsBuilder<'a, remove_options_state::Empty> {
83        RemoveOptionsBuilder::new()
84    }
85}
86
87impl<'a> RemoveOptionsBuilder<'a, remove_options_state::Empty> {
88    /// Create a new builder with all fields unset
89    pub fn new() -> Self {
90        RemoveOptionsBuilder {
91            _phantom_state: ::core::marker::PhantomData,
92            __unsafe_private_named: (None, None),
93            _phantom: ::core::marker::PhantomData,
94        }
95    }
96}
97
98impl<'a, S> RemoveOptionsBuilder<'a, S>
99where
100    S: remove_options_state::State,
101    S::Keys: remove_options_state::IsUnset,
102{
103    /// Set the `keys` field (required)
104    pub fn keys(
105        mut self,
106        value: impl Into<Vec<jacquard_common::types::string::Nsid<'a>>>,
107    ) -> RemoveOptionsBuilder<'a, remove_options_state::SetKeys<S>> {
108        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
109        RemoveOptionsBuilder {
110            _phantom_state: ::core::marker::PhantomData,
111            __unsafe_private_named: self.__unsafe_private_named,
112            _phantom: ::core::marker::PhantomData,
113        }
114    }
115}
116
117impl<'a, S> RemoveOptionsBuilder<'a, S>
118where
119    S: remove_options_state::State,
120    S::Scope: remove_options_state::IsUnset,
121{
122    /// Set the `scope` field (required)
123    pub fn scope(
124        mut self,
125        value: impl Into<jacquard_common::CowStr<'a>>,
126    ) -> RemoveOptionsBuilder<'a, remove_options_state::SetScope<S>> {
127        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
128        RemoveOptionsBuilder {
129            _phantom_state: ::core::marker::PhantomData,
130            __unsafe_private_named: self.__unsafe_private_named,
131            _phantom: ::core::marker::PhantomData,
132        }
133    }
134}
135
136impl<'a, S> RemoveOptionsBuilder<'a, S>
137where
138    S: remove_options_state::State,
139    S::Keys: remove_options_state::IsSet,
140    S::Scope: remove_options_state::IsSet,
141{
142    /// Build the final struct
143    pub fn build(self) -> RemoveOptions<'a> {
144        RemoveOptions {
145            keys: self.__unsafe_private_named.0.unwrap(),
146            scope: self.__unsafe_private_named.1.unwrap(),
147            extra_data: Default::default(),
148        }
149    }
150    /// Build the final struct with custom extra_data
151    pub fn build_with_data(
152        self,
153        extra_data: std::collections::BTreeMap<
154            jacquard_common::smol_str::SmolStr,
155            jacquard_common::types::value::Data<'a>,
156        >,
157    ) -> RemoveOptions<'a> {
158        RemoveOptions {
159            keys: self.__unsafe_private_named.0.unwrap(),
160            scope: self.__unsafe_private_named.1.unwrap(),
161            extra_data: Some(extra_data),
162        }
163    }
164}
165
166#[jacquard_derive::lexicon]
167#[derive(
168    serde::Serialize,
169    serde::Deserialize,
170    Debug,
171    Clone,
172    PartialEq,
173    Eq,
174    jacquard_derive::IntoStatic,
175    Default
176)]
177#[serde(rename_all = "camelCase")]
178pub struct RemoveOptionsOutput<'a> {}
179/// Response type for
180///tools.ozone.setting.removeOptions
181pub struct RemoveOptionsResponse;
182impl jacquard_common::xrpc::XrpcResp for RemoveOptionsResponse {
183    const NSID: &'static str = "tools.ozone.setting.removeOptions";
184    const ENCODING: &'static str = "application/json";
185    type Output<'de> = RemoveOptionsOutput<'de>;
186    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
187}
188
189impl<'a> jacquard_common::xrpc::XrpcRequest for RemoveOptions<'a> {
190    const NSID: &'static str = "tools.ozone.setting.removeOptions";
191    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
192        "application/json",
193    );
194    type Response = RemoveOptionsResponse;
195}
196
197/// Endpoint type for
198///tools.ozone.setting.removeOptions
199pub struct RemoveOptionsRequest;
200impl jacquard_common::xrpc::XrpcEndpoint for RemoveOptionsRequest {
201    const PATH: &'static str = "/xrpc/tools.ozone.setting.removeOptions";
202    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
203        "application/json",
204    );
205    type Request<'de> = RemoveOptions<'de>;
206    type Response = RemoveOptionsResponse;
207}