#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::AtUri;
use jacquard_common::types::value::Data;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
use jacquard_derive::IntoStatic;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct RemoveSecret<S: BosStr = DefaultStr> {
pub key: S,
pub repo: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub struct RemoveSecretResponse;
impl jacquard_common::xrpc::XrpcResp for RemoveSecretResponse {
const NSID: &'static str = "sh.tangled.repo.removeSecret";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = ();
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for RemoveSecret<S> {
const NSID: &'static str = "sh.tangled.repo.removeSecret";
const METHOD: jacquard_common::xrpc::XrpcMethod =
jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
type Response = RemoveSecretResponse;
}
pub struct RemoveSecretRequest;
impl jacquard_common::xrpc::XrpcEndpoint for RemoveSecretRequest {
const PATH: &'static str = "/xrpc/sh.tangled.repo.removeSecret";
const METHOD: jacquard_common::xrpc::XrpcMethod =
jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
type Request<S: BosStr> = RemoveSecret<S>;
type Response = RemoveSecretResponse;
}
pub mod remove_secret_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Key;
type Repo;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Key = Unset;
type Repo = Unset;
}
pub struct SetKey<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetKey<St> {}
impl<St: State> State for SetKey<St> {
type Key = Set<members::key>;
type Repo = St::Repo;
}
pub struct SetRepo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Key = St::Key;
type Repo = Set<members::repo>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct key(());
pub struct repo(());
}
}
pub struct RemoveSecretBuilder<S: BosStr, St: remove_secret_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> RemoveSecret<S> {
pub fn new() -> RemoveSecretBuilder<S, remove_secret_state::Empty> {
RemoveSecretBuilder::new()
}
}
impl<S: BosStr> RemoveSecretBuilder<S, remove_secret_state::Empty> {
pub fn new() -> Self {
RemoveSecretBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RemoveSecretBuilder<S, St>
where
St: remove_secret_state::State,
St::Key: remove_secret_state::IsUnset,
{
pub fn key(
mut self,
value: impl Into<S>,
) -> RemoveSecretBuilder<S, remove_secret_state::SetKey<St>> {
self._fields.0 = Option::Some(value.into());
RemoveSecretBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RemoveSecretBuilder<S, St>
where
St: remove_secret_state::State,
St::Repo: remove_secret_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<AtUri<S>>,
) -> RemoveSecretBuilder<S, remove_secret_state::SetRepo<St>> {
self._fields.1 = Option::Some(value.into());
RemoveSecretBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> RemoveSecretBuilder<S, St>
where
St: remove_secret_state::State,
St::Key: remove_secret_state::IsSet,
St::Repo: remove_secret_state::IsSet,
{
pub fn build(self) -> RemoveSecret<S> {
RemoveSecret {
key: self._fields.0.unwrap(),
repo: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> RemoveSecret<S> {
RemoveSecret {
key: self._fields.0.unwrap(),
repo: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}