Rust

resources

Module

The resource kinds, by area, and their array forms.

Contents

13 submodules.

resources::auth

Own page

Users, teams, memberships, password hashes and project auth settings.

use utopia_migration::resources::auth::AuthMethods;
Rust
pub struct AuthMethods

The project's enabled auth methods.

Also implements Default.
use utopia_migration::resources::auth::Hash;
Rust
pub struct Hash

A password hash and the parameters of its algorithm.

use utopia_migration::resources::auth::Membership;
Rust
pub struct Membership

A user's membership of a team.

use utopia_migration::resources::auth::OAuth2Provider;
Rust
pub struct OAuth2Provider

An OAuth2 provider's configuration (never its secret).

use utopia_migration::resources::auth::Policies;
Rust
pub struct Policies

The project's auth policies.

Also implements Default.
use utopia_migration::resources::auth::ProviderField;
Rust
pub struct ProviderField

How 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;
Rust
pub struct Team

A team.

use utopia_migration::resources::auth::User;
Rust
pub struct User

A user.

Also implements Default.
use utopia_migration::resources::auth::oauth2_descriptor;
Rust
pub fn oauth2_descriptor(provider: &str) -> Option<&'static [ProviderField]>

The settings descriptor of a provider.

Rust
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 page

Backup policies.

use utopia_migration::resources::backups::Policy;
Rust
pub struct Policy

A backup policy.

Also implements Default.

resources::database

Own page

Databases, tables, columns, indexes and rows.

use utopia_migration::resources::database::Database;
Rust
pub struct Database

A database.

use utopia_migration::resources::database::Field;
Rust
pub struct Field

A column (or attribute) of a table.

use utopia_migration::resources::database::FieldSpec;
Rust
pub struct FieldSpec

Arguments common to every column constructor.

use utopia_migration::resources::database::Index;
Rust
pub struct Index

An index of a table.

use utopia_migration::resources::database::Row;
Rust
pub struct Row

A row of a table (or a document of a collection).

use utopia_migration::resources::database::Table;
Rust
pub struct Table

A table, or a collection of a DocumentsDB or VectorsDB database.

use utopia_migration::resources::database::DatabaseFlavor;
Rust
pub enum DatabaseFlavor

Which database class a database resource is.

use utopia_migration::resources::database::FieldClass;
Rust
pub enum FieldClass

The class of a column (or an attribute derived from one).

use utopia_migration::resources::database::resolve;
Rust
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.

Rust
pub const LENGTH_KEY: i64 = 255

Undocumented.

resources::database::column

Own page
Rust
pub const BIG_INT: &str = "bigint"

A big integer.

Rust
pub const BOOLEAN: &str = "boolean"

A boolean.

Rust
pub const DATETIME: &str = "datetime"

A datetime.

Rust
pub const DEFAULT_VARCHAR_SIZE: i64 = 255

The size of a varchar given none (Column::DEFAULT_VARCHAR_SIZE).

Rust
pub const EMAIL: &str = "email"

An email string.

Rust
pub const ENUM: &str = "enum"

An enum string.

Rust
pub const FLOAT: &str = "double"

A float.

Rust
pub const FORMAT_SIZES: &[(&str, i64)] = &[(EMAIL, 254), (ENUM, super::LENGTH_KEY), (IP, 39), (URL, 2000)]

Format shorthands and their sizes (Column::FORMAT_SIZES).

Rust
pub const INTEGER: &str = "integer"

An integer.

Rust
pub const IP: &str = "ip"

An IP string.

Rust
pub const LINE: &str = "linestring"

A line.

Rust
pub const LONGTEXT: &str = "longtext"

A LONGTEXT string.

Rust
pub const MEDIUMTEXT: &str = "mediumtext"

A MEDIUMTEXT string.

Rust
pub const OBJECT: &str = "object"

An object.

Rust
pub const POINT: &str = "point"

A point.

Rust
pub const POLYGON: &str = "polygon"

A polygon.

Rust
pub const RELATIONSHIP: &str = "relationship"

A relationship.

Rust
pub const SIZES: &[(&str, i64)] = &[(TEXT, 65535), (MEDIUMTEXT, 16_777_215), (LONGTEXT, 2_147_483_647)]

Sizes fixed by the type (Column::SIZES).

Rust
pub const STRING: &str = "string"

A string.

Rust
pub const TEXT: &str = "text"

A TEXT string.

Rust
pub const URL: &str = "url"

A URL string.

Rust
pub const VARCHAR: &str = "varchar"

A VARCHAR string.

Rust
pub const VECTOR: &str = "vector"

A vector.

resources::database::columns

Own page

Builders of each column class with its constructor's defaults.

use utopia_migration::resources::database::columns::boolean;
Rust
pub fn boolean(key: &str, table: ResourceRef, required: bool, default: Option<bool>, array: bool) -> Field

A Boolean column.

use utopia_migration::resources::database::columns::datetime;
Rust
pub fn datetime(key: &str, table: ResourceRef, required: bool, default: Option<String>, array: bool) -> Field

