Skip to content
  •  
  •  
  •  
235 changes: 230 additions & 5 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appwrite"
version = "0.13.0"
version = "0.14.0-rc.1"
edition = "2021"
rust-version = "1.83"
authors = ["appwrite"]
Expand Down Expand Up @@ -37,7 +37,7 @@ security-framework = ">=3, <3.7"

[dev-dependencies]
tokio-test = "=0.4.4"
wiremock = "=0.5.22"
wiremock = "=0.6.4"

[lib]
name = "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.13.0"
appwrite = "0.14.0-rc.1"
tokio = { version = "1.48", features = ["full"] }
```

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-initials.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Some("<NAME>"), // optional
Some(0), // optional
Some(0), // optional
Some("") // optional
Some("FFFFFF") // optional
).await?;

let _ = result;
Expand Down
29 changes: 29 additions & 0 deletions docs/examples/avatars/get-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
```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);

let result = avatars.get_photo(
Some(0), // optional
Some(0), // optional
Some(0), // optional
Some("png"), // optional
Some("g"), // optional
Some("current()"), // optional
Some("<EMAIL_HASH>"), // optional
Some("<NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
4 changes: 2 additions & 2 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_big_int_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(0), // optional
Some(0), // optional
Some(1000000), // optional
Some(0), // optional
Some(false) // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-boolean-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_boolean_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(false), // optional
Some(false) // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-datetime-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_datetime_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("2020-10-15T06:38:00.000+00:00"), // optional
Some(false) // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-email-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_email_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("email@example.com"), // optional
Some(false) // optional
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/create-enum-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_enum_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
vec![],
"<KEY>",
vec!["active".into(), "inactive".into()],
false,
Some("<DEFAULT>"), // optional
Some("active"), // optional
Some(false) // optional
).await?;

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/create-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_float_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(0), // optional
Some(0), // optional
Some(0), // optional
Some(100), // optional
Some(10.5), // optional
Some(false) // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_index(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
appwrite::enums::DatabasesIndexType::Key,
vec![],
Some(vec![appwrite::enums::OrderBy::Asc]), // optional
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/create-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_integer_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(0), // optional
Some(0), // optional
Some(0), // optional
Some(100), // optional
Some(10), // optional
Some(false) // optional
).await?;

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-ip-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_ip_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(""), // optional
Some("192.0.2.0"), // optional
Some(false) // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_line_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]) // optional
).await?;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-longtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_longtext_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("<DEFAULT>"), // optional
Some("Hello World"), // optional
Some(false), // optional
Some(false) // optional
).await?;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-mediumtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_mediumtext_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("<DEFAULT>"), // optional
Some("Hello World"), // optional
Some(false), // optional
Some(false) // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_point_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(vec![1, 2]) // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_polygon_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]) // optional
).await?;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-relationship-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<RELATED_COLLECTION_ID>",
appwrite::enums::RelationshipType::OneToOne,
Some(false), // optional
Some(""), // optional
Some(""), // optional
Some("<KEY>"), // optional
Some("<TWO_WAY_KEY>"), // optional
Some(appwrite::enums::RelationMutate::Cascade) // optional
).await?;

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-string-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_string_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
1,
false,
Some("<DEFAULT>"), // optional
Some("Hello World"), // optional
Some(false), // optional
Some(false) // optional
).await?;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-text-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_text_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("<DEFAULT>"), // optional
Some("Hello World"), // optional
Some(false), // optional
Some(false) // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-url-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_url_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("https://example.com"), // optional
Some(false) // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-varchar-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.create_varchar_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
1,
false,
Some("<DEFAULT>"), // optional
Some("Hello World"), // optional
Some(false), // optional
Some(false) // optional
).await?;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<DATABASE_ID>",
"<COLLECTION_ID>",
"<DOCUMENT_ID>",
"",
Some(0), // optional
"<ATTRIBUTE>",
Some(1), // optional
Some(0), // optional
Some("<TRANSACTION_ID>") // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/delete-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
databases.delete_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
""
"<KEY>"
).await?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/delete-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
databases.delete_index(
"<DATABASE_ID>",
"<COLLECTION_ID>",
""
"<KEY>"
).await?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/get-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.get_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
""
"<KEY>"
).await?;

let _ = result;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/get-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.get_index(
"<DATABASE_ID>",
"<COLLECTION_ID>",
""
"<KEY>"
).await?;

let _ = result;
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<DATABASE_ID>",
"<COLLECTION_ID>",
"<DOCUMENT_ID>",
"",
Some(0), // optional
Some(0), // optional
"<ATTRIBUTE>",
Some(1), // optional
Some(100), // optional
Some("<TRANSACTION_ID>") // optional
).await?;

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.update_big_int_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(0),
Some(0), // optional
Some(0), // optional
Some("") // optional
Some(1000000), // optional
Some("<NEW_KEY>") // optional
).await?;

let _ = result;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/update-boolean-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.update_boolean_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some(false),
Some("") // optional
Some("<NEW_KEY>") // optional
).await?;

let _ = result;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/update-datetime-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.update_datetime_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("2020-10-15T06:38:00.000+00:00"),
Some("") // optional
Some("<NEW_KEY>") // optional
).await?;

let _ = result;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/update-email-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = databases.update_email_attribute(
"<DATABASE_ID>",
"<COLLECTION_ID>",
"",
"<KEY>",
false,
Some("email@example.com"),
Some("") // optional
Some("<NEW_KEY>") // optional
).await?;

let _ = result;
Expand Down
Loading