feat: Rust SDK update for version 0.11.0#24
Conversation
Greptile SummaryThis PR updates the Rust SDK from 0.10.0 to 0.11.0, tracking upstream Appwrite API changes. Several services are removed (
Confidence Score: 4/5Safe 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
Reviews (2): Last reviewed commit: "chore: update Rust SDK to 0.11.0" | Re-trigger Greptile |
| pub user_info_url: String, | ||
| /// OpenID Connect prompt values controlling the authentication and consent | ||
| /// screens. |
There was a problem hiding this 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.
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.| 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()) | ||
| } | ||
| } |
There was a problem hiding this 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.
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!
This PR contains updates to the SDK for version 0.11.0.
What's Changed
Healthservice and allHealth*models and enumsUsageservice (list_events,list_gauges) andUsage*list/metric modelsNotificationsservice,Notification, andNotificationListmodelslist_message_logs,list_provider_logs,list_subscriber_logs,list_topic_logstables_db.create()parameterdedicated_database_idtospecificationnew_specificationparameter tobackups.create_restoration()tokenparameter tofunctions.get_deployment_download()promptandmax_ageparameters toproject.update_o_auth2_oidc()default_scopesparameter toproject.update_o_auth2_server()modefield toBlockmodelOrganizationserviceget,update,delete, and membership management methodsupdate_o_auth2_appwrite()method,OAuth2Appwritemodel, andAppwriteOAuth providerset_bearer,set_dev_key,set_cookie,set_forwarded_user_agent, and impersonation headersQuery::vector_dot,Query::vector_cosine,Query::vector_euclideanvector search methodsBillingPlanmodel family,Program,AdditionalResource,UsageBillingPlanmodelsDatabaseStatus,BillingPlanGroup,OAuth2OidcPrompt,ProjectOAuth2OidcPromptenumsstatusfield onDatabasemodelLocalemodelproject.oauth2key scopes to key scope enumsoAuth2ServerDefaultScopesfield onProjectmodel