pub mod get_launch_asset;
pub mod get_manifest;
pub mod put_hosting_url;
pub mod service;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::blob::BlobRef;
use jacquard_common::types::string::{Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_ocho::plugin;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AdaptiveIcon<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub background_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub foreground_image: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub foreground_image_blob: Option<BlobRef<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Android<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub adaptive_icon: Option<plugin::AdaptiveIcon<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub edge_to_edge_enabled: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AndroidStatusBar<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub background_color: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Asset<S: BosStr = DefaultStr> {
pub blob: BlobRef<S>,
pub hash: S,
pub r#type: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Db<S: BosStr = DefaultStr> {
pub id: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Developer<S: BosStr = DefaultStr> {
pub tool: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ExpoClient<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub android: Option<plugin::Android<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub android_status_bar: Option<plugin::AndroidStatusBar<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expirements: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub extra: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ios: Option<plugin::Ios<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub locales: Option<Data<S>>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub new_arch_enabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub orientation: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub platforms: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub plugins: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub scheme: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sdk_version: Option<S>,
pub slug: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub user_interface_style: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub web: Option<plugin::Web<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ExpoGo<S: BosStr = DefaultStr> {
pub developer: plugin::Developer<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Ios<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub supports_tablet: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LaunchAsset<S: BosStr = DefaultStr> {
pub content_type: S,
pub key: S,
pub url: UriValue<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Manifest<S: BosStr = DefaultStr> {
pub created_at: Datetime,
pub extra: plugin::ManifestExtra<S>,
pub id: S,
pub launch_asset: plugin::LaunchAsset<S>,
pub metadata: Data<S>,
pub runtime_version: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ManifestExtra<S: BosStr = DefaultStr> {
pub expo_client: plugin::ExpoClient<S>,
pub expo_go: plugin::ExpoGo<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PluginItem<S: BosStr = DefaultStr> {
#[serde(rename = "app.ocho.plugin.defs#stringId")]
StringId(Box<plugin::StringId<S>>),
#[serde(rename = "app.ocho.plugin.defs#pluginConfig")]
PluginConfig(Box<plugin::PluginConfig<S>>),
}
pub type Plugin<S = DefaultStr> = Vec<PluginItem<S>>;
pub type PluginConfig<S = DefaultStr> = Data<S>;
pub type StringId<S = DefaultStr> = S;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Web<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub bundler: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub favicon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub favicon_blob: Option<BlobRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for AdaptiveIcon<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"adaptiveIcon"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Android<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"android"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AndroidStatusBar<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"androidStatusBar"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Asset<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"asset"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Db<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"db"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Developer<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"developer"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ExpoClient<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"expoClient"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ExpoGo<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"expoGo"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Ios<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"ios"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LaunchAsset<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"launchAsset"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Manifest<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"manifest"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ManifestExtra<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"manifestExtra"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Web<S> {
fn nsid() -> &'static str {
"app.ocho.plugin.defs"
}
fn def_name() -> &'static str {
"web"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_ocho_plugin_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_app_ocho_plugin_defs() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.ocho.plugin.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("adaptiveIcon"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("backgroundColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The background color of the adaptive icon.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("foregroundImage"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The URL to the foreground image of the adaptive icon.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("foregroundImageBlob"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("android"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("adaptiveIcon"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#adaptiveIcon"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("edgeToEdgeEnabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("androidStatusBar"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Android status bar configuration."),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("backgroundColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The background color of the Android status bar.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("asset"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("hash"), SmolStr::new_static("blob"),
SmolStr::new_static("type")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blob"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("hash"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The hash of the asset"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The type of the asset"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time when this asset was last updated. Used to reset the jetstream cache, among other things.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("db"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("id")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The ID of the database."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("developer"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("tool")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("tool"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The tool used for development, e.g., 'expo-cli'.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expoClient"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("name"), SmolStr::new_static("slug")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("android"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#android"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("androidStatusBar"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#androidStatusBar"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expirements"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("extra"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("icon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URL to the app icon."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ios"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#ios"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("locales"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The name of the Expo client application.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("newArchEnabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("orientation"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The default orientation of the app."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platforms"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("The platforms supported by the app."),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("plugins"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scheme"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The custom URI scheme for deep linking.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sdkVersion"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The SDK version of the Expo client."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("slug"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("A URL-friendly identifier for the app."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("userInterfaceStyle"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The default user interface style."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("version"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The version of the app."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("web"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#web"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expoGo"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("developer")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("developer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#developer"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ios"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("supportsTablet"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("launchAsset"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("key"),
SmolStr::new_static("contentType"),
SmolStr::new_static("url")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("contentType"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The MIME type of the asset, e.g., 'image/png'.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("key"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unique key for this asset, used to reference it in the plugin.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("url"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The URL where the asset can be accessed.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("manifest"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("createdAt"),
SmolStr::new_static("runtimeVersion"),
SmolStr::new_static("launchAsset"),
SmolStr::new_static("metadata"), SmolStr::new_static("extra")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time when this plugin manifest was created.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("extra"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.ocho.plugin.defs#manifestExtra",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unique identifier for this plugin manifest.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("launchAsset"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.ocho.plugin.defs#launchAsset",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("metadata"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("runtimeVersion"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The version of the Expo runtime this plugin is compatible with.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("manifestExtra"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("expoClient"),
SmolStr::new_static("expoGo")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("expoClient"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#expoClient"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expoGo"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#expoGo"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("plugin"),
LexUserType::Array(LexArray {
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#stringId"),
CowStr::new_static("#pluginConfig")
],
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pluginConfig"),
LexUserType::Unknown(LexUnknown { ..Default::default() }),
);
map.insert(
SmolStr::new_static("stringId"),
LexUserType::String(LexString {
description: Some(
CowStr::new_static(
"A string identifier for a plugin, used to reference it in the app.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("web"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("bundler"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The bundler used for the web app."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("favicon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The URL to the favicon for the web app.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("faviconBlob"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("output"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The output directory for the web app."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod asset_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 Type;
type Hash;
type Blob;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Type = Unset;
type Hash = Unset;
type Blob = Unset;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Type = Set<members::r#type>;
type Hash = St::Hash;
type Blob = St::Blob;
}
pub struct SetHash<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHash<St> {}
impl<St: State> State for SetHash<St> {
type Type = St::Type;
type Hash = Set<members::hash>;
type Blob = St::Blob;
}
pub struct SetBlob<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBlob<St> {}
impl<St: State> State for SetBlob<St> {
type Type = St::Type;
type Hash = St::Hash;
type Blob = Set<members::blob>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#type(());
pub struct hash(());
pub struct blob(());
}
}
pub struct AssetBuilder<S: BosStr, St: asset_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<BlobRef<S>>, Option<S>, Option<S>, Option<Datetime>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Asset<S> {
pub fn new() -> AssetBuilder<S, asset_state::Empty> {
AssetBuilder::new()
}
}
impl<S: BosStr> AssetBuilder<S, asset_state::Empty> {
pub fn new() -> Self {
AssetBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AssetBuilder<S, St>
where
St: asset_state::State,
St::Blob: asset_state::IsUnset,
{
pub fn blob(
mut self,
value: impl Into<BlobRef<S>>,
) -> AssetBuilder<S, asset_state::SetBlob<St>> {
self._fields.0 = Option::Some(value.into());
AssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AssetBuilder<S, St>
where
St: asset_state::State,
St::Hash: asset_state::IsUnset,
{
pub fn hash(
mut self,
value: impl Into<S>,
) -> AssetBuilder<S, asset_state::SetHash<St>> {
self._fields.1 = Option::Some(value.into());
AssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AssetBuilder<S, St>
where
St: asset_state::State,
St::Type: asset_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> AssetBuilder<S, asset_state::SetType<St>> {
self._fields.2 = Option::Some(value.into());
AssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: asset_state::State> AssetBuilder<S, St> {
pub fn updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_updated_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> AssetBuilder<S, St>
where
St: asset_state::State,
St::Type: asset_state::IsSet,
St::Hash: asset_state::IsSet,
St::Blob: asset_state::IsSet,
{
pub fn build(self) -> Asset<S> {
Asset {
blob: self._fields.0.unwrap(),
hash: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
updated_at: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Asset<S> {
Asset {
blob: self._fields.0.unwrap(),
hash: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
updated_at: self._fields.3,
extra_data: Some(extra_data),
}
}
}
pub mod expo_go_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 Developer;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Developer = Unset;
}
pub struct SetDeveloper<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDeveloper<St> {}
impl<St: State> State for SetDeveloper<St> {
type Developer = Set<members::developer>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct developer(());
}
}
pub struct ExpoGoBuilder<S: BosStr, St: expo_go_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<plugin::Developer<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ExpoGo<S> {
pub fn new() -> ExpoGoBuilder<S, expo_go_state::Empty> {
ExpoGoBuilder::new()
}
}
impl<S: BosStr> ExpoGoBuilder<S, expo_go_state::Empty> {
pub fn new() -> Self {
ExpoGoBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ExpoGoBuilder<S, St>
where
St: expo_go_state::State,
St::Developer: expo_go_state::IsUnset,
{
pub fn developer(
mut self,
value: impl Into<plugin::Developer<S>>,
) -> ExpoGoBuilder<S, expo_go_state::SetDeveloper<St>> {
self._fields.0 = Option::Some(value.into());
ExpoGoBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ExpoGoBuilder<S, St>
where
St: expo_go_state::State,
St::Developer: expo_go_state::IsSet,
{
pub fn build(self) -> ExpoGo<S> {
ExpoGo {
developer: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ExpoGo<S> {
ExpoGo {
developer: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod launch_asset_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 ContentType;
type Url;
type Key;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ContentType = Unset;
type Url = Unset;
type Key = Unset;
}
pub struct SetContentType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetContentType<St> {}
impl<St: State> State for SetContentType<St> {
type ContentType = Set<members::content_type>;
type Url = St::Url;
type Key = St::Key;
}
pub struct SetUrl<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUrl<St> {}
impl<St: State> State for SetUrl<St> {
type ContentType = St::ContentType;
type Url = Set<members::url>;
type Key = St::Key;
}
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 ContentType = St::ContentType;
type Url = St::Url;
type Key = Set<members::key>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct content_type(());
pub struct url(());
pub struct key(());
}
}
pub struct LaunchAssetBuilder<S: BosStr, St: launch_asset_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<UriValue<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> LaunchAsset<S> {
pub fn new() -> LaunchAssetBuilder<S, launch_asset_state::Empty> {
LaunchAssetBuilder::new()
}
}
impl<S: BosStr> LaunchAssetBuilder<S, launch_asset_state::Empty> {
pub fn new() -> Self {
LaunchAssetBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LaunchAssetBuilder<S, St>
where
St: launch_asset_state::State,
St::ContentType: launch_asset_state::IsUnset,
{
pub fn content_type(
mut self,
value: impl Into<S>,
) -> LaunchAssetBuilder<S, launch_asset_state::SetContentType<St>> {
self._fields.0 = Option::Some(value.into());
LaunchAssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LaunchAssetBuilder<S, St>
where
St: launch_asset_state::State,
St::Key: launch_asset_state::IsUnset,
{
pub fn key(
mut self,
value: impl Into<S>,
) -> LaunchAssetBuilder<S, launch_asset_state::SetKey<St>> {
self._fields.1 = Option::Some(value.into());
LaunchAssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LaunchAssetBuilder<S, St>
where
St: launch_asset_state::State,
St::Url: launch_asset_state::IsUnset,
{
pub fn url(
mut self,
value: impl Into<UriValue<S>>,
) -> LaunchAssetBuilder<S, launch_asset_state::SetUrl<St>> {
self._fields.2 = Option::Some(value.into());
LaunchAssetBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LaunchAssetBuilder<S, St>
where
St: launch_asset_state::State,
St::ContentType: launch_asset_state::IsSet,
St::Url: launch_asset_state::IsSet,
St::Key: launch_asset_state::IsSet,
{
pub fn build(self) -> LaunchAsset<S> {
LaunchAsset {
content_type: self._fields.0.unwrap(),
key: self._fields.1.unwrap(),
url: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> LaunchAsset<S> {
LaunchAsset {
content_type: self._fields.0.unwrap(),
key: self._fields.1.unwrap(),
url: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod manifest_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 Metadata;
type Extra;
type CreatedAt;
type Id;
type LaunchAsset;
type RuntimeVersion;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Metadata = Unset;
type Extra = Unset;
type CreatedAt = Unset;
type Id = Unset;
type LaunchAsset = Unset;
type RuntimeVersion = Unset;
}
pub struct SetMetadata<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMetadata<St> {}
impl<St: State> State for SetMetadata<St> {
type Metadata = Set<members::metadata>;
type Extra = St::Extra;
type CreatedAt = St::CreatedAt;
type Id = St::Id;
type LaunchAsset = St::LaunchAsset;
type RuntimeVersion = St::RuntimeVersion;
}
pub struct SetExtra<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetExtra<St> {}
impl<St: State> State for SetExtra<St> {
type Metadata = St::Metadata;
type Extra = Set<members::extra>;
type CreatedAt = St::CreatedAt;
type Id = St::Id;
type LaunchAsset = St::LaunchAsset;
type RuntimeVersion = St::RuntimeVersion;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Metadata = St::Metadata;
type Extra = St::Extra;
type CreatedAt = Set<members::created_at>;
type Id = St::Id;
type LaunchAsset = St::LaunchAsset;
type RuntimeVersion = St::RuntimeVersion;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Metadata = St::Metadata;
type Extra = St::Extra;
type CreatedAt = St::CreatedAt;
type Id = Set<members::id>;
type LaunchAsset = St::LaunchAsset;
type RuntimeVersion = St::RuntimeVersion;
}
pub struct SetLaunchAsset<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLaunchAsset<St> {}
impl<St: State> State for SetLaunchAsset<St> {
type Metadata = St::Metadata;
type Extra = St::Extra;
type CreatedAt = St::CreatedAt;
type Id = St::Id;
type LaunchAsset = Set<members::launch_asset>;
type RuntimeVersion = St::RuntimeVersion;
}
pub struct SetRuntimeVersion<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRuntimeVersion<St> {}
impl<St: State> State for SetRuntimeVersion<St> {
type Metadata = St::Metadata;
type Extra = St::Extra;
type CreatedAt = St::CreatedAt;
type Id = St::Id;
type LaunchAsset = St::LaunchAsset;
type RuntimeVersion = Set<members::runtime_version>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct metadata(());
pub struct extra(());
pub struct created_at(());
pub struct id(());
pub struct launch_asset(());
pub struct runtime_version(());
}
}
pub struct ManifestBuilder<S: BosStr, St: manifest_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<plugin::ManifestExtra<S>>,
Option<S>,
Option<plugin::LaunchAsset<S>>,
Option<Data<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Manifest<S> {
pub fn new() -> ManifestBuilder<S, manifest_state::Empty> {
ManifestBuilder::new()
}
}
impl<S: BosStr> ManifestBuilder<S, manifest_state::Empty> {
pub fn new() -> Self {
ManifestBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::CreatedAt: manifest_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ManifestBuilder<S, manifest_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::Extra: manifest_state::IsUnset,
{
pub fn extra(
mut self,
value: impl Into<plugin::ManifestExtra<S>>,
) -> ManifestBuilder<S, manifest_state::SetExtra<St>> {
self._fields.1 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::Id: manifest_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> ManifestBuilder<S, manifest_state::SetId<St>> {
self._fields.2 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::LaunchAsset: manifest_state::IsUnset,
{
pub fn launch_asset(
mut self,
value: impl Into<plugin::LaunchAsset<S>>,
) -> ManifestBuilder<S, manifest_state::SetLaunchAsset<St>> {
self._fields.3 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::Metadata: manifest_state::IsUnset,
{
pub fn metadata(
mut self,
value: impl Into<Data<S>>,
) -> ManifestBuilder<S, manifest_state::SetMetadata<St>> {
self._fields.4 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::RuntimeVersion: manifest_state::IsUnset,
{
pub fn runtime_version(
mut self,
value: impl Into<S>,
) -> ManifestBuilder<S, manifest_state::SetRuntimeVersion<St>> {
self._fields.5 = Option::Some(value.into());
ManifestBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestBuilder<S, St>
where
St: manifest_state::State,
St::Metadata: manifest_state::IsSet,
St::Extra: manifest_state::IsSet,
St::CreatedAt: manifest_state::IsSet,
St::Id: manifest_state::IsSet,
St::LaunchAsset: manifest_state::IsSet,
St::RuntimeVersion: manifest_state::IsSet,
{
pub fn build(self) -> Manifest<S> {
Manifest {
created_at: self._fields.0.unwrap(),
extra: self._fields.1.unwrap(),
id: self._fields.2.unwrap(),
launch_asset: self._fields.3.unwrap(),
metadata: self._fields.4.unwrap(),
runtime_version: self._fields.5.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Manifest<S> {
Manifest {
created_at: self._fields.0.unwrap(),
extra: self._fields.1.unwrap(),
id: self._fields.2.unwrap(),
launch_asset: self._fields.3.unwrap(),
metadata: self._fields.4.unwrap(),
runtime_version: self._fields.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod manifest_extra_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 ExpoClient;
type ExpoGo;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ExpoClient = Unset;
type ExpoGo = Unset;
}
pub struct SetExpoClient<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetExpoClient<St> {}
impl<St: State> State for SetExpoClient<St> {
type ExpoClient = Set<members::expo_client>;
type ExpoGo = St::ExpoGo;
}
pub struct SetExpoGo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetExpoGo<St> {}
impl<St: State> State for SetExpoGo<St> {
type ExpoClient = St::ExpoClient;
type ExpoGo = Set<members::expo_go>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct expo_client(());
pub struct expo_go(());
}
}
pub struct ManifestExtraBuilder<S: BosStr, St: manifest_extra_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<plugin::ExpoClient<S>>, Option<plugin::ExpoGo<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ManifestExtra<S> {
pub fn new() -> ManifestExtraBuilder<S, manifest_extra_state::Empty> {
ManifestExtraBuilder::new()
}
}
impl<S: BosStr> ManifestExtraBuilder<S, manifest_extra_state::Empty> {
pub fn new() -> Self {
ManifestExtraBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestExtraBuilder<S, St>
where
St: manifest_extra_state::State,
St::ExpoClient: manifest_extra_state::IsUnset,
{
pub fn expo_client(
mut self,
value: impl Into<plugin::ExpoClient<S>>,
) -> ManifestExtraBuilder<S, manifest_extra_state::SetExpoClient<St>> {
self._fields.0 = Option::Some(value.into());
ManifestExtraBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestExtraBuilder<S, St>
where
St: manifest_extra_state::State,
St::ExpoGo: manifest_extra_state::IsUnset,
{
pub fn expo_go(
mut self,
value: impl Into<plugin::ExpoGo<S>>,
) -> ManifestExtraBuilder<S, manifest_extra_state::SetExpoGo<St>> {
self._fields.1 = Option::Some(value.into());
ManifestExtraBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ManifestExtraBuilder<S, St>
where
St: manifest_extra_state::State,
St::ExpoClient: manifest_extra_state::IsSet,
St::ExpoGo: manifest_extra_state::IsSet,
{
pub fn build(self) -> ManifestExtra<S> {
ManifestExtra {
expo_client: self._fields.0.unwrap(),
expo_go: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ManifestExtra<S> {
ManifestExtra {
expo_client: self._fields.0.unwrap(),
expo_go: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}