Skip to content

Commit 643db32

Browse files
committed
chore: update Rust SDK to 0.3.0
1 parent fc38ae7 commit 643db32

445 files changed

Lines changed: 10867 additions & 94 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3232
- Health service with 24 methods
3333
- Locale service with 8 methods
3434
- Messaging service with 56 methods
35-
- Project service with 29 methods
35+
- Project service with 25 methods
3636
- Sites service with 25 methods
3737
- Storage service with 13 methods
3838
- TablesDB service with 69 methods
3939
- Teams service with 13 methods
4040
- Tokens service with 5 methods
41-
- Users service with 49 methods
41+
- Users service with 48 methods
4242
- Webhooks service with 6 methods
4343

4444
### Services
@@ -434,15 +434,11 @@ The Messaging service allows you to send messages to any provider type (SMTP, pu
434434

435435
#### Project
436436
The Project service allows you to manage all the projects in your Appwrite server.
437-
- `update_canonical_emails()` - Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project.
438-
- `update_disposable_emails()` - Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project.
439-
- `update_free_emails()` - Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project.
440437
- `list_keys()` - Get a list of all API keys from the current project.
441438
- `create_key()` - Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.
442439
- `get_key()` - Get a key by its unique ID.
443440
- `update_key()` - Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
444441
- `delete_key()` - Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
445-
- `update_labels()` - Update the project labels. Labels can be used to easily filter projects in an organization.
446442
- `list_platforms()` - Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.
447443
- `create_android_platform()` - Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API.
448444
- `update_android_platform()` - Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID.
@@ -672,9 +668,6 @@ The Users service allows you to manage your project users.
672668
- `update_impersonator()` - Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
673669

674670
- `create_jwt()` - Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
675-
- `update_labels()` - Update the user labels by its unique ID.
676-
677-
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
678671
- `list_logs()` - Get the user activity logs list by its unique ID.
679672
- `list_memberships()` - Get the user membership list by its unique ID.
680673
- `update_mfa()` - Enable or disable MFA on a user account.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_anonymous_session().await?;
15+
16+
let _ = result;
17+
18+
Ok(())
19+
}
20+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_email_password_session(
15+
"email@example.com",
16+
"password"
17+
).await?;
18+
19+
let _ = result;
20+
21+
Ok(())
22+
}
23+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_email_token(
15+
"<USER_ID>",
16+
"email@example.com",
17+
Some(false) // optional
18+
).await?;
19+
20+
let _ = result;
21+
22+
Ok(())
23+
}
24+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_email_verification(
15+
"https://example.com"
16+
).await?;
17+
18+
let _ = result;
19+
20+
Ok(())
21+
}
22+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_jwt(
15+
Some(0) // optional
16+
).await?;
17+
18+
let _ = result;
19+
20+
Ok(())
21+
}
22+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_magic_url_token(
15+
"<USER_ID>",
16+
"email@example.com",
17+
Some("https://example.com"), // optional
18+
Some(false) // optional
19+
).await?;
20+
21+
let _ = result;
22+
23+
Ok(())
24+
}
25+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_mfa_authenticator(
15+
appwrite::enums::AuthenticatorType::Totp
16+
).await?;
17+
18+
let _ = result;
19+
20+
Ok(())
21+
}
22+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_mfa_challenge(
15+
appwrite::enums::AuthenticationFactor::Email
16+
).await?;
17+
18+
let _ = result;
19+
20+
Ok(())
21+
}
22+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```rust
2+
use appwrite::Client;
3+
use appwrite::services::Account;
4+
5+
#[tokio::main]
6+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
7+
let client = Client::new();
8+
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
9+
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
10+
client.set_session(""); // The user session to authenticate with
11+
12+
let account = Account::new(&client);
13+
14+
let result = account.create_mfa_recovery_codes().await?;
15+
16+
let _ = result;
17+
18+
Ok(())
19+
}
20+
```

0 commit comments

Comments
 (0)