resources
ModuleThe resource kinds, by area, and their array forms.
Contents
13 submodules.
resources::auth
Own pageUsers, teams, memberships, password hashes and project auth settings.
use utopia_migration::resources::auth::AuthMethods;pub struct AuthMethodsThe project's enabled auth methods.
Default.use utopia_migration::resources::auth::Hash;pub struct HashA password hash and the parameters of its algorithm.
use utopia_migration::resources::auth::Membership;pub struct MembershipA user's membership of a team.
use utopia_migration::resources::auth::OAuth2Provider;pub struct OAuth2ProviderAn OAuth2 provider's configuration (never its secret).
use utopia_migration::resources::auth::Policies;pub struct PoliciesThe project's auth policies.
Default.use utopia_migration::resources::auth::ProviderField;pub struct ProviderFieldHow one OAuth2 provider setting maps onto the destination: into the
app id, or into the JSON secret under key (the setting's own name when
None).
use utopia_migration::resources::auth::Team;pub struct TeamA team.
use utopia_migration::resources::auth::User;pub struct UserA user.
Default.use utopia_migration::resources::auth::oauth2_descriptor;pub fn oauth2_descriptor(provider: &str) -> Option<&'static [ProviderField]>The settings descriptor of a provider.
pub const OAUTH2_PROVIDERS: &[(&str, &[ProviderField])] = &[ ("amazon", CLIENT), ("apple", &[app("serviceId"), secret("keyId", Some("keyID")), secret("teamId", Some("teamID"))]), ("appwrite", CLIENT), ("auth0", &[app("clientId"), secret("endpoint", None)]), ("authentik", &[app("clientId"), secret("endpoint", None)]), ("autodesk", CLIENT), ("bitbucket", CLIENT), ("bitly", CLIENT), ("box", CLIENT), ("cloudflare", CLIENT), ("dailymotion", CLIENT), ("discord", CLIENT), ("disqus", CLIENT), ("dropbox", CLIENT), ("etsy", CLIENT), ("facebook", CLIENT), ("figma", CLIENT), ("fusionauth", &[app("clientId"), secret("endpoint", None)]), ("github", CLIENT), ("gitlab", &[app("clientId"), secret("endpoint", None)]), ("google", &[app("clientId"), secret("prompt", None)]), ("huggingface", CLIENT), ("kakao", CLIENT), ("keycloak", &[app("clientId"), secret("endpoint", Some("keycloakDomain")), secret("realmName", Some("keycloakRealm"))]), ("kick", CLIENT), ("linkedin", CLIENT),The OAuth2 providers a migration carries, and the settings each copies.
resources::backups
Own pageBackup policies.
use utopia_migration::resources::backups::Policy;pub struct PolicyA backup policy.
Default.resources::database
Own pageDatabases, tables, columns, indexes and rows.
use utopia_migration::resources::database::Database;pub struct DatabaseA database.
use utopia_migration::resources::database::Field;pub struct FieldA column (or attribute) of a table.
use utopia_migration::resources::database::FieldSpec;pub struct FieldSpecArguments common to every column constructor.
use utopia_migration::resources::database::Index;pub struct IndexAn index of a table.
use utopia_migration::resources::database::Row;pub struct RowA row of a table (or a document of a collection).
use utopia_migration::resources::database::Table;pub struct TableA table, or a collection of a DocumentsDB or VectorsDB database.
use utopia_migration::resources::database::DatabaseFlavor;pub enum DatabaseFlavorWhich database class a database resource is.
use utopia_migration::resources::database::FieldClass;pub enum FieldClassThe class of a column (or an attribute derived from one).
use utopia_migration::resources::database::resolve;pub fn resolve(definition: &Array) -> (String, String, i64)A column definition resolved to the type, format and size Appwrite stores: a format shorthand becomes a string of that format, a missing size comes from the type or the format.
pub const LENGTH_KEY: i64 = 255Undocumented.
resources::database::column
Own pagepub const BIG_INT: &str = "bigint"A big integer.
pub const BOOLEAN: &str = "boolean"A boolean.
pub const DATETIME: &str = "datetime"A datetime.
pub const DEFAULT_VARCHAR_SIZE: i64 = 255The size of a varchar given none (Column::DEFAULT_VARCHAR_SIZE).
pub const EMAIL: &str = "email"An email string.
pub const ENUM: &str = "enum"An enum string.
pub const FLOAT: &str = "double"A float.
pub const FORMAT_SIZES: &[(&str, i64)] = &[(EMAIL, 254), (ENUM, super::LENGTH_KEY), (IP, 39), (URL, 2000)]Format shorthands and their sizes (Column::FORMAT_SIZES).
pub const INTEGER: &str = "integer"An integer.
pub const IP: &str = "ip"An IP string.
pub const LINE: &str = "linestring"A line.
pub const LONGTEXT: &str = "longtext"A LONGTEXT string.
pub const MEDIUMTEXT: &str = "mediumtext"A MEDIUMTEXT string.
pub const OBJECT: &str = "object"An object.
pub const POINT: &str = "point"A point.
pub const POLYGON: &str = "polygon"A polygon.
pub const RELATIONSHIP: &str = "relationship"A relationship.
pub const SIZES: &[(&str, i64)] = &[(TEXT, 65535), (MEDIUMTEXT, 16_777_215), (LONGTEXT, 2_147_483_647)]Sizes fixed by the type (Column::SIZES).
pub const STRING: &str = "string"A string.
pub const TEXT: &str = "text"A TEXT string.
pub const URL: &str = "url"A URL string.
pub const VARCHAR: &str = "varchar"A VARCHAR string.
pub const VECTOR: &str = "vector"A vector.
resources::database::columns
Own pageBuilders of each column class with its constructor's defaults.
use utopia_migration::resources::database::columns::boolean;pub fn boolean(key: &str, table: ResourceRef, required: bool, default: Option<bool>, array: bool) -> FieldA Boolean column.
use utopia_migration::resources::database::columns::datetime;pub fn datetime(key: &str, table: ResourceRef, required: bool, default: Option<String>, array: bool) -> FieldA DateTime column (with the datetime filter).
use utopia_migration::resources::database::columns::decimal;pub fn decimal(key: &str, table: ResourceRef, required: bool, default: Option<f64>, array: bool, min: Option<f64>, max: Option<f64>, signed: bool) -> FieldUndocumented.
use utopia_migration::resources::database::columns::default_size;pub fn default_size(class: FieldClass) -> i64The default size of a string class (Text: LENGTH_KEY, Email: 254, ...).
use utopia_migration::resources::database::columns::enumeration;pub fn enumeration(key: &str, table: ResourceRef, elements: Array, required: bool, default: Option<String>, array: bool, size: i64) -> FieldAn Enum column.
use utopia_migration::resources::database::columns::from_array;pub fn from_array(class: FieldClass, array: &Array) -> Result<ResourceRef>Of column class class. Email, IP
and URL inherit Text::fromArray(), which builds a Text (it calls
new self), so they return Text columns.
use utopia_migration::resources::database::columns::integer;pub fn integer(big: bool, key: &str, table: ResourceRef, required: bool, default: Option<i64>, array: bool, min: Option<i64>, max: Option<i64>, signed: bool) -> FieldAn Integer (big: false) or BigInt column.
use utopia_migration::resources::database::columns::relationship;pub fn relationship(key: &str, table: ResourceRef, related_table: &str, relation_type: &str, two_way: bool, two_way_key: Option<String>, on_delete: &str, side: &str) -> FieldA Relationship column.
use utopia_migration::resources::database::columns::structured;pub fn structured(class: FieldClass, key: &str, table: ResourceRef, required: bool, default: Option<Array>) -> FieldA Point, Line, Polygon or ObjectType column.
use utopia_migration::resources::database::columns::text;pub fn text(class: FieldClass, key: &str, table: ResourceRef, required: bool, default: Option<String>, array: bool, size: i64, format: &str) -> FieldA string column of class class (Text, Email, IP, URL, RegularText,
MediumText, LongText, Varchar, Enum without elements).
use utopia_migration::resources::database::columns::vector;pub fn vector(key: &str, table: ResourceRef, required: bool, size: i64, default: Option<Array>) -> FieldA Vector column.
resources::domains
Own pageDomain rules.
use utopia_migration::resources::domains::Rule;pub struct RuleA proxy rule routing a domain to the API, a deployment or a redirect.
resources::functions
Own pageFunctions, their variables and deployments.
use utopia_migration::resources::functions::Deployment;pub struct DeploymentA function deployment, transferred in chunks.
use utopia_migration::resources::functions::EnvVar;pub struct EnvVarA function variable.
use utopia_migration::resources::functions::Func;pub struct FuncA function.
Default.resources::integrations
Own pagePlatforms and API keys.
use utopia_migration::resources::integrations::ApiKey;pub struct ApiKeyAn API key (never its secret).
use utopia_migration::resources::integrations::Platform;pub struct PlatformA client platform (web, Android, Apple, ...).
resources::messaging
Own pageMessaging providers, topics, subscribers and messages.
use utopia_migration::resources::messaging::Message;pub struct MessageA message (email, SMS or push).
use utopia_migration::resources::messaging::Provider;pub struct ProviderA messaging provider.
Default.use utopia_migration::resources::messaging::Subscriber;pub struct SubscriberA topic subscriber.
use utopia_migration::resources::messaging::Topic;pub struct TopicA messaging topic.
resources::settings
Own pageProject settings: variables, protocols, labels, services, SMTP and webhooks.
use utopia_migration::resources::settings::Labels;pub struct LabelsThe project's labels.
use utopia_migration::resources::settings::ProjectVariable;pub struct ProjectVariableA project variable.
use utopia_migration::resources::settings::Protocols;pub struct ProtocolsThe project's API protocols.
Default.use utopia_migration::resources::settings::Services;pub struct ServicesThe project's enabled services.
use utopia_migration::resources::settings::Smtp;pub struct SmtpThe project's SMTP settings (never the password).
use utopia_migration::resources::settings::Webhook;pub struct WebhookA webhook.
Default.resources::sites
Own pageSites, their variables and deployments.
use utopia_migration::resources::sites::Site;pub struct SiteA site.
Default.use utopia_migration::resources::sites::SiteDeployment;pub struct SiteDeploymentA site deployment, transferred in chunks.
use utopia_migration::resources::sites::SiteEnvVar;pub struct SiteEnvVarA site variable.
resources::storage
Own pageBuckets and files.
use utopia_migration::resources::storage::Bucket;pub struct BucketA storage bucket.
Default.use utopia_migration::resources::storage::File;pub struct FileA file, transferred in chunks.
resources::templates
Own pageEmail templates.
use utopia_migration::resources::templates::EmailTemplate;pub struct EmailTemplateA customised project email template for one locale.