A DateTime column (with the datetime filter).

use utopia_migration::resources::database::columns::decimal;
Rust
pub fn decimal(key: &str, table: ResourceRef, required: bool, default: Option<f64>, array: bool, min: Option<f64>, max: Option<f64>, signed: bool) -> Field

Undocumented.

use utopia_migration::resources::database::columns::default_size;
Rust
pub fn default_size(class: FieldClass) -> i64

The default size of a string class (Text: LENGTH_KEY, Email: 254, ...).

use utopia_migration::resources::database::columns::enumeration;
Rust
pub fn enumeration(key: &str, table: ResourceRef, elements: Array, required: bool, default: Option<String>, array: bool, size: i64) -> Field

An Enum column.

use utopia_migration::resources::database::columns::from_array;
Rust
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;
Rust
pub fn integer(big: bool, key: &str, table: ResourceRef, required: bool, default: Option<i64>, array: bool, min: Option<i64>, max: Option<i64>, signed: bool) -> Field

An Integer (big: false) or BigInt column.

use utopia_migration::resources::database::columns::relationship;
Rust
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) -> Field

A Relationship column.

use utopia_migration::resources::database::columns::structured;
Rust
pub fn structured(class: FieldClass, key: &str, table: ResourceRef, required: bool, default: Option<Array>) -> Field

A Point, Line, Polygon or ObjectType column.

use utopia_migration::resources::database::columns::text;
Rust
pub fn text(class: FieldClass, key: &str, table: ResourceRef, required: bool, default: Option<String>, array: bool, size: i64, format: &str) -> Field

A string column of class class (Text, Email, IP, URL, RegularText, MediumText, LongText, Varchar, Enum without elements).

use utopia_migration::resources::database::columns::vector;
Rust
pub fn vector(key: &str, table: ResourceRef, required: bool, size: i64, default: Option<Array>) -> Field

A Vector column.

resources::domains

Own page

Domain rules.

use utopia_migration::resources::domains::Rule;
Rust
pub struct Rule

A proxy rule routing a domain to the API, a deployment or a redirect.

resources::functions

Own page

Functions, their variables and deployments.

use utopia_migration::resources::functions::Deployment;
Rust
pub struct Deployment

A function deployment, transferred in chunks.

use utopia_migration::resources::functions::EnvVar;
Rust
pub struct EnvVar

A function variable.

use utopia_migration::resources::functions::Func;
Rust
pub struct Func

A function.

Also implements Default.

resources::integrations

Own page

Platforms and API keys.

use utopia_migration::resources::integrations::ApiKey;
Rust
pub struct ApiKey

An API key (never its secret).

use utopia_migration::resources::integrations::Platform;
Rust
pub struct Platform

A client platform (web, Android, Apple, ...).

resources::messaging

Own page

Messaging providers, topics, subscribers and messages.

use utopia_migration::resources::messaging::Message;
Rust
pub struct Message

A message (email, SMS or push).

use utopia_migration::resources::messaging::Provider;
Rust
pub struct Provider

A messaging provider.

Also implements Default.
use utopia_migration::resources::messaging::Subscriber;
Rust
pub struct Subscriber

A topic subscriber.

use utopia_migration::resources::messaging::Topic;
Rust
pub struct Topic

A messaging topic.

resources::settings

Own page

Project settings: variables, protocols, labels, services, SMTP and webhooks.

use utopia_migration::resources::settings::Labels;
Rust
pub struct Labels

The project's labels.

use utopia_migration::resources::settings::ProjectVariable;
Rust
pub struct ProjectVariable

A project variable.

use utopia_migration::resources::settings::Protocols;
Rust
pub struct Protocols

The project's API protocols.

Also implements Default.
use utopia_migration::resources::settings::Services;
Rust
pub struct Services

The project's enabled services.

use utopia_migration::resources::settings::Smtp;
Rust
pub struct Smtp

The project's SMTP settings (never the password).

use utopia_migration::resources::settings::Webhook;
Rust
pub struct Webhook

A webhook.

Also implements Default.

resources::sites

Own page

Sites, their variables and deployments.

use utopia_migration::resources::sites::Site;
Rust
pub struct Site

A site.

Also implements Default.
use utopia_migration::resources::sites::SiteDeployment;
Rust
pub struct SiteDeployment

A site deployment, transferred in chunks.

use utopia_migration::resources::sites::SiteEnvVar;
Rust
pub struct SiteEnvVar

A site variable.

resources::storage

Own page

Buckets and files.

use utopia_migration::resources::storage::Bucket;
Rust
pub struct Bucket

A storage bucket.

Also implements Default.
use utopia_migration::resources::storage::File;
Rust
pub struct File

A file, transferred in chunks.

resources::templates

Own page

Email templates.

use utopia_migration::resources::templates::EmailTemplate;
Rust
pub struct EmailTemplate

A customised project email template for one locale.