Skip to content

feat: Rust SDK update for version 0.11.0#24

Merged
ChiragAgg5k merged 2 commits into
mainfrom
dev
Jul 13, 2026
Merged

feat: Rust SDK update for version 0.11.0#24
ChiragAgg5k merged 2 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Jul 13, 2026

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 0.11.0.

What's Changed

  • Breaking: removed Health service and all Health* models and enums
  • Breaking: removed Usage service (list_events, list_gauges) and Usage* list/metric models
  • Breaking: removed Notifications service, Notification, and NotificationList models
  • Breaking: removed messaging list_message_logs, list_provider_logs, list_subscriber_logs, list_topic_logs
  • Breaking: renamed tables_db.create() parameter dedicated_database_id to specification
  • Breaking: added new_specification parameter to backups.create_restoration()
  • Breaking: added token parameter to functions.get_deployment_download()
  • Breaking: added prompt and max_age parameters to project.update_o_auth2_oidc()
  • Breaking: added default_scopes parameter to project.update_o_auth2_server()
  • Breaking: added required mode field to Block model
  • Added: Organization service get, update, delete, and membership management methods
  • Added: update_o_auth2_appwrite() method, OAuth2Appwrite model, and Appwrite OAuth provider
  • Added: client setters set_bearer, set_dev_key, set_cookie, set_forwarded_user_agent, and impersonation headers
  • Added: Query::vector_dot, Query::vector_cosine, Query::vector_euclidean vector search methods
  • Added: BillingPlan model family, Program, AdditionalResource, UsageBillingPlan models
  • Added: DatabaseStatus, BillingPlanGroup, OAuth2OidcPrompt, ProjectOAuth2OidcPrompt enums
  • Added: optional status field on Database model
  • Added: geolocation, timezone, ASN, and ISP fields on Locale model
  • Added: organization and project.oauth2 key scopes to key scope enums
  • Added: oAuth2ServerDefaultScopes field on Project model

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Rust SDK from 0.10.0 to 0.11.0, tracking upstream Appwrite API changes. Several services are removed (Health, Notifications, Usage) and replaced with new Organization service endpoints, along with new models for billing plans, organization membership, OAuth2 Appwrite, and program management.

  • Removals: Health, Notifications, and Usage services (and their associated models/enums) are deleted entirely; existing callers will need to migrate.
  • New Organization service: CRUD for the current organization plus membership management (list, create, get, update, delete); the companion Organization model carries extensive billing metadata.
  • API parameter updates: TablesDB.create renames dedicated_database_idspecification; backups.create_restoration gains new_specification; functions.get_deployment_download gains token; project.update_o_auth2_oidc gains prompt and max_age; project.update_o_auth2_server gains default_scopes.

Confidence Score: 4/5

Safe to merge for fully-configured organizations, but free-tier or partially-configured organizations will hit runtime deserialization failures on organization.get().

The new Organization model defines many billing-related ID and date fields as required String rather than Option. Free-tier organizations will have these absent in the API response, causing runtime deserialization failures for all callers of organization.get(). The remaining changes follow established patterns correctly.

src/models/organization.rs — review which billing ID and date fields can legitimately be absent from API responses and mark those as Option.

Important Files Changed

Filename Overview
src/models/organization.rs New Organization model; many billing-related fields typed as required String that are likely absent/null for free-tier or partially-configured organizations, risking runtime deserialization failures.
src/services/organization.rs New Organization service with CRUD operations for the organization and its memberships; logic looks correct.
src/models/o_auth2_oidc.rs Adds prompt (Vec) and max_age (Option) fields; prompt lacks #[serde(default)] for backward compatibility with older server responses.
src/services/health.rs Entire Health service removed as part of the 0.11.0 API spec update.
src/services/notifications.rs Entire Notifications service removed as part of the 0.11.0 API spec update.
src/services/usage.rs Entire Usage service removed as part of the 0.11.0 API spec update.
src/services/tables_db.rs Renames create() parameter from dedicated_database_id/dedicatedDatabaseId to specification, tracking the upstream API change.
src/models/program.rs New Program model with all required String fields; looks complete.
src/enums/o_auth2_oidc_prompt.rs New OAuth2OidcPrompt enum; byte-for-byte identical to ProjectOAuth2OidcPrompt (flagged in prior review thread).
src/models/billing_plan.rs New BillingPlan model with extensive plan-limit fields; all required types look appropriate for plan configuration data.

Reviews (2): Last reviewed commit: "chore: update Rust SDK to 0.11.0" | Re-trigger Greptile

Comment on lines 33 to +35
pub user_info_url: String,
/// OpenID Connect prompt values controlling the authentication and consent
/// screens.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing #[serde(default)] on required Vec field

prompt is added as a bare Vec<OAuth2OidcPrompt> without #[serde(default)]. serde will return a deserialization error if the server omits the key entirely (e.g., any Appwrite instance that hasn't been updated yet). The sibling field max_age in the same block correctly uses Option<i64>, suggesting the API can omit it — if the API can also return OAuth2Oidc without prompt, all callers of update_o_auth2_oidc will start seeing runtime deserialization failures.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models/o_auth2_oidc.rs
Line: 33-35

Comment:
**Missing `#[serde(default)]` on required Vec field**

`prompt` is added as a bare `Vec<OAuth2OidcPrompt>` without `#[serde(default)]`. serde will return a deserialization error if the server omits the key entirely (e.g., any Appwrite instance that hasn't been updated yet). The sibling field `max_age` in the same block correctly uses `Option<i64>`, suggesting the API can omit it — if the API can also return `OAuth2Oidc` without `prompt`, all callers of `update_o_auth2_oidc` will start seeing runtime deserialization failures.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

Comment on lines +1 to +32
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
pub enum OAuth2OidcPrompt {
#[serde(rename = "none")]
#[default]
None,
#[serde(rename = "login")]
Login,
#[serde(rename = "consent")]
Consent,
#[serde(rename = "select_account")]
SelectAccount,
}

impl OAuth2OidcPrompt {
/// Get the string value of the enum
pub fn as_str(&self) -> &str {
match self {
OAuth2OidcPrompt::None => "none",
OAuth2OidcPrompt::Login => "login",
OAuth2OidcPrompt::Consent => "consent",
OAuth2OidcPrompt::SelectAccount => "select_account",
}
}
}

impl std::fmt::Display for OAuth2OidcPrompt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.as_str())
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate enum definition with ProjectOAuth2OidcPrompt

OAuth2OidcPrompt and ProjectOAuth2OidcPrompt are byte-for-byte identical (same variants: None, Login, Consent, SelectAccount; same serde renames; same as_str and Display impls). Any future change to prompt values requires updating both independently, and callers cannot interconvert between the two without a match or conversion. Consider consolidating to a single shared type or type alias.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/enums/o_auth2_oidc_prompt.rs
Line: 1-32

Comment:
**Duplicate enum definition with `ProjectOAuth2OidcPrompt`**

`OAuth2OidcPrompt` and `ProjectOAuth2OidcPrompt` are byte-for-byte identical (same variants: `None`, `Login`, `Consent`, `SelectAccount`; same serde renames; same `as_str` and `Display` impls). Any future change to prompt values requires updating both independently, and callers cannot interconvert between the two without a match or conversion. Consider consolidating to a single shared type or type alias.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

@ChiragAgg5k
ChiragAgg5k merged commit c64cd70 into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants