Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appwrite"
version = "0.18.0"
version = "0.19.0"
edition = "2021"
rust-version = "1.83"
authors = ["appwrite"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
appwrite = "0.18.0"
appwrite = "0.19.0"
tokio = { version = "1.48", features = ["full"] }
```

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let result = account.create_email_password_session(
"email@example.com",
"password"
"password",
Some(60) // optional
).await?;

let _ = result;
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/account/create-email-verification-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_email_verification_otp(
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
27 changes: 27 additions & 0 deletions docs/examples/account/create-id-token-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_id_token_session(
appwrite::enums::IdTokenProvider::Apple,
"<ID_TOKEN>",
Some("<NONCE>"), // optional
Some("<ACCESS_TOKEN>"), // optional
Some(0), // optional
Some("<NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/create-recovery-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_recovery_otp(
"email@example.com",
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
4 changes: 3 additions & 1 deletion docs/examples/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

account.delete_sessions().await?;
account.delete_sessions(
Some(false) // optional
).await?;

Ok(())
}
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

let result = account.list_sessions().await?;
let result = account.list_sessions(
Some(false) // optional
).await?;

let _ = result;

Expand Down
23 changes: 23 additions & 0 deletions docs/examples/account/update-email-verification-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_email_verification_otp(
"<USER_ID>",
"<SECRET>"
).await?;

let _ = result;

Ok(())
}
```
24 changes: 24 additions & 0 deletions docs/examples/account/update-recovery-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_recovery_otp(
"<USER_ID>",
"<SECRET>",
"password"
).await?;

let _ = result;

Ok(())
}
```
18 changes: 18 additions & 0 deletions docs/examples/avatars/delete-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```rust
use appwrite::Client;
use appwrite::services::Avatars;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let avatars = Avatars::new(&client);

avatars.delete_photo().await?;

Ok(())
}
```
25 changes: 25 additions & 0 deletions docs/examples/avatars/update-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```rust
use appwrite::Client;
use appwrite::services::Avatars;
use appwrite::InputFile;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let avatars = Avatars::new(&client);

let file = InputFile::from_path("path/to/file.png", None).await?;

let result = avatars.update_photo(
file
).await?;

let _ = result;

Ok(())
}
```
3 changes: 2 additions & 1 deletion docs/examples/databases/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let databases = Databases::new(&client);

let result = databases.list_transactions(
Some(vec![]) // optional
Some(vec![]), // optional
Some(false) // optional
).await?;

let _ = result;
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/documentsdb/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let documents_db = DocumentsDB::new(&client);

let result = documents_db.list_transactions(
Some(vec![]) // optional
Some(vec![]), // optional
Some(false) // optional
).await?;

let _ = result;
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-google-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_google_workspace(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-i-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_i_cloud(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-mailgun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_mailgun(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-outlook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_outlook(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-proton-mail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_proton_mail(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/domains/create-preset-zoho.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Domains;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_key("<YOUR_API_KEY>"); // Your secret API key

let domains = Domains::new(&client);

let result = domains.create_preset_zoho(
"<DOMAIN_ID>"
).await?;

let _ = result;

Ok(())
}
```
Loading