pub mod get_recipe;
pub mod get_recipes;
pub mod recipe;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct NotFoundRecipe<'a> {
pub not_found: bool,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod not_found_recipe_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 Uri;
type NotFound;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type NotFound = Unset;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
type NotFound = S::NotFound;
}
pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNotFound<S> {}
impl<S: State> State for SetNotFound<S> {
type Uri = S::Uri;
type NotFound = Set<members::not_found>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct not_found(());
}
}
pub struct NotFoundRecipeBuilder<'a, S: not_found_recipe_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<bool>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> NotFoundRecipe<'a> {
pub fn new() -> NotFoundRecipeBuilder<'a, not_found_recipe_state::Empty> {
NotFoundRecipeBuilder::new()
}
}
impl<'a> NotFoundRecipeBuilder<'a, not_found_recipe_state::Empty> {
pub fn new() -> Self {
NotFoundRecipeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> NotFoundRecipeBuilder<'a, S>
where
S: not_found_recipe_state::State,
S::NotFound: not_found_recipe_state::IsUnset,
{
pub fn not_found(
mut self,
value: impl Into<bool>,
) -> NotFoundRecipeBuilder<'a, not_found_recipe_state::SetNotFound<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
NotFoundRecipeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> NotFoundRecipeBuilder<'a, S>
where
S: not_found_recipe_state::State,
S::Uri: not_found_recipe_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> NotFoundRecipeBuilder<'a, not_found_recipe_state::SetUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
NotFoundRecipeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> NotFoundRecipeBuilder<'a, S>
where
S: not_found_recipe_state::State,
S::Uri: not_found_recipe_state::IsSet,
S::NotFound: not_found_recipe_state::IsSet,
{
pub fn build(self) -> NotFoundRecipe<'a> {
NotFoundRecipe {
not_found: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> NotFoundRecipe<'a> {
NotFoundRecipe {
not_found: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_blue_recipes_feed_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("blue.recipes.feed.defs"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("notFoundRecipe"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("notFound")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"notFound",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("recipeView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Response model for fetching multiple recipes.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"blue.recipes.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"blue.recipes.feed.recipe",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotFoundRecipe<'a> {
fn nsid() -> &'static str {
"blue.recipes.feed.defs"
}
fn def_name() -> &'static str {
"notFoundRecipe"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_blue_recipes_feed_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RecipeView<'a> {
#[serde(borrow)]
pub author: crate::blue_recipes::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub record: crate::blue_recipes::feed::recipe::Recipe<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod recipe_view_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 Author;
type IndexedAt;
type Cid;
type Record;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Author = Unset;
type IndexedAt = Unset;
type Cid = Unset;
type Record = Unset;
type Uri = Unset;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type Author = Set<members::author>;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Record = S::Record;
type Uri = S::Uri;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Author = S::Author;
type IndexedAt = Set<members::indexed_at>;
type Cid = S::Cid;
type Record = S::Record;
type Uri = S::Uri;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Author = S::Author;
type IndexedAt = S::IndexedAt;
type Cid = Set<members::cid>;
type Record = S::Record;
type Uri = S::Uri;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Author = S::Author;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Record = Set<members::record>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Author = S::Author;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Record = S::Record;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
pub struct indexed_at(());
pub struct cid(());
pub struct record(());
pub struct uri(());
}
}
pub struct RecipeViewBuilder<'a, S: recipe_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::blue_recipes::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::blue_recipes::feed::recipe::Recipe<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RecipeView<'a> {
pub fn new() -> RecipeViewBuilder<'a, recipe_view_state::Empty> {
RecipeViewBuilder::new()
}
}
impl<'a> RecipeViewBuilder<'a, recipe_view_state::Empty> {
pub fn new() -> Self {
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::Author: recipe_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::blue_recipes::actor::ProfileViewBasic<'a>>,
) -> RecipeViewBuilder<'a, recipe_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::Cid: recipe_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> RecipeViewBuilder<'a, recipe_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::IndexedAt: recipe_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> RecipeViewBuilder<'a, recipe_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::Record: recipe_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<crate::blue_recipes::feed::recipe::Recipe<'a>>,
) -> RecipeViewBuilder<'a, recipe_view_state::SetRecord<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::Uri: recipe_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> RecipeViewBuilder<'a, recipe_view_state::SetUri<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
RecipeViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecipeViewBuilder<'a, S>
where
S: recipe_view_state::State,
S::Author: recipe_view_state::IsSet,
S::IndexedAt: recipe_view_state::IsSet,
S::Cid: recipe_view_state::IsSet,
S::Record: recipe_view_state::IsSet,
S::Uri: recipe_view_state::IsSet,
{
pub fn build(self) -> RecipeView<'a> {
RecipeView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
indexed_at: self.__unsafe_private_named.2.unwrap(),
record: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> RecipeView<'a> {
RecipeView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
indexed_at: self.__unsafe_private_named.2.unwrap(),
record: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecipeView<'a> {
fn nsid() -> &'static str {
"blue.recipes.feed.defs"
}
fn def_name() -> &'static str {
"recipeView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_blue_recipes_feed_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}