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.16.0"
version = "0.17.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.16.0"
appwrite = "0.17.0"
tokio = { version = "1.48", features = ["full"] }
```

Expand Down
20 changes: 20 additions & 0 deletions docs/examples/account/create-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```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_passkey_token().await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/create-passkey.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_passkey(
Some("<PASSKEY_ID>"), // optional
Some("<NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
20 changes: 20 additions & 0 deletions docs/examples/account/delete-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```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);

account.delete_passkey(
"<PASSKEY_ID>"
).await?;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/account/get-passkey.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.get_passkey(
"<PASSKEY_ID>"
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/list-passkeys.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.list_passkeys(
Some(vec![]), // optional
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey-token.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_passkey_token(
"<CHALLENGE_ID>",
serde_json::json!({})
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey-verification.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_passkey_verification(
"<PASSKEY_ID>",
serde_json::json!({})
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey.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_passkey(
"<PASSKEY_ID>",
"<NAME>"
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/project/update-passkey-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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 project = Project::new(&client);

let result = project.update_passkey_policy(
"<RP_ID>"
).await?;

let _ = result;

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

#[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 users = Users::new(&client);

users.delete_passkey(
"<USER_ID>",
"<PASSKEY_ID>"
).await?;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/users/get-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Users;

#[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 users = Users::new(&client);

let result = users.get_passkey(
"<USER_ID>",
"<PASSKEY_ID>"
).await?;

let _ = result;

Ok(())
}
```
24 changes: 24 additions & 0 deletions docs/examples/users/list-passkeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```rust
use appwrite::Client;
use appwrite::services::Users;

#[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 users = Users::new(&client);

let result = users.list_passkeys(
"<USER_ID>",
Some(vec![]), // optional
Some(false) // optional
).await?;

let _ = result;

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

#[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 users = Users::new(&client);

let result = users.update_passkey(
"<USER_ID>",
"<PASSKEY_ID>",
"<NAME>"
).await?;

let _ = result;

Ok(())
}
```
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Client {
headers.insert(
"user-agent",
format!(
"AppwriteRustSDK/0.16.0 ({}; {})",
"AppwriteRustSDK/0.17.0 ({}; {})",
std::env::consts::OS,
std::env::consts::ARCH
)
Expand All @@ -105,7 +105,7 @@ impl Client {
headers.insert("x-sdk-name", "Rust".parse().unwrap());
headers.insert("x-sdk-platform", "server".parse().unwrap());
headers.insert("x-sdk-language", "rust".parse().unwrap());
headers.insert("x-sdk-version", "0.16.0".parse().unwrap());
headers.insert("x-sdk-version", "0.17.0".parse().unwrap());

let config = Config {
endpoint: "https://cloud.appwrite.io/v1".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//!
//! ```toml
//! [dependencies]
//! appwrite = "0.16.0"
//! appwrite = "0.17.0"
//! ```
//!
//! ## Usage
Expand Down Expand Up @@ -51,7 +51,7 @@ pub use input_file::InputFile;
pub type Result<T> = std::result::Result<T, AppwriteError>;

/// SDK version
pub const VERSION: &str = "0.16.0";
pub const VERSION: &str = "0.17.0";

/// SDK name
pub const SDK_NAME: &str = "Rust";
Expand Down
12 changes: 12 additions & 0 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@ pub mod mfa_challenge;
pub use mfa_challenge::MfaChallenge;
pub mod mfa_challenge_secret;
pub use mfa_challenge_secret::MfaChallengeSecret;
pub mod token_secret;
pub use token_secret::TokenSecret;
pub mod passkey;
pub use passkey::Passkey;
pub mod passkey_challenge;
pub use passkey_challenge::PasskeyChallenge;
pub mod passkey_list;
pub use passkey_list::PasskeyList;
pub mod mfa_recovery_codes;
pub use mfa_recovery_codes::MfaRecoveryCodes;
pub mod mfa_type;
Expand Down Expand Up @@ -817,6 +825,10 @@ impl Model for ProxyRule {}
impl Model for EmailTemplate {}
impl Model for MfaChallenge {}
impl Model for MfaChallengeSecret {}
impl Model for TokenSecret {}
impl Model for Passkey {}
impl Model for PasskeyChallenge {}
impl Model for PasskeyList {}
impl Model for MfaRecoveryCodes {}
impl Model for MfaType {}
impl Model for MfaFactors {}
Expand Down
Loading
Loading