#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetGroup<'a> {
#[serde(borrow)]
pub id: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetGroupOutput<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cuid: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub public: Option<bool>,
}
pub struct GetGroupResponse;
impl jacquard_common::xrpc::XrpcResp for GetGroupResponse {
const NSID: &'static str = "app.blebbit.authr.group.getGroup";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetGroupOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetGroup<'a> {
const NSID: &'static str = "app.blebbit.authr.group.getGroup";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetGroupResponse;
}
pub struct GetGroupRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetGroupRequest {
const PATH: &'static str = "/xrpc/app.blebbit.authr.group.getGroup";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetGroup<'de>;
type Response = GetGroupResponse;
}
pub mod get_group_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Id = Set<members::id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
}
}
pub struct GetGroupBuilder<'a, S: get_group_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetGroup<'a> {
pub fn new() -> GetGroupBuilder<'a, get_group_state::Empty> {
GetGroupBuilder::new()
}
}
impl<'a> GetGroupBuilder<'a, get_group_state::Empty> {
pub fn new() -> Self {
GetGroupBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetGroupBuilder<'a, S>
where
S: get_group_state::State,
S::Id: get_group_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<CowStr<'a>>,
) -> GetGroupBuilder<'a, get_group_state::SetId<S>> {
self._fields.0 = Option::Some(value.into());
GetGroupBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetGroupBuilder<'a, S>
where
S: get_group_state::State,
S::Id: get_group_state::IsSet,
{
pub fn build(self) -> GetGroup<'a> {
GetGroup {
id: self._fields.0.unwrap(),
}
}
